stringlist: Make property not construct-only
Massively speeds up creation of long stringlists.
This commit is contained in:
@@ -138,8 +138,7 @@ gtk_string_object_class_init (GtkStringObjectClass *class)
|
|||||||
|
|
||||||
pspec = g_param_spec_string ("string", "String", "String",
|
pspec = g_param_spec_string ("string", "String", "String",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_CONSTRUCT_ONLY |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_STRING, pspec);
|
g_object_class_install_property (object_class, PROP_STRING, pspec);
|
||||||
@@ -149,7 +148,12 @@ gtk_string_object_class_init (GtkStringObjectClass *class)
|
|||||||
static GtkStringObject *
|
static GtkStringObject *
|
||||||
gtk_string_object_new (const char *string)
|
gtk_string_object_new (const char *string)
|
||||||
{
|
{
|
||||||
return g_object_new (GTK_TYPE_STRING_OBJECT, "string", string, NULL);
|
GtkStringObject *result;
|
||||||
|
|
||||||
|
result = g_object_new (GTK_TYPE_STRING_OBJECT, NULL);
|
||||||
|
result->string = g_strdup (string);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkStringObject *
|
static GtkStringObject *
|
||||||
|
|||||||
Reference in New Issue
Block a user