aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp20
2 files changed, 14 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 928d05819..d3ed957b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-08-07 Christian Persch <chpe@cvs.gnome.org>
+ * embed/mozilla/mozilla-notifiers.cpp:
+
+ Simply CallGetService to get the pref branch.
+
+2006-08-07 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/mozilla-embed-single.cpp:
Use AutoJSContextStack on window open.
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index 5fc67f337..610b0cbb3 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -553,13 +553,19 @@ notify_cb (GConfClient *client,
GValue value = { 0, };
g_return_if_fail (gcentry != NULL);
- g_return_if_fail (data != NULL);
+ g_assert (data != NULL);
if (data->func (gcentry, &value, data->user_data))
{
mozilla_pref_set (data->mozilla_pref, &value);
g_value_unset (&value);
}
+ else
+ {
+ /* Reset the pref */
+ NS_ENSURE_TRUE (gPrefBranch, );
+ gPrefBranch->ClearUserPref (data->mozilla_pref);
+ }
}
extern "C" guint
@@ -1088,19 +1094,9 @@ mozilla_notifiers_init (void)
eel_gconf_monitor_add ("/system/proxy");
eel_gconf_monitor_add ("/system/http_proxy");
- /* Cache the pref branch */
- nsresult rv;
- nsCOMPtr<nsIPrefService> prefService
- (do_GetService (NS_PREFSERVICE_CONTRACTID, &rv));
- if (NS_FAILED (rv))
- {
- g_warning ("Failed to get the pref service!\n");
- return FALSE;
- }
-
/* the pref service conveniently implements the root pref branch */
gPrefBranch = nsnull;
- rv = CallQueryInterface (prefService, &gPrefBranch);
+ nsresult rv = CallGetService (NS_PREFSERVICE_CONTRACTID, &gPrefBranch);
if (NS_FAILED (rv) || !gPrefBranch)
{
g_warning ("Failed to get the pref service!\n");