aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2012-08-16 04:41:14 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2012-08-16 04:41:14 +0000
commit7972b5e647b674e89e7e2367aa4aa469880f35df (patch)
tree788425970413370a08f63872f1a85b3012776242 /src
parentddc8a56649bd28bb8c02bd90beb1c023d8801788 (diff)
removed redundant gtk_tooltips_new() and destroy GtkTooltips object on close.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3151 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c10
-rw-r--r--src/compose.h5
-rw-r--r--src/mainwindow.c13
-rw-r--r--src/mainwindow.h4
4 files changed, 20 insertions, 12 deletions
diff --git a/src/compose.c b/src/compose.c
index e937cd03..881a9c01 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -64,6 +64,7 @@
#include <gtk/gtkstock.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkimage.h>
+#include <gtk/gtktooltips.h>
#include <pango/pango-break.h>
#if USE_GTKSPELL
@@ -5254,6 +5255,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
gtk_widget_set_size_request(menubar, 300, -1);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
+ compose->toolbar_tip = gtk_tooltips_new();
+ g_object_ref_sink(compose->toolbar_tip);
toolbar = compose_toolbar_create(compose);
gtk_widget_set_size_request(toolbar, 300, -1);
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
@@ -5889,7 +5892,6 @@ static GtkWidget *compose_toolbar_create_from_list(Compose *compose,
for (cur = item_list; cur != NULL; cur = cur->next) {
const PrefsDisplayItem *ditem = cur->data;
PrefsToolbarItem *item;
- GtkTooltips *tips;
gint width;
if (ditem->id == T_SEPARATOR) {
@@ -5913,8 +5915,8 @@ static GtkWidget *compose_toolbar_create_from_list(Compose *compose,
toolitem = gtk_tool_button_new(icon_wid, gettext(ditem->label));
if (ditem->description) {
- tips = gtk_tooltips_new();
- gtk_tool_item_set_tooltip(toolitem, tips,
+ gtk_tool_item_set_tooltip(toolitem,
+ compose->toolbar_tip,
gettext(ditem->description),
ditem->name);
}
@@ -6364,6 +6366,8 @@ static void compose_destroy(Compose *compose)
clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gtk_text_buffer_remove_selection_clipboard(buffer, clipboard);
+ g_object_unref(compose->toolbar_tip);
+
gtk_widget_destroy(compose->window);
g_free(compose);
diff --git a/src/compose.h b/src/compose.h
index 5dcf61c2..ea8c7ade 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2008 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
#include <gtk/gtkitemfactory.h>
#include <gtk/gtktexttag.h>
#include <gtk/gtkliststore.h>
+#include <gtk/gtktooltips.h>
typedef struct _Compose Compose;
typedef struct _AttachInfo AttachInfo;
@@ -198,6 +199,8 @@ struct _Compose
gboolean window_maximized;
gboolean block_modified;
+
+ GtkTooltips *toolbar_tip;
};
struct _AttachInfo
diff --git a/src/mainwindow.c b/src/mainwindow.c
index faf0853e..98a21d79 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -988,6 +988,8 @@ MainWindow *main_window_create(SeparateType type)
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
ifactory = gtk_item_factory_from_widget(menubar);
+ /* toolbar */
+ mainwin->toolbar_tip = gtk_tooltips_new();
toolbar = main_window_toolbar_create(mainwin);
gtk_widget_set_size_request(toolbar, 300, -1);
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
@@ -2691,7 +2693,6 @@ static GtkWidget *main_window_toolbar_create_from_list(MainWindow *mainwin,
for (cur = item_list; cur != NULL; cur = cur->next) {
const PrefsDisplayItem *ditem = cur->data;
PrefsToolbarItem *item;
- GtkTooltips *tips;
gint width;
if (ditem->id == T_SEPARATOR) {
@@ -2715,8 +2716,8 @@ static GtkWidget *main_window_toolbar_create_from_list(MainWindow *mainwin,
toolitem = gtk_tool_button_new(icon_wid, gettext(ditem->label));
if (ditem->description) {
- tips = gtk_tooltips_new();
- gtk_tool_item_set_tooltip(toolitem, tips,
+ gtk_tool_item_set_tooltip(toolitem,
+ mainwin->toolbar_tip,
gettext(ditem->description),
ditem->name);
}
@@ -2749,9 +2750,8 @@ static GtkWidget *main_window_toolbar_create_from_list(MainWindow *mainwin,
gtk_container_add(GTK_CONTAINER(comboitem),
GTK_WIDGET_PTR(combo));
if (ditem->description) {
- tips = gtk_tooltips_new();
gtk_tool_item_set_tooltip
- (comboitem, tips,
+ (comboitem, mainwin->toolbar_tip,
gettext(ditem->description),
ditem->name);
}
@@ -2774,9 +2774,8 @@ static GtkWidget *main_window_toolbar_create_from_list(MainWindow *mainwin,
gtk_container_add(GTK_CONTAINER(comboitem),
GTK_WIDGET_PTR(combo));
if (ditem->description) {
- tips = gtk_tooltips_new();
gtk_tool_item_set_tooltip
- (comboitem, tips,
+ (comboitem, mainwin->toolbar_tip,
gettext(ditem->description),
ditem->name);
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 50550c26..bc0107d4 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2010 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -133,6 +133,8 @@ struct _MainWindow
SummaryView *summaryview;
MessageView *messageview;
LogWindow *logwin;
+
+ GtkTooltips *toolbar_tip;
};
MainWindow *main_window_create (SeparateType type);