[glib/wip/gdesktopappinfo: 2/20] directory monitor: use the right 'mount_notify'
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gdesktopappinfo: 2/20] directory monitor: use the right 'mount_notify'
- Date: Wed, 25 Sep 2013 20:36:59 +0000 (UTC)
commit 7fa7344ca194b63733471ed461eb606d4ae5dd88
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Jul 25 13:19:56 2013 -0400
directory monitor: use the right 'mount_notify'
During initialisation of a directory monitor with the
G_FILE_MONITOR_WATCH_MOUNTS flag set, GLocalDirectory monitor will add a
UNIX mount watch in case the file notification backend doesn't support
reporting these events for itself.
Unfortunately, it was performing the check incorrectly, resulting in a
monitor always being added.
Fix that, and add the #define for G_LOCAL_DIRECTORY_MONITOR_GET_CLASS()
that was also missing (since the fix depends on it).
https://bugzilla.gnome.org/show_bug.cgi?id=704882
gio/glocaldirectorymonitor.c | 2 +-
gio/glocaldirectorymonitor.h | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/glocaldirectorymonitor.c b/gio/glocaldirectorymonitor.c
index f175723..64f69ec 100644
--- a/gio/glocaldirectorymonitor.c
+++ b/gio/glocaldirectorymonitor.c
@@ -121,7 +121,7 @@ g_local_directory_monitor_constructor (GType type,
local_monitor->dirname = g_strdup (dirname);
local_monitor->flags = flags;
- if (!klass->mount_notify &&
+ if (!G_LOCAL_DIRECTORY_MONITOR_GET_CLASS (local_monitor)->mount_notify &&
(flags & G_FILE_MONITOR_WATCH_MOUNTS))
{
#ifdef G_OS_WIN32
diff --git a/gio/glocaldirectorymonitor.h b/gio/glocaldirectorymonitor.h
index a2bbc11..95a3f6f 100644
--- a/gio/glocaldirectorymonitor.h
+++ b/gio/glocaldirectorymonitor.h
@@ -34,6 +34,7 @@ G_BEGIN_DECLS
#define G_LOCAL_DIRECTORY_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k),
G_TYPE_LOCAL_DIRECTORY_MONITOR, GLocalDirectoryMonitorClass))
#define G_IS_LOCAL_DIRECTORY_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o),
G_TYPE_LOCAL_DIRECTORY_MONITOR))
#define G_IS_LOCAL_DIRECTORY_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k),
G_TYPE_LOCAL_DIRECTORY_MONITOR))
+#define G_LOCAL_DIRECTORY_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o),
G_TYPE_LOCAL_DIRECTORY_MONITOR, GLocalDirectoryMonitorClass))
#define G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME "gio-local-directory-monitor"
#define G_NFS_DIRECTORY_MONITOR_EXTENSION_POINT_NAME "gio-nfs-directory-monitor"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]