From: Christian Dywan Date: Thu, 19 Feb 2009 21:57:51 +0000 (+0100) Subject: Make Preferences property readable X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad13d2e8a2d2afee03450d63c4b6eabbfa53b564;p=midori Make Preferences property readable --- diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 5803cfb4..bca63a0a 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -28,6 +28,7 @@ struct _MidoriPreferences { GtkDialog parent_instance; + MidoriWebSettings* settings; GtkWidget* notebook; }; @@ -70,7 +71,7 @@ midori_preferences_class_init (MidoriPreferencesClass* class) "Settings", "Settings instance to provide properties", MIDORI_TYPE_WEB_SETTINGS, - G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void @@ -86,6 +87,7 @@ midori_preferences_init (MidoriPreferences* preferences) { gchar* dialog_title; + preferences->settings = NULL; preferences->notebook = NULL; dialog_title = g_strdup_printf (_("Preferences for %s"), @@ -123,11 +125,9 @@ midori_preferences_set_property (GObject* object, switch (prop_id) { case PROP_SETTINGS: - { midori_preferences_set_settings (preferences, g_value_get_object (value)); break; - } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -140,8 +140,13 @@ midori_preferences_get_property (GObject* object, GValue* value, GParamSpec* pspec) { + MidoriPreferences* preferences = MIDORI_PREFERENCES (object); + switch (prop_id) { + case PROP_SETTINGS: + g_value_set_object (value, preferences->settings); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -320,6 +325,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences, g_return_if_fail (!preferences->notebook); + katze_assign (preferences->settings, g_object_ref (settings)); + g_object_get (preferences, "transient-for", &parent, NULL); icon_name = parent ? gtk_window_get_icon_name (parent) : NULL; if ((header = sokoke_xfce_header_new (icon_name,