summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-10-17 12:07:46 +0100
committerRichard Hughes <richard@hughsie.com>2017-01-17 10:36:19 +0000
commit930e75be429db8412f88ac0d504f5cfc668c9fea (patch)
tree2228da08e67196855d1a50f28daf88134e0787c1
parent448e1aabb0ab316ddf925b7614ee51671d2480e7 (diff)
downloadappstream-glib-930e75be429db8412f88ac0d504f5cfc668c9fea.tar.gz
Do not sent a REMOVED signal when deleting a transient temp file
-rw-r--r--libappstream-glib/as-monitor.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libappstream-glib/as-monitor.c b/libappstream-glib/as-monitor.c
index fde1c09..799d869 100644
--- a/libappstream-glib/as-monitor.c
+++ b/libappstream-glib/as-monitor.c
@@ -348,7 +348,12 @@ as_monitor_file_changed_cb (GFileMonitor *mon,
as_monitor_process_pending_trigger (monitor);
break;
case G_FILE_MONITOR_EVENT_DELETED:
- as_monitor_emit_removed (monitor, filename);
+ /* only emit notifications for files we know about */
+ if (_g_ptr_array_str_find (priv->files, filename)) {
+ as_monitor_emit_removed (monitor, filename);
+ } else {
+ g_debug ("ignoring deleted file %s", filename);
+ }
break;
case G_FILE_MONITOR_EVENT_CHANGED:
/* if the file is not pending and not a temp file, add */