summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-10-17 12:07:46 +0100
committerRichard Hughes <richard@hughsie.com>2016-10-17 12:07:46 +0100
commitca73182b0ea7063e046e156dea494f3526431bdd (patch)
treee191185153c25f1c70bbe34153f65d2e01f7b4ae
parentf445d0b3cd0d9017dea3ef9745b327f0753d5ec4 (diff)
downloadappstream-glib-ca73182b0ea7063e046e156dea494f3526431bdd.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 */