diff options
author | Kalev Lember <klember@redhat.com> | 2016-07-06 10:22:38 +0200 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2016-07-06 16:01:02 +0200 |
commit | f3477224a8e531a7f6e59fab4a7d5713cee5ac82 (patch) | |
tree | 45dd4485a9a5635335c9373a1e6993567e60cd2b | |
parent | 1e0c0f4359dacafbc998e84afad236234fba2410 (diff) | |
download | appstream-glib-f3477224a8e531a7f6e59fab4a7d5713cee5ac82.tar.gz |
monitor: Use non-deprecated glib API for monitoring renames
-rw-r--r-- | libappstream-glib/as-monitor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libappstream-glib/as-monitor.c b/libappstream-glib/as-monitor.c index 1066fee..fde1c09 100644 --- a/libappstream-glib/as-monitor.c +++ b/libappstream-glib/as-monitor.c @@ -169,6 +169,8 @@ _g_file_monitor_to_string (GFileMonitorEvent ev) return "UNMOUNTED"; if (ev == G_FILE_MONITOR_EVENT_MOVED) return "MOVED"; + if (ev == G_FILE_MONITOR_EVENT_RENAMED) + return "RENAMED"; return NULL; } @@ -355,7 +357,7 @@ as_monitor_file_changed_cb (GFileMonitor *mon, _g_ptr_array_str_add (priv->queue_changed, filename); } break; - case G_FILE_MONITOR_EVENT_MOVED: + case G_FILE_MONITOR_EVENT_RENAMED: /* a temp file that was just created and atomically * renamed to its final destination */ tmp = _g_ptr_array_str_find (priv->queue_temp, filename); @@ -415,7 +417,7 @@ as_monitor_add_directory (AsMonitor *monitor, /* create new file monitor */ file = g_file_new_for_path (filename); - mon = g_file_monitor_directory (file, G_FILE_MONITOR_SEND_MOVED, + mon = g_file_monitor_directory (file, G_FILE_MONITOR_WATCH_MOVES, cancellable, error); if (mon == NULL) return FALSE; |