aboutsummaryrefslogtreecommitdiff
path: root/src/app-section.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-08-20 23:32:23 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-08-20 23:32:23 +0200
commit6e38f791c64476215ae68a7a5beabe44dde20131 (patch)
tree8f8e0d7bc26f3f9d11db9c631748e2e663e67786 /src/app-section.c
parent234c3cb933fcd422d9185b4bb01bed3223f0e791 (diff)
parentd34fb7000e9b508b05c653b47bb60f35989c34f9 (diff)
downloadayatana-indicator-messages-6e38f791c64476215ae68a7a5beabe44dde20131.tar.gz
ayatana-indicator-messages-6e38f791c64476215ae68a7a5beabe44dde20131.tar.bz2
ayatana-indicator-messages-6e38f791c64476215ae68a7a5beabe44dde20131.zip
Merge Charles' branch: fixes a memory and a signal leak; various neat cleanups
The "add sanity check" commit is not included, as app-section is not public. This merge also removes the remaining sanity checks in app-section.
Diffstat (limited to 'src/app-section.c')
-rw-r--r--src/app-section.c20
1 files changed, 5 insertions, 15 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);