aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app-section.c20
-rw-r--r--src/app-section.h3
-rw-r--r--src/indicator-messages.c8
-rw-r--r--src/messages-service.c8
4 files changed, 14 insertions, 25 deletions
diff --git a/src/app-section.c b/src/app-section.c
index 9e83f13..1602ac6 100644
--- a/src/app-section.c
+++ b/src/app-section.c
@@ -2,9 +2,10 @@
An indicator to show information that is in messaging applications
that the user is using.
-Copyright 2009 Canonical Ltd.
+Copyright 2012 Canonical Ltd.
Authors:
+ Lars Uebernickel <lars.uebernickel@canonical.com>
Ted Gould <ted@canonical.com>
This program is free software: you can redistribute it and/or modify it
@@ -233,16 +234,8 @@ app_section_dispose (GObject *object)
}
g_clear_object (&priv->source_menu);
-
- if (priv->ids != NULL) {
- g_object_unref(priv->ids);
- priv->ids = NULL;
- }
-
- if (priv->appinfo != NULL) {
- g_object_unref(priv->appinfo);
- priv->appinfo = NULL;
- }
+ g_clear_object (&priv->ids);
+ g_clear_object (&priv->appinfo);
G_OBJECT_CLASS (app_section_parent_class)->dispose (object);
}
@@ -268,7 +261,7 @@ nick_activate_cb (GSimpleAction *action,
static void
keyfile_loaded (GObject *source_object,
GAsyncResult *result,
- gpointer user_data)
+ gpointer user_data)
{
AppSection *self = user_data;
gchar *contents;
@@ -407,7 +400,6 @@ launch_action_change_state (GSimpleAction *action,
guint
app_section_get_count (AppSection * self)
{
- g_return_val_if_fail(IS_APP_SECTION(self), 0);
AppSectionPrivate * priv = self->priv;
return priv->unreadcount;
@@ -416,7 +408,6 @@ app_section_get_count (AppSection * self)
const gchar *
app_section_get_name (AppSection * self)
{
- g_return_val_if_fail(IS_APP_SECTION(self), NULL);
AppSectionPrivate * priv = self->priv;
if (priv->appinfo) {
@@ -428,7 +419,6 @@ app_section_get_name (AppSection * self)
const gchar *
app_section_get_desktop (AppSection * self)
{
- g_return_val_if_fail(IS_APP_SECTION(self), NULL);
AppSectionPrivate * priv = self->priv;
if (priv->appinfo)
return g_desktop_app_info_get_filename (priv->appinfo);
diff --git a/src/app-section.h b/src/app-section.h
index c351ada..711fdc9 100644
--- a/src/app-section.h
+++ b/src/app-section.h
@@ -2,9 +2,10 @@
An indicator to show information that is in messaging applications
that the user is using.
-Copyright 2009 Canonical Ltd.
+Copyright 2012 Canonical Ltd.
Authors:
+ Lars Uebernickel <lars.uebernickel@canonical.com>
Ted Gould <ted@canonical.com>
This program is free software: you can redistribute it and/or modify it
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 67a28e9..4e8701a 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -155,11 +155,7 @@ indicator_messages_dispose (GObject *object)
IndicatorMessages * self = INDICATOR_MESSAGES(object);
g_return_if_fail(self != NULL);
- if (self->service != NULL) {
- g_object_unref(self->service);
- self->service = NULL;
- }
-
+ g_clear_object (&self->service);
g_clear_object (&self->menu_wrapper);
g_clear_object (&self->actions);
g_clear_object (&self->menu);
@@ -227,6 +223,8 @@ indicator_messages_accessible_desc_updated (IndicatorMessages *self)
g_return_if_fail (entries != NULL);
g_signal_emit_by_name (self, INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, entries->data);
+
+ g_list_free (entries);
}
static void
diff --git a/src/messages-service.c b/src/messages-service.c
index a7355d0..ccd2eba 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -370,8 +370,8 @@ set_status (IndicatorMessagesService *service,
indicator_messages_service_complete_set_status (service, invocation);
}
-GSimpleActionGroup *
-create_action_group ()
+static GSimpleActionGroup *
+create_action_group (void)
{
GSimpleActionGroup *actions;
GSimpleAction *messages;
@@ -400,8 +400,8 @@ create_action_group ()
return actions;
}
-GMenuModel *
-create_status_section ()
+static GMenuModel *
+create_status_section (void)
{
GMenu *menu;