aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-07 17:15:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-09 18:33:56 +0800
commit663b3a5cd91eb33a776094adb2c3bb8fad5a688d (patch)
treef111906ca84732d48dd514b4244e9036f36c7818 /src/empathy-chat-window.c
parent023eba833dab183c7d31250649290acdd5eff32d (diff)
downloadgsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar.gz
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar.bz2
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar.lz
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar.xz
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.tar.zst
gsoc2013-empathy-663b3a5cd91eb33a776094adb2c3bb8fad5a688d.zip
remove NotificationData
We just need the window now. This has the nice side effect of fixing bug #615027.
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index efdb29184..539a8afd9 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -62,11 +62,6 @@
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
-typedef struct {
- EmpathyChatWindow *window;
- EmpathyChat *chat;
-} NotificationData;
-
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatWindow)
typedef struct {
EmpathyChat *current_chat;
@@ -80,7 +75,6 @@ typedef struct {
GtkWidget *dialog;
GtkWidget *notebook;
NotifyNotification *notification;
- NotificationData *notification_data;
GtkTargetList *contact_targets;
GtkTargetList *file_targets;
@@ -1202,24 +1196,14 @@ chat_window_set_urgency_hint (EmpathyChatWindow *window,
}
static void
-free_notification_data (NotificationData *data)
-{
- g_object_unref (data->chat);
- g_slice_free (NotificationData, data);
-}
-
-static void
chat_window_notification_closed_cb (NotifyNotification *notify,
- NotificationData *cb_data)
+ EmpathyChatWindow *self)
{
- EmpathyChatWindowPriv *priv = GET_PRIV (cb_data->window);
+ EmpathyChatWindowPriv *priv = GET_PRIV (self);
g_object_unref (notify);
- free_notification_data (cb_data);
-
if (priv->notification == notify) {
priv->notification = NULL;
- priv->notification_data = NULL;
}
}
@@ -1261,11 +1245,6 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
notify_notification_update (notification,
header, escaped, NULL);
} else {
- NotificationData *cb_data = cb_data = g_slice_new0 (NotificationData);
-
- cb_data->chat = g_object_ref (chat);
- cb_data->window = window;
-
/* if the notification server supports x-canonical-append,
the hint will be added, so that the message from the
just created notification will be automatically appended
@@ -1276,13 +1255,12 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
if (priv->notification == NULL) {
priv->notification = notification;
- priv->notification_data = cb_data;
}
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
g_signal_connect (notification, "closed",
- G_CALLBACK (chat_window_notification_closed_cb), cb_data);
+ G_CALLBACK (chat_window_notification_closed_cb), window);
if (has_x_canonical_append) {
notify_notification_set_hint_string (notification,
@@ -1802,8 +1780,6 @@ chat_window_finalize (GObject *object)
if (priv->notification != NULL) {
notify_notification_close (priv->notification, NULL);
priv->notification = NULL;
- free_notification_data (priv->notification_data);
- priv->notification_data = NULL;
}
if (priv->contact_targets) {