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:

lib/gi-crystal/src/auto/gio-2.0/file_monitor.cr

Instance Method Summary

Instance methods inherited from struct GObject::Signal

[](detail : String) : self [], name : String name

Constructor methods inherited from struct GObject::Signal

new(source : GObject::Object, detail : Nil | String = nil) new

Instance Method Detail

def connect(*, after : Bool = false, &block : Proc(Gio::File, Gio::File | Nil, Gio::FileMonitorEvent, Nil)) : GObject::SignalConnection #

[View source]
def connect(handler : Proc(Gio::File, Gio::File | Nil, Gio::FileMonitorEvent, Nil), *, after : Bool = false) : GObject::SignalConnection #

[View source]
def connect(handler : Proc(Gio::FileMonitor, Gio::File, Gio::File | Nil, Gio::FileMonitorEvent, Nil), *, after : Bool = false) : GObject::SignalConnection #

[View source]
def emit(file : Gio::File, other_file : Gio::File | Nil, event_type : Gio::FileMonitorEvent) : Nil #

[View source]
def name : String #
Description copied from struct GObject::Signal

The signal name


[View source]