Skip to content

Commit

Permalink
Improve thumbnailing code Part1: Explicitly handle all FileMonitorEve…
Browse files Browse the repository at this point in the history
…nts (#2461)
  • Loading branch information
jeremypw authored Aug 28, 2024
1 parent 688c841 commit 452d5ed
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions libcore/Directory.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1001,9 +1001,7 @@ public class Files.Directory : Object {
case FileMonitorEvent.DELETED:
Files.FileChanges.queue_file_removed (_file);
break;
case FileMonitorEvent.CHANGED:
// e.g. When data streamed into file
case FileMonitorEvent.ATTRIBUTE_CHANGED: /* test last to avoid unnecessary action when file renamed */
case FileMonitorEvent.ATTRIBUTE_CHANGED:
// e.g. changed permissions
Files.FileChanges.queue_file_changed (_file);
break;
Expand All @@ -1012,9 +1010,16 @@ public class Files.Directory : Object {
// have been done if required by one of the set of changes so doing it again is inefficient.
Files.FileChanges.queue_file_changed (_file);
break;
// Move events should not be received as relevant flag is not set
case FileMonitorEvent.MOVED:
case FileMonitorEvent.MOVED_IN:
case FileMonitorEvent.MOVED_OUT:
break;
default:
// Icon does not currently change for these events
case FileMonitorEvent.RENAMED:
case FileMonitorEvent.PRE_UNMOUNT:
case FileMonitorEvent.UNMOUNTED:
case FileMonitorEvent.CHANGED:
break;
}

Expand Down

0 comments on commit 452d5ed

Please sign in to comment.