GNOME Bugzilla – Bug 751731
GFile/DirectoryMonitor emit move events with other_file=NULL
Last modified: 2015-07-07 11:51:40 UTC
With glib master from yesterday, the following Tracker tests in tests/libtracker-miner/tracker-monitor-test fail: /libtracker-miner/tracker-monitor/file-event/moved/to-not-monitored /libtracker-miner/tracker-monitor/directory-event/moved/to-not-monitored Both with the same error: (/home/carlos/Source/gnome/tracker/tests/libtracker-miner/.libs/lt-tracker-monitor-test:17595): GLib-GIO-CRITICAL **: g_file_get_path: assertion 'G_IS_FILE (file)' failed Trace/breakpoint trap (core dumped) The failing file is the other_file on a G_FILE_MONITOR_EVENT_MOVED, we used to rely on getting these cases translated into G_FILE_MONITOR_EVENT_DELETED by glib, and only get MOVED events if both source and dest are monitored. This doesn't seem to happen in my system's glib 2.44.1 (f22), where I get the DELETED event as TrackerMonitor/tests used to expect. Note that Tracker doesn't use yet G_FILE_MONITOR_WATCH_MOVES, and keeps using SEND_MOVED.
Created attachment 306925 [details] [review] file monitors: report MOVED only with both sides Make sure we know the destination file before reporting a MOVED event. Otherwise, we should just fall back to reporting it as a DELETED.
That makes the test suite pass again, thanks!
Attachment 306925 [details] pushed as 7ed76a4 - file monitors: report MOVED only with both sides
*** Bug 749225 has been marked as a duplicate of this bug. ***