Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 821103
Collapse All | Expand All

(-)a/CMakeLists.txt (-2 / +1 lines)
Lines 126-133 Link Here
126
# Used by KMountPoint
126
# Used by KMountPoint
127
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
127
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
128
    find_package(LibMount REQUIRED)
128
    find_package(LibMount REQUIRED)
129
    find_package(Blkid REQUIRED)
129
    set(HAVE_LIB_MOUNT ${LibMount_FOUND})
130
    set(HAVE_LIBS_MOUNT_AND_BLKID ${LibMount_FOUND} AND ${Blkid_FOUND})
131
endif()
130
endif()
132
131
133
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
132
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
(-)a/src/core/CMakeLists.txt (-3 / +2 lines)
Lines 224-232 Link Here
224
  target_link_libraries(KF5KIOCore PRIVATE ${ACL_LIBS})
224
  target_link_libraries(KF5KIOCore PRIVATE ${ACL_LIBS})
225
endif()
225
endif()
226
226
227
if(HAVE_LIBS_MOUNT_AND_BLKID)
227
if(HAVE_LIBS_MOUNT)
228
  # libmount links against blkid anyway
228
  target_link_libraries(KF5KIOCore PRIVATE LibMount::LibMount)
229
  target_link_libraries(KF5KIOCore PRIVATE LibMount::LibMount Blkid::Blkid)
230
endif()
229
endif()
231
230
232
# this should be done by cmake, see bug 371721
231
# this should be done by cmake, see bug 371721
(-)a/src/core/config-kmountpoint.h.cmake (-1 / +1 lines)
Lines 1-7 Link Here
1
#cmakedefine01 HAVE_GETMNTINFO
1
#cmakedefine01 HAVE_GETMNTINFO
2
#cmakedefine01 GETMNTINFO_USES_STATVFS
2
#cmakedefine01 GETMNTINFO_USES_STATVFS
3
3
4
#cmakedefine01 HAVE_LIBS_MOUNT_AND_BLKID
4
#cmakedefine01 HAVE_LIBS_MOUNT
5
5
6
#cmakedefine01 HAVE_SYS_MOUNT_H
6
#cmakedefine01 HAVE_SYS_MOUNT_H
7
#cmakedefine01 HAVE_SYS_TYPES_H
7
#cmakedefine01 HAVE_SYS_TYPES_H
(-)a/src/core/kmountpoint.cpp (-14 / +4 lines)
Lines 43-49 Link Here
43
#endif
43
#endif
44
44
45
// Linux
45
// Linux
46
#if HAVE_LIBS_MOUNT_AND_BLKID
46
#if HAVE_LIBS_MOUNT
47
#include <libmount/libmount.h>
47
#include <libmount/libmount.h>
48
#include <blkid/blkid.h>
48
#include <blkid/blkid.h>
49
#endif
49
#endif
Lines 155-161 Link Here
155
#ifdef Q_OS_WIN
155
#ifdef Q_OS_WIN
156
    result = KMountPoint::currentMountPoints(infoNeeded);
156
    result = KMountPoint::currentMountPoints(infoNeeded);
157
157
158
#elif HAVE_LIBS_MOUNT_AND_BLKID
158
#elif HAVE_LIBS_MOUNT
159
    if (struct libmnt_table *table = mnt_new_table()) {
159
    if (struct libmnt_table *table = mnt_new_table()) {
160
        // By default parses "/etc/fstab"
160
        // By default parses "/etc/fstab"
161
        if (mnt_table_parse_fstab(table, nullptr) == 0) {
161
        if (mnt_table_parse_fstab(table, nullptr) == 0) {
Lines 176-198 Link Here
176
                // or some network mount
176
                // or some network mount
177
                if (const char *source = mnt_fs_get_source(fs)) {
177
                if (const char *source = mnt_fs_get_source(fs)) {
178
                    mp->d->m_mountedFrom = QFile::decodeName(source);
178
                    mp->d->m_mountedFrom = QFile::decodeName(source);
179
                    if (mp->d->m_mountedFrom.startsWith(QLatin1String("UUID")) || mp->d->m_mountedFrom.startsWith(QLatin1String("LABEL"))) {
180
                        // Use blkid to resolve UUID/LABEL to the device file
181
                        if (char *blkSource = blkid_evaluate_spec(source, nullptr)) {
182
                            mp->d->m_mountedFrom = QFile::decodeName(blkSource);
183
                            free(blkSource);
184
                            if ((infoNeeded & KMountPoint::NeedRealDeviceName) //
185
                                && mp->d->m_mountedFrom.startsWith(QLatin1String("/dev/"))) {
186
                                mp->d->m_device = mp->d->m_mountedFrom;
187
                            }
188
                        }
189
                    }
190
                }
179
                }
191
180
192
                if (infoNeeded & NeedMountOptions) {
181
                if (infoNeeded & NeedMountOptions) {
193
                    mp->d->m_mountOptions = QFile::decodeName(mnt_fs_get_options(fs)).split(QLatin1Char(','));
182
                    mp->d->m_mountOptions = QFile::decodeName(mnt_fs_get_options(fs)).split(QLatin1Char(','));
194
                }
183
                }
195
184
185
                mp->d->finalizePossibleMountPoint(infoNeeded);
196
                result.append(mp);
186
                result.append(mp);
197
            }
187
            }
198
            mnt_free_iter(itr);
188
            mnt_free_iter(itr);
Lines 319-325 Link Here
319
        }
309
        }
320
    }
310
    }
321
311
322
#elif HAVE_LIBS_MOUNT_AND_BLKID
312
#elif HAVE_LIBS_MOUNT
323
    if (struct libmnt_table *table = mnt_new_table()) {
313
    if (struct libmnt_table *table = mnt_new_table()) {
324
        // By default, parses "/proc/self/mountinfo"
314
        // By default, parses "/proc/self/mountinfo"
325
        if (mnt_table_parse_mtab(table, nullptr) == 0) {
315
        if (mnt_table_parse_mtab(table, nullptr) == 0) {

Return to bug 821103