mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-24 08:30:04 +01:00
gfilemonitor: Install properties all at once
This is a minor performance improvement, since the pspec list for the class now only has to be modified once, rather than twice. It also means we now have the `GParamSpec` pointers to hand in a `props` array, which will be used in the upcoming commits. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
5aa42683ee
commit
8ffdbb55d9
@ -70,6 +70,7 @@ typedef enum
|
||||
PROP_CANCELLED
|
||||
} GFileMonitorProperty;
|
||||
|
||||
static GParamSpec *props[PROP_CANCELLED + 1];
|
||||
static guint g_file_monitor_changed_signal;
|
||||
|
||||
static void
|
||||
@ -200,19 +201,21 @@ g_file_monitor_class_init (GFileMonitorClass *klass)
|
||||
*
|
||||
* The limit of the monitor to watch for changes, in milliseconds.
|
||||
*/
|
||||
g_object_class_install_property (object_class, PROP_RATE_LIMIT,
|
||||
g_param_spec_int ("rate-limit", NULL, NULL,
|
||||
0, G_MAXINT, DEFAULT_RATE_LIMIT_MSECS, G_PARAM_READWRITE |
|
||||
G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
|
||||
props[PROP_RATE_LIMIT] =
|
||||
g_param_spec_int ("rate-limit", NULL, NULL,
|
||||
0, G_MAXINT, DEFAULT_RATE_LIMIT_MSECS, G_PARAM_READWRITE |
|
||||
G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GFileMonitor:cancelled:
|
||||
*
|
||||
* Whether the monitor has been cancelled.
|
||||
*/
|
||||
g_object_class_install_property (object_class, PROP_CANCELLED,
|
||||
g_param_spec_boolean ("cancelled", NULL, NULL,
|
||||
FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
props[PROP_CANCELLED] =
|
||||
g_param_spec_boolean ("cancelled", NULL, NULL,
|
||||
FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, G_N_ELEMENTS (props), props);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user