diff options
author | Richard Hughes <richard@hughsie.com> | 2016-10-17 12:07:46 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-10-17 12:07:46 +0100 |
commit | ca73182b0ea7063e046e156dea494f3526431bdd (patch) | |
tree | e191185153c25f1c70bbe34153f65d2e01f7b4ae | |
parent | f445d0b3cd0d9017dea3ef9745b327f0753d5ec4 (diff) | |
download | appstream-glib-ca73182b0ea7063e046e156dea494f3526431bdd.tar.gz |
Do not sent a REMOVED signal when deleting a transient temp file
-rw-r--r-- | libappstream-glib/as-monitor.c | 7 |
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 */ |