aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-08-08 04:29:41 +0800
committerChristian Persch <chpe@src.gnome.org>2006-08-08 04:29:41 +0800
commite0560dfc3c391b5b063a37d2974860540785ae73 (patch)
treeee3d1727b28c32cbd46867720a0fb0439f1bc638 /embed
parent2f00ef03e4fa04c80915fbbc6cd5d54d9afd2ae6 (diff)
downloadgsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar.gz
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar.bz2
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar.lz
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar.xz
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.tar.zst
gsoc2013-epiphany-e0560dfc3c391b5b063a37d2974860540785ae73.zip
Simply CallGetService to get the pref branch.
2006-08-07 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-notifiers.cpp: Simply CallGetService to get the pref branch.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp20
1 files changed, 8 insertions, 12 deletions
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");