1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-30 17:14:58 +01:00

GioLister: Fix use of deprecated functions

This commit is contained in:
Jonas Kvinge 2025-01-10 23:17:46 +01:00
parent 3e53d2b237
commit d9807b358e

View File

@ -484,16 +484,22 @@ void GioLister::DeviceInfo::ReadMountInfo(GMount *mount) {
} }
#ifdef HAVE_GIO_UNIX #ifdef HAVE_GIO_UNIX
#ifdef GLIB_VERSION_2_84
GUnixMountEntry *unix_mount = g_unix_mount_entry_for(g_file_get_path(root), nullptr);
#else
GUnixMountEntry *unix_mount = g_unix_mount_for(g_file_get_path(root), nullptr); GUnixMountEntry *unix_mount = g_unix_mount_for(g_file_get_path(root), nullptr);
#endif
if (unix_mount) { if (unix_mount) {
// the GIO's definition of system internal mounts include filesystems like // The GIO's definition of system internal mounts include filesystems like autofs, tmpfs, sysfs, etc,
// autofs, tmpfs, sysfs, etc, and various system directories, including the root, // and various system directories, including the root, /boot, /var, /home, etc.
// /boot, /var, /home, etc. #ifdef GLIB_VERSION_2_84
is_system_internal = g_unix_mount_entry_is_system_internal(unix_mount);
g_unix_mount_entry_free(unix_mount);
#else
is_system_internal = g_unix_mount_is_system_internal(unix_mount); is_system_internal = g_unix_mount_is_system_internal(unix_mount);
g_unix_mount_free(unix_mount); g_unix_mount_free(unix_mount);
// Although checking most of the internal mounts is safe, #endif
// we really don't want to touch autofs filesystems, as that would // Although checking most of the internal mounts is safe, we really don't want to touch autofs filesystems, as that would trigger automounting.
// trigger automounting.
if (is_system_internal) return; if (is_system_internal) return;
} }
#endif #endif