[system/kio-snapshot] common: support older libbtrfsutil versions with aliases

Bharadwaj Raju <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 206bb85cca5355ba8ab528b104b8f17f46d7dc73 by Bharadwaj Raju, on behalf of Carlos De Maine.
Committed on 18/07/2026 at 04:42.
Pushed by bharadwaj-raju into branch 'master'.

support older libbtrfsutil versions with aliases

version check to be less than 1.3.2 which is libbtrfsutil 6.17.1

M  +11   -1    common/btrfssnapshots.cpp

https://invent.kde.org/system/kio-snapshot/-/commit/206bb85cca5355ba8ab528b104b8f17f46d7dc73

diff --git a/common/btrfssnapshots.cpp b/common/btrfssnapshots.cpp
index 4ba4a0b..a4919be 100644
--- a/common/btrfssnapshots.cpp
+++ b/common/btrfssnapshots.cpp
@@ -3,11 +3,21 @@
 
     SPDX-License-Identifier: LGPL-2.0-or-later
 */
-
 #include "btrfssnapshots.h"
 
 #include <btrfsutil.h>
 
+#define BTRFS_UTIL_VERSION ( \
+(BTRFS_UTIL_VERSION_MAJOR * 10000) + \
+(BTRFS_UTIL_VERSION_MINOR * 100) + \
+(BTRFS_UTIL_VERSION_PATCH))
+
+#if BTRFS_UTIL_VERSION < 10302
+    #define btrfs_util_subvolume_get_info btrfs_util_subvolume_info
+    #define btrfs_util_subvolume_iter_next_info btrfs_util_subvolume_iterator_next_info
+    #define btrfs_util_subvolume_iter_create btrfs_util_create_subvolume_iterator
+#endif
+
 #include <QDir>
 #include <QFileInfo>
 #include <QString>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.