mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 04:43:06 +02: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
|
PROP_CANCELLED
|
||||||
} GFileMonitorProperty;
|
} GFileMonitorProperty;
|
||||||
|
|
||||||
|
static GParamSpec *props[PROP_CANCELLED + 1];
|
||||||
static guint g_file_monitor_changed_signal;
|
static guint g_file_monitor_changed_signal;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -200,19 +201,21 @@ g_file_monitor_class_init (GFileMonitorClass *klass)
|
|||||||
*
|
*
|
||||||
* The limit of the monitor to watch for changes, in milliseconds.
|
* The limit of the monitor to watch for changes, in milliseconds.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (object_class, PROP_RATE_LIMIT,
|
props[PROP_RATE_LIMIT] =
|
||||||
g_param_spec_int ("rate-limit", NULL, NULL,
|
g_param_spec_int ("rate-limit", NULL, NULL,
|
||||||
0, G_MAXINT, DEFAULT_RATE_LIMIT_MSECS, G_PARAM_READWRITE |
|
0, G_MAXINT, DEFAULT_RATE_LIMIT_MSECS, G_PARAM_READWRITE |
|
||||||
G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
|
G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GFileMonitor:cancelled:
|
* GFileMonitor:cancelled:
|
||||||
*
|
*
|
||||||
* Whether the monitor has been cancelled.
|
* Whether the monitor has been cancelled.
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (object_class, PROP_CANCELLED,
|
props[PROP_CANCELLED] =
|
||||||
g_param_spec_boolean ("cancelled", NULL, NULL,
|
g_param_spec_boolean ("cancelled", NULL, NULL,
|
||||||
FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
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