PDA

View Full Version : Gio::FileMonitor question



kahumba
March 10th, 2010, 04:17 AM
Hi,
The Gio::FileMonitor's event function looks like this:


on_changed (
const Glib::RefPtr< File >& file,
const Glib::RefPtr< File >& other_file,
FileMonitorEvent event_type)
Afaik first file argument is the file that changed, but what for is the second file argument?

kahumba
March 10th, 2010, 04:36 PM
No one?

Zugzwang
March 10th, 2010, 05:13 PM
No clue. Seems to be undocumented. Probably that parameter is put there to be able to support file renaming operations at some point in the future.

kahumba
March 10th, 2010, 05:41 PM
Thanks, well, file renaming so far goes through "event deleted" and then "event created" events, so it's possible what you're suggesting is true, but I wonder why such an obvious issue hasn't been "fixed" when they created the API in the first place, (Java7 handles this easily through 'ENTRY_MODIFY"..), it's not like sending a man to the moon..

cszikszoy
March 10th, 2010, 10:20 PM
Other file is supposed to be used when you move or rename a file. File would be the name of the original file, other would be the new name. Unfortunately, the new file argument was never used in the core of GIO. There was a bug report, and there has been some activity on this (I think resolving the issue and actually using other file as it was meant to be used) but I can't seem to find the bug report.