[tracker] tracker-monitor: Tighten the scope of variables



commit 259c60910ebfd9254c8ad9847a36b87329bdacc8
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Dec 1 11:59:51 2017 +0100

    tracker-monitor: Tighten the scope of variables
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791067

 src/libtracker-miner/tracker-monitor.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index 5fb8dad..54cd3e8 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -42,8 +42,6 @@ struct TrackerMonitorPrivate {
 
        gboolean       enabled;
 
-       GType          monitor_backend;
-
        guint          monitor_limit;
        gboolean       monitor_limit_warned;
        guint          monitors_ignored;
@@ -197,7 +195,6 @@ tracker_monitor_init (TrackerMonitor *object)
        TrackerMonitorPrivate *priv;
        GFile                 *file;
        GFileMonitor          *monitor;
-       const gchar           *name;
        GError                *error = NULL;
 
        object->priv = TRACKER_MONITOR_GET_PRIVATE (object);
@@ -236,13 +233,16 @@ tracker_monitor_init (TrackerMonitor *object)
                /* Guessing limit... */
                priv->monitor_limit = 100;
        } else {
-               priv->monitor_backend = G_OBJECT_TYPE (monitor);
+               GType monitor_backend;
+               const gchar *name;
+
+               monitor_backend = G_OBJECT_TYPE (monitor);
 
                /* We use the name because the type itself is actually
                 * private and not available publically. Note this is
                 * subject to change, but unlikely of course.
                 */
-               name = g_type_name (priv->monitor_backend);
+               name = g_type_name (monitor_backend);
 
                /* Set limits based on backend... */
                if (strcmp (name, "GInotifyDirectoryMonitor") == 0 ||


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