[glib/wip/mount-watcher: 6/24] Deprecate g_unix_mount_monitor_set_rate_limit()



commit e5424fa145ca55dce14aa512ba36c0ec8e224cdd
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jan 8 02:16:50 2015 -0500

    Deprecate g_unix_mount_monitor_set_rate_limit()
    
    Deprecate g_unix_mount_monitor_set_rate_limit() and turn it into a
    no-op.
    
    This function doesn't behave as advertised.  It only controls rate
    limiting for filesystem-based monitors.  It has no impact over reporting
    mount changes on Linux, for example, because those are based on polling
    for changes in /proc (which doesn't use filesystem monitors).  It also
    has no impact on Mac OS because a library interface is used there.
    
    This was added in https://bugzilla.gnome.org/show_bug.cgi?id=521946 in
    order to be used by HAL, which is effectively dead.  udisks no longer
    uses this code at all.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742599

 gio/gunixmounts.c |   18 +++++++++---------
 gio/gunixmounts.h |    2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 99266c9..54462d2 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -1495,22 +1495,22 @@ g_unix_mount_monitor_init (GUnixMountMonitor *monitor)
  * @limit_msec: a integer with the limit in milliseconds to
  *     poll for changes.
  *
- * Sets the rate limit to which the @mount_monitor will report
- * consecutive change events to the mount and mount point entry files.
+ * This function does nothing.
+ *
+ * Before 2.44, this was a partially-effective way of controlling the
+ * rate at which events would be reported under some uncommon
+ * circumstances.  Since @mount_monitor is a singleton, it also meant
+ * that calling this function would have side effects for other users of
+ * the monitor.
  *
  * Since: 2.18
+ *
+ * Deprecated:2.44:This function does nothing.  Don't call it.
  */
 void
 g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
                                      gint               limit_msec)
 {
-  g_return_if_fail (G_IS_UNIX_MOUNT_MONITOR (mount_monitor));
-
-  if (mount_monitor->fstab_monitor != NULL)
-    g_file_monitor_set_rate_limit (mount_monitor->fstab_monitor, limit_msec);
-
-  if (mount_monitor->mtab_monitor != NULL)
-    g_file_monitor_set_rate_limit (mount_monitor->mtab_monitor, limit_msec);
 }
 
 /**
diff --git a/gio/gunixmounts.h b/gio/gunixmounts.h
index 9680680..d4bb258 100644
--- a/gio/gunixmounts.h
+++ b/gio/gunixmounts.h
@@ -129,7 +129,7 @@ GLIB_AVAILABLE_IN_2_44
 GUnixMountMonitor *g_unix_mount_monitor_get            (void);
 GLIB_DEPRECATED_IN_2_44_FOR(g_unix_mount_monitor_get)
 GUnixMountMonitor *g_unix_mount_monitor_new            (void);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_44
 void               g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
                                                         int                limit_msec);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]