aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-10-13 13:07:47 -0500
committerTed Gould <ted@gould.cx>2011-10-13 13:07:47 -0500
commit301718cf2414986a9ed20f9aa33b62a478d6fa79 (patch)
tree7931ca257746eb1b8411a8d124b4671cb1f0ac7b /src
parentaf086761e7447cc106191dd9802c774666a4b5a0 (diff)
parent9ddd6044078e8af15fe4334063638416120ac733 (diff)
downloadayatana-indicator-session-301718cf2414986a9ed20f9aa33b62a478d6fa79.tar.gz
ayatana-indicator-session-301718cf2414986a9ed20f9aa33b62a478d6fa79.tar.bz2
ayatana-indicator-session-301718cf2414986a9ed20f9aa33b62a478d6fa79.zip
Import upstream version 0.3.7
Diffstat (limited to 'src')
-rw-r--r--src/apt-transaction.c1
-rw-r--r--src/apt-watcher.c3
-rw-r--r--src/settings-helper.c27
3 files changed, 20 insertions, 11 deletions
diff --git a/src/apt-transaction.c b/src/apt-transaction.c
index 317d74a..2b3f5a4 100644
--- a/src/apt-transaction.c
+++ b/src/apt-transaction.c
@@ -232,7 +232,6 @@ apt_transaction_receive_signal (GDBusProxy * proxy,
0,
current_state);
}
- g_variant_unref (parameters);
}
static void
diff --git a/src/apt-watcher.c b/src/apt-watcher.c
index d8bb7e2..481029a 100644
--- a/src/apt-watcher.c
+++ b/src/apt-watcher.c
@@ -425,7 +425,7 @@ static void apt_watcher_signal_cb ( GDBusProxy* proxy,
g_return_if_fail (APT_IS_WATCHER (user_data));
AptWatcher* self = APT_WATCHER (user_data);
- g_variant_ref (parameters);
+ g_variant_ref_sink (parameters);
GVariant *value = g_variant_get_child_value (parameters, 0);
if (g_strcmp0(signal_name, "ActiveTransactionsChanged") == 0){
@@ -477,6 +477,7 @@ static void apt_watcher_signal_cb ( GDBusProxy* proxy,
}
}
+ g_variant_unref (value);
g_variant_unref (parameters);
}
diff --git a/src/settings-helper.c b/src/settings-helper.c
index d70df95..007f83f 100644
--- a/src/settings-helper.c
+++ b/src/settings-helper.c
@@ -38,41 +38,49 @@ static guint logout_notify = 0;
static guint restart_notify = 0;
static guint shutdown_notify = 0;
-static void
+static gboolean
build_settings (void) {
- if(!settings) {
+ if (settings == NULL) {
settings = g_settings_new (SESSION_SCHEMA);
}
- return;
+ if (settings == NULL) {
+ return FALSE;
+ }
+ return TRUE;
}
gboolean
supress_confirmations (void) {
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_val_if_fail(settings_built, FALSE);
return g_settings_get_boolean (settings, SUPPRESS_KEY) ;
}
gboolean
should_show_user_menu (void) {
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_val_if_fail(settings_built, TRUE);
return g_settings_get_boolean (settings, SHOW_USER_MENU) ;
}
gboolean
show_logout (void) {
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_val_if_fail(settings_built, TRUE);
return !g_settings_get_boolean (settings, LOGOUT_KEY) ;
}
gboolean
show_restart (void) {
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_val_if_fail(settings_built, TRUE);
return !g_settings_get_boolean (settings, RESTART_KEY) ;
}
gboolean
show_shutdown (void) {
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_val_if_fail(settings_built, TRUE);
return !g_settings_get_boolean (settings, SHUTDOWN_KEY) ;
}
@@ -122,7 +130,8 @@ update_shutdown_callback (GSettings * settings, const gchar * key, gpointer data
void
update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi) {
/* If we don't have a client, build one. */
- build_settings();
+ gboolean settings_built = build_settings();
+ g_return_if_fail(settings_built);
if (confirmation_notify != 0) {
g_signal_handler_disconnect (settings, confirmation_notify);