struct Gio::FileMonitor::ChangedSignal

Overview

Emitted when @file has been changed.

If using %G_FILE_MONITOR_WATCH_MOVES on a directory monitor, and the information is available (and if supported by the backend), @event_type may be %G_FILE_MONITOR_EVENT_RENAMED, %G_FILE_MONITOR_EVENT_MOVED_IN or %G_FILE_MONITOR_EVENT_MOVED_OUT.

In all cases @file will be a child of the monitored directory. For renames, @file will be the old name and @other_file is the new name. For "moved in" events, @file is the name of the file that appeared and @other_file is the old name that it was moved from (in another directory). For "moved out" events, @file is the name of the file that used to be in this directory and @other_file is the name of the file at its new location.

It makes sense to treat %G_FILE_MONITOR_EVENT_MOVED_IN as equivalent to %G_FILE_MONITOR_EVENT_CREATED and %G_FILE_MONITOR_EVENT_MOVED_OUT as equivalent to %G_FILE_MONITOR_EVENT_DELETED, with extra information. %G_FILE_MONITOR_EVENT_RENAMED is equivalent to a delete/create pair. This is exactly how the events will be reported in the case that the %G_FILE_MONITOR_WATCH_MOVES flag is not in use.

If using the deprecated flag %G_FILE_MONITOR_SEND_MOVED flag and @event_type is %G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the old path, and @other_file will be set to a #GFile containing the new path.

In all the other cases, @other_file will be set to #NULL.

Defined in:

auto/gio-2.0/file_monitor.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(source, detail = nil) #

Instance Method Detail

def [](detail : String) : self #

def connect(&block : Proc(Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def connect(handler : Proc(Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def connect(handler : Proc(Gio::FileMonitor, Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def connect_after(&block : Proc(Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def connect_after(handler : Proc(Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def connect_after(handler : Proc(Gio::FileMonitor, Gio::File, Gio::File?, Gio::FileMonitorEvent, Nil)) #

def emit(file : Gio::File, other_file : Gio::File?, event_type : Gio::FileMonitorEvent) : Nil #

def name #