[Commits] [SCM] claws branch, master, updated. 3.10.1-8-g35e2085

Colin colin at claws-mail.org
Tue Jun 10 11:36:27 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  35e2085f2be6d228a37160220a431cb38c562876 (commit)
       via  04314da11830922e67f979848a94ceacebfec0cd (commit)
      from  0f71a29506e89c2537641625a86c8f28c0fc98e9 (commit)


- Log -----------------------------------------------------------------
commit 35e2085f2be6d228a37160220a431cb38c562876
Author: Colin Leroy <colin at colino.net>
Date:   Tue Jun 10 11:36:16 2014 +0200

    Coverity fixes

diff --git a/src/procmime.c b/src/procmime.c
index 36bff67..2275c89 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -362,6 +362,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
 	}
 	if (fseek(infp, mimeinfo->offset, SEEK_SET) < 0) {
 		perror("fseek");
+		procmime_fclose(infp);
 		return FALSE;
 	}
 
@@ -1458,6 +1459,7 @@ static void procmime_parse_message_rfc822(MimeInfo *mimeinfo, gboolean short_sca
 	}
 	if (fseek(fp, mimeinfo->offset, SEEK_SET) < 0) {
 		FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
+		procmime_fclose(fp);
 		return;
 	}
 	procheader_get_header_fields(fp, hentry);
@@ -1532,7 +1534,11 @@ static void procmime_parse_disposition_notification(MimeInfo *mimeinfo,
 		FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
 		return;
 	}
-	fseek(fp, mimeinfo->offset, SEEK_SET);
+	if (fseek(fp, mimeinfo->offset, SEEK_SET) < 0) {
+		FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
+		procmime_fclose(fp);
+		return;
+	}
 
 	if (original_msgid && disposition_notification_hdr) {
 		hentry[0].body = g_strdup(original_msgid);
@@ -1660,6 +1666,7 @@ static void procmime_parse_multipart(MimeInfo *mimeinfo, gboolean short_scan)
 
 	if (fseek(fp, mimeinfo->offset, SEEK_SET) < 0) {
 		FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
+		procmime_fclose(fp);
 		return;
 	}
 
@@ -2488,6 +2495,7 @@ static gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
 		}
 		if (fseek(infp, mimeinfo->offset, SEEK_SET) < 0) {
 			FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
+			procmime_fclose(infp);
 			return -1;
 		}
 		while (SC_FGETS(buf, sizeof(buf), infp) == buf) {
@@ -2564,6 +2572,7 @@ static gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 		}
 		if (fseek(infp, mimeinfo->offset, SEEK_SET) < 0) {
 			FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
+			procmime_fclose(infp);
 			return -1;
 		}
 		while (SC_FGETS(buf, sizeof(buf), infp) == buf) {
diff --git a/src/statusbar.c b/src/statusbar.c
index 48a2284..4ced87f 100644
--- a/src/statusbar.c
+++ b/src/statusbar.c
@@ -176,7 +176,7 @@ void statusbar_progress_all (gint done, gint total, gint step)
 		g_snprintf(buf, sizeof(buf), format, done, total);
 		gtk_progress_bar_set_text(progressbar, buf);
 		gtk_progress_bar_set_fraction(progressbar,
-			 (total == 0) ? 0 : (gfloat)done / (gfloat)total);
+			 (gfloat)done / (gfloat)total);
 		if (!gtk_widget_get_visible(GTK_WIDGET(progressbar)))
 			gtk_widget_show(GTK_WIDGET(progressbar));
 	} else if (total == 0) {
diff --git a/src/summary_search.c b/src/summary_search.c
index 97adcd4..a085520 100644
--- a/src/summary_search.c
+++ b/src/summary_search.c
@@ -807,7 +807,10 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
 
 		msginfo = gtk_cmctree_node_get_row_data(ctree, node);
 
-		matched = summary_search_verify_match(msginfo);
+		if (msginfo)
+			matched = summary_search_verify_match(msginfo);
+		else
+			matched = FALSE;
 
 		if (matched) {
 			if (search_all) {
diff --git a/src/summaryview.c b/src/summaryview.c
index 05c40b6..2c3e345 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2505,6 +2505,8 @@ static void summary_set_marks_func(GtkCMCTree *ctree, GtkCMCTreeNode *node,
 
 	msginfo = gtk_cmctree_node_get_row_data(ctree, node);
 
+	cm_return_if_fail(msginfo != NULL);
+
 	if (MSG_IS_DELETED(msginfo->flags))
 		summaryview->deleted++;
 
@@ -3360,7 +3362,8 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
 				from_text = msginfo->from;
 			else {
 				from_text = msginfo->from;
-				extract_address(from_text);
+				if (from_text)
+					extract_address(from_text);
 			}
 			if (!from_text)
 				_("(No From)");		
diff --git a/src/wizard.c b/src/wizard.c
index 1686aff..0974120 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -329,8 +329,7 @@ static gchar *get_name_for_mail(void)
 	gchar *tmp = NULL, *new = NULL;	\
 	if (str != NULL) {	\
 		tmp = g_strdup(str);	\
-		if (strstr(str, "$USERNAME")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$USERNAME")) {	\
 			*strstr(tmp, "$USERNAME") = '\0';	\
 			new = g_strconcat(tmp, g_get_real_name(), 	\
 				strstr(str, "$USERNAME")+strlen("$USERNAME"), 	\
@@ -340,8 +339,7 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(str, "$LOGIN")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$LOGIN")) {	\
 			*strstr(tmp, "$LOGIN") = '\0';	\
 			new = g_strconcat(tmp, g_get_user_name(), 	\
 				strstr(str, "$LOGIN")+strlen("$LOGIN"), 	\
@@ -351,8 +349,7 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(str, "$EMAIL")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$EMAIL")) {	\
 			*strstr(tmp, "$EMAIL") = '\0';	\
 			new = g_strconcat(tmp, tmpl.email, 	\
 				strstr(str, "$EMAIL")+strlen("$EMAIL"), 	\
@@ -362,8 +359,7 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(str, "$NAME_MAIL")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$NAME_MAIL")) {	\
 			*strstr(tmp, "$NAME_MAIL") = '\0';	\
 			new = g_strconcat(tmp, get_name_for_mail(), 	\
 				strstr(str, "$NAME_MAIL")+strlen("$NAME_MAIL"), 	\
@@ -373,8 +369,7 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(str, "$DEFAULTDOMAIN")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$DEFAULTDOMAIN")) {	\
 			*strstr(tmp, "$DEFAULTDOMAIN") = '\0';	\
 			new = g_strconcat(tmp, wizard_get_default_domain_name(), 	\
 				strstr(str, "$DEFAULTDOMAIN")+strlen("$DEFAULTDOMAIN"), 	\
@@ -384,8 +379,7 @@ static gchar *get_name_for_mail(void)
 			str = new;	\
 			new = NULL;	\
 		}	\
-		if (strstr(str, "$DOMAIN")) {	\
-			tmp = g_strdup(str);	\
+		if (strstr(tmp, "$DOMAIN")) {	\
 			*strstr(tmp, "$DOMAIN") = '\0';	\
 			new = g_strconcat(tmp, tmpl.domain, 	\
 				strstr(str, "$DOMAIN")+strlen("$DOMAIN"), 	\
@@ -1369,7 +1363,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
 
 	address = gtk_editable_get_chars(GTK_EDITABLE(wizard->email), 0, -1);
 
-	if (strchr(address, '@') < 0) {
+	if (strchr(address, '@') == NULL) {
 		g_free(address);
 		gtk_label_set_text(GTK_LABEL(wizard->auto_configure_lbl),
 			   _("Failed (wrong address)"));

commit 04314da11830922e67f979848a94ceacebfec0cd
Author: Colin Leroy <colin at colino.net>
Date:   Tue Jun 10 11:18:48 2014 +0200

    Drop old unsupported GTK+ conditionals too

diff --git a/src/compose.c b/src/compose.c
index e1323f2..cfdda3f 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -6828,9 +6828,6 @@ static void compose_create_header_entry(Compose *compose)
 	gboolean standard_header = FALSE;
 	GtkListStore *model;
 	GtkTreeIter iter;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = compose->tooltips;
-#endif
 	
 	headerentry = g_new0(ComposeHeaderEntry, 1);
 
@@ -7457,10 +7454,6 @@ static Compose *compose_create(PrefsAccount *account,
 	compose->mutex = cm_mutex_new();
 	compose->set_cursor_pos = -1;
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-	compose->tooltips = tips;
-#endif
-
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "compose");
 
 	gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
@@ -8054,9 +8047,6 @@ static GtkWidget *compose_account_option_menu_create(Compose *compose)
 	GtkListStore *menu;
 	GtkTreeIter iter;
 	GtkWidget *from_name = NULL;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = compose->tooltips;
-#endif
 
 	gint num = 0, def_menu = 0;
 	
diff --git a/src/compose.h b/src/compose.h
index 51d0e7e..114ee89 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -136,9 +136,6 @@ struct _Compose
 	GtkWidget *scrolledwin;
 	GtkWidget *text;
 	GtkWidget *from_name;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 
 	GtkWidget *focused_editable;
 
diff --git a/src/gtk/filesel.c b/src/gtk/filesel.c
index cced6ec..4b2b2f2 100644
--- a/src/gtk/filesel.c
+++ b/src/gtk/filesel.c
@@ -82,19 +82,11 @@ static GList *filesel_create(const gchar *title, const gchar *path,
 					       GTK_FILE_CHOOSER_ACTION_SAVE);
 			
 	gchar * action_btn = (open == TRUE) ? GTK_STOCK_OPEN:GTK_STOCK_SAVE;
-#if !GTK_CHECK_VERSION(2,14,0)
-	GtkWidget *chooser = gtk_file_chooser_dialog_new_with_backend
-				(title, NULL, action, "gtk+",
-				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-				action_btn, GTK_RESPONSE_ACCEPT, 
-				NULL);
-#else
 	GtkWidget *chooser = gtk_file_chooser_dialog_new
 				(title, NULL, action, 
 				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 				action_btn, GTK_RESPONSE_ACCEPT, 
 				NULL);
-#endif
 
 	gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(chooser), FALSE);
 
diff --git a/src/gtk/gtksctree.c b/src/gtk/gtksctree.c
index 560ab42..4e75b08 100644
--- a/src/gtk/gtksctree.c
+++ b/src/gtk/gtksctree.c
@@ -2043,13 +2043,6 @@ void gtk_sctree_set_column_tooltip	    (GtkSCTree		*sctree,
 					     int		 column,
 					     const gchar 	*tip)
 {
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips;
-	if (!sctree->tooltips)
-		sctree->tooltips = gtk_tooltips_new();
-	tips = sctree->tooltips;
-#endif
-
 	CLAWS_SET_TIP(GTK_CMCLIST(sctree)->column[column].button,
 			tip);
 }
diff --git a/src/gtk/gtksctree.h b/src/gtk/gtksctree.h
index 84ad2c2..b310f96 100644
--- a/src/gtk/gtksctree.h
+++ b/src/gtk/gtksctree.h
@@ -37,9 +37,6 @@ struct _GtkSCTree {
 
 	/* (dis)allow fancy color stripes */
 	gboolean show_stripes;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 	gboolean always_expand_recursively;
 	gboolean force_additive_sel;
 	gboolean *use_markup;
diff --git a/src/message_search.c b/src/message_search.c
index 9c076c7..9866d7c 100644
--- a/src/message_search.c
+++ b/src/message_search.c
@@ -81,21 +81,9 @@ static gboolean key_pressed		(GtkWidget	*widget,
 					 gpointer	 data);
 
 
-#if !GTK_CHECK_VERSION(2,14,0)
-/* Work around http://bugzilla.gnome.org/show_bug.cgi?id=56070 */
 #define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {					\
-	gboolean in_btn = FALSE;							\
-	if (GTK_IS_BUTTON(widget))							\
-		in_btn = GTK_BUTTON(widget)->in_button;					\
 	gtk_widget_set_sensitive(widget, sensitive);					\
-	if (GTK_IS_BUTTON(widget))							\
-		GTK_BUTTON(widget)->in_button = in_btn;					\
 }
-#else
-#define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {					\
-	gtk_widget_set_sensitive(widget, sensitive);					\
-}
-#endif
 
 static void message_show_stop_button(void)
 {
diff --git a/src/mimeview.c b/src/mimeview.c
index 088ad29..f63a522 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -458,9 +458,6 @@ MimeView *mimeview_create(MainWindow *mainwin)
 	mimeview->icon_mainbox  = icon_mainbox;
 	mimeview->icon_count    = 0;
 	mimeview->mainwin       = mainwin;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	mimeview->tooltips      = tips;
-#endif
 	mimeview->mime_toggle   = mime_toggle;
 	mimeview->siginfoview	= siginfoview;
 	mimeview->scrollbutton  = scrollbutton;
@@ -2413,9 +2410,6 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
 #ifdef GENERIC_UMPC
 	GtkRequisition r;
 #endif
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = mimeview->tooltips;
-#endif
 	
 	if (!prefs_common.show_inline_attachments && mimeinfo->id)
 		return;
diff --git a/src/mimeview.h b/src/mimeview.h
index 3819f57..e520d55 100644
--- a/src/mimeview.h
+++ b/src/mimeview.h
@@ -92,9 +92,6 @@ struct _MimeView
 
 	gint icon_count;
 	MainWindow *mainwin;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 
 	NoticeView *siginfoview;
 	MimeInfo *siginfo;
diff --git a/src/noticeview.c b/src/noticeview.c
index d71621b..fdb3daf 100644
--- a/src/noticeview.c
+++ b/src/noticeview.c
@@ -132,9 +132,6 @@ NoticeView *noticeview_create(MainWindow *mainwin)
 	noticeview->button2= widget2;
 	noticeview->evtbox = evtbox;
 	noticeview->visible= TRUE;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	noticeview->tooltips = tips;
-#endif
 	return noticeview;
 }
 
@@ -282,9 +279,6 @@ void noticeview_set_icon_clickable(NoticeView *noticeview, gboolean setting)
 
 void noticeview_set_tooltip (NoticeView *noticeview, const gchar *text)
 {
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = noticeview->tooltips;
-#endif
 	CLAWS_SET_TIP(noticeview->evtbox,
 			text);
 
diff --git a/src/noticeview.h b/src/noticeview.h
index 72742ce..bc380e7 100644
--- a/src/noticeview.h
+++ b/src/noticeview.h
@@ -40,9 +40,6 @@ struct _NoticeView
 	void		(*press2) (NoticeView *, gpointer user_data);
 	gboolean	 icon_clickable;
 	GtkWidget 	*evtbox;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 };
 
 NoticeView	*noticeview_create	(MainWindow 	*mainwin);
diff --git a/src/plugins/notification/notification_trayicon.c b/src/plugins/notification/notification_trayicon.c
index 584d515..3fc9a76 100644
--- a/src/plugins/notification/notification_trayicon.c
+++ b/src/plugins/notification/notification_trayicon.c
@@ -269,11 +269,8 @@ void notification_update_trayicon()
   buf = g_strdup_printf(_("New %d, Unread: %d, Total: %d"),
 			count.new_msgs, count.unread_msgs,
 			count.total_msgs);
-#if GTK_CHECK_VERSION(2,16,0)
   gtk_status_icon_set_tooltip_text(trayicon, buf);
-#else
-  gtk_status_icon_set_tooltip(trayicon, buf);
-#endif
+
   g_free(buf);
 
   /* Pixmap */
diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c
index 8120237..df66fa5 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.c
+++ b/src/plugins/pdf_viewer/poppler_viewer.c
@@ -1594,7 +1594,7 @@ static void pdf_viewer_scroll_one_line(MimeViewer *_viewer, gboolean up)
 	gtk_table_set_col_spacing(GTK_TABLE(viewer->widgets_table), col, 3*BUTTON_H_PADDING); \
 	col++;
 
-#if GTK_CHECK_VERSION(2,10,0) && POPPLER_HAS_CAIRO && !USE_LIBGNOMEPRINT
+#if POPPLER_HAS_CAIRO
 static PangoContext *pdf_viewer_get_pango_context(gpointer data)
 {
 	return NULL;
@@ -1687,7 +1687,7 @@ static MimeViewer *pdf_viewer_create(void)
 	viewer->mimeviewer.text_search = pdf_viewer_text_search;
 	viewer->mimeviewer.scroll_page = pdf_viewer_scroll_page;
 	viewer->mimeviewer.scroll_one_line = pdf_viewer_scroll_one_line;
-#if GTK_CHECK_VERSION(2,10,0) && POPPLER_HAS_CAIRO && !USE_LIBGNOMEPRINT
+#if POPPLER_HAS_CAIRO
 	viewer->mimeviewer.print = pdf_viewer_print;
 #endif
 	viewer->scrollwin = gtk_scrolled_window_new(NULL, NULL);
@@ -1721,10 +1721,6 @@ static MimeViewer *pdf_viewer_create(void)
 	gtk_widget_set_size_request(viewer->frame_index, 18, -1);
 	gtk_frame_set_label(GTK_FRAME(viewer->frame_index), _("Document Index"));
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-	viewer->button_bar_tips = tips;
-#endif
-
 	ADD_SEP_TO_TABLE
 	ADD_BUTTON_TO_TABLE(viewer->first_page, GTK_STOCK_GOTO_FIRST)
 	ADD_BUTTON_TO_TABLE(viewer->prev_page, GTK_STOCK_GO_BACK)
diff --git a/src/plugins/pdf_viewer/poppler_viewer.h b/src/plugins/pdf_viewer/poppler_viewer.h
index 457b31c..3981863 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.h
+++ b/src/plugins/pdf_viewer/poppler_viewer.h
@@ -91,9 +91,7 @@ struct _PdfViewer
 	GtkWidget			*doc_index;
 	/* end GtkButtons */
 	GtkTable			*table_doc_info;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips			*button_bar_tips;
-#endif
+
 	PopplerDocument		*pdf_doc;
 	PopplerPage			*pdf_page;
 	PopplerIndexIter	*pdf_index;
diff --git a/src/plugins/vcalendar/day-view.c b/src/plugins/vcalendar/day-view.c
index 53cc7cb..46dc798 100644
--- a/src/plugins/vcalendar/day-view.c
+++ b/src/plugins/vcalendar/day-view.c
@@ -53,9 +53,7 @@
 struct _day_win
 {
     GtkAccelGroup *accel_group;
-#if !GTK_CHECK_VERSION(2,12,0)
-    GtkTooltips   *Tooltips;
-#endif
+
     GtkWidget *Window;
     GtkWidget *Vbox;
 
@@ -147,9 +145,6 @@ void dw_close_window(day_win *dw)
 {
     vcal_view_set_summary_page(dw->Vbox, dw->selsig);
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-    gtk_object_destroy(G_OBJECT(dw->Tooltips));
-#endif
     g_free(dw);
     dw = NULL;
 }
@@ -365,9 +360,6 @@ static void add_row(day_win *dw, VCalEvent *event, gint days)
     GtkWidget *ev, *lab, *hb;
     time_t t_start, t_end;
     struct tm tm_first, tm_start, tm_end;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = dw->Tooltips;
-#endif
 
     /* First clarify timings */
     t_start = icaltime_as_timet(icaltime_from_string(event->dtstart));
@@ -749,9 +741,6 @@ static void build_day_view_table(day_win *dw)
     GtkWidget *arrow;
     gchar *tip;
     gint first_col_day = -1;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = dw->Tooltips;
-#endif
 
 #ifdef G_OS_WIN32
 	if (t < 0)
@@ -896,9 +885,7 @@ day_win *create_day_win(FolderItem *item, struct tm tmdate)
     /* initialisation + main window + base vbox */
     dw = g_new0(day_win, 1);
     dw->scroll_pos = -1; /* not set */
-#if !(GTK_CHECK_VERSION(2,12,0))
-    dw->Tooltips = tips;
-#endif
+
     dw->accel_group = gtk_accel_group_new();
     
     while (tmdate.tm_wday != 1)
diff --git a/src/plugins/vcalendar/month-view.c b/src/plugins/vcalendar/month-view.c
index 93c504b..ba59a2d 100644
--- a/src/plugins/vcalendar/month-view.c
+++ b/src/plugins/vcalendar/month-view.c
@@ -53,9 +53,7 @@
 struct _month_win
 {
     GtkAccelGroup *accel_group;
-#if !GTK_CHECK_VERSION(2,12,0)
-    GtkTooltips   *Tooltips;
-#endif
+
     GtkWidget *Window;
     GtkWidget *Vbox;
 
@@ -142,9 +140,7 @@ void mw_close_window(month_win *mw)
 {
     vcal_view_set_summary_page(mw->Vbox, mw->selsig);
     
-#if !(GTK_CHECK_VERSION(2,12,0))
-    gtk_object_destroy(G_OBJECT(mw->Tooltips));
-#endif
+
     g_free(mw);
     mw = NULL;
 }
@@ -353,10 +349,6 @@ static void add_row(month_win *mw, VCalEvent *event, gint days)
     struct tm tm_today;
     gboolean start_prev_mon = FALSE;
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = mw->Tooltips;
-#endif
-
     localtime_r(&now, &tm_today);
 
     tm_today.tm_year += 1900;
@@ -495,14 +487,10 @@ static void add_row(month_win *mw, VCalEvent *event, gint days)
 	CLAWS_SET_TIP(ev, tip);
         gtk_box_pack_start(GTK_BOX(hb), ev, TRUE, TRUE, 0);
     } else {
-#if !GTK_CHECK_VERSION(2,12,0)
-        GtkTooltipsData *tdata = gtk_tooltips_data_get(ev);
-	gchar *new = g_strdup_printf("%s\n\n%s", tdata?tdata->tip_text:"", tip);
-#else
 	gchar *old = gtk_widget_get_tooltip_text(ev);
 	gchar *new = g_strdup_printf("%s\n\n%s", old?old:"", tip);
 	g_free(old);
-#endif
+
 	CLAWS_SET_TIP(ev, new);
 	g_free(new);
     }
@@ -584,10 +572,6 @@ static void fill_days(month_win *mw, gint days, FolderItem *item)
     int weekoffset = -1;
     time_t now = time(NULL);
     struct tm tm_today;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = mw->Tooltips;
-#endif
-
     
     localtime_r(&now, &tm_today);
 
@@ -799,9 +783,6 @@ static void build_month_view_colours(month_win *mw)
 static void fill_hour(month_win *mw, gint col, gint row, char *text)
 {
     GtkWidget *name, *ev;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = mw->Tooltips;
-#endif
 
     ev = gtk_event_box_new();
     name = gtk_label_new(text);
@@ -833,9 +814,6 @@ static void build_month_view_table(month_win *mw)
     int weekoffset = -1;
     GDate *date;
     int first_week=0;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = mw->Tooltips;
-#endif
 
     if (mainwindow_get_mainwindow()) {
         GtkAllocation allocation;
@@ -990,9 +968,7 @@ month_win *create_month_win(FolderItem *item, struct tm tmdate)
     /* initialisation + main window + base vbox */
     mw = g_new0(month_win, 1);
     mw->scroll_pos = -1; /* not set */
-#if !(GTK_CHECK_VERSION(2,12,0))
-    mw->Tooltips = tips;
-#endif
+
     mw->accel_group = gtk_accel_group_new();
 
     while (tmdate.tm_mday != 1)
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index c5cf89e..5dd32ad 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -88,9 +88,6 @@ struct _VCalMeeting
 	GtkWidget *total_avail_msg;
 	PrefsAccount *account;
 	gboolean visible;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tips;
-#endif
 };
 
 struct _VCalAttendee {
@@ -278,9 +275,6 @@ VCalAttendee *attendee_add(VCalMeeting *meet, gchar *address, gchar *name, gchar
 {
 	GtkWidget *att_hbox = gtk_hbox_new(FALSE, 6);
 	VCalAttendee *attendee 	= g_new0(VCalAttendee, 1);
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = meet->tips;
-#endif
 
 	attendee->address	= gtk_entry_new();
 	attendee->cutype	= gtk_combo_box_new_text();
@@ -714,9 +708,6 @@ static void meeting_end_changed(GtkWidget *widget, gpointer data)
 static void att_update_icon(VCalMeeting *meet, VCalAttendee *attendee, gint avail, gchar *text)
 {
 	const gchar *icon = GTK_STOCK_DIALOG_INFO;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = meet->tips;
-#endif
 
 	switch (avail) {
 		case 0:  icon = GTK_STOCK_DIALOG_WARNING;	break;
@@ -867,9 +858,6 @@ static gboolean find_availability(const gchar *dtstart, const gchar *dtend, GSLi
 	GHashTable *avail_table_avail = g_hash_table_new(NULL, g_direct_equal);
 	GHashTable *avail_table_before = g_hash_table_new(NULL, g_direct_equal);
 	GHashTable *avail_table_after = g_hash_table_new(NULL, g_direct_equal);
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = meet->tips;
-#endif
 	
 	for (cur = attendees; cur; cur = cur->next) {
 		VCalAttendee *attendee = (VCalAttendee *)cur->data;
@@ -1015,9 +1003,6 @@ static gboolean check_attendees_availability(VCalMeeting *meet, gboolean tell_if
 				"internal.ifb", NULL);
 	gboolean local_only = FALSE;
 	GSList *attlist;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = meet->tips;
-#endif
 
 	if (vcalprefs.freebusy_get_url == NULL
 	||  *vcalprefs.freebusy_get_url == '\0') {
@@ -1405,9 +1390,6 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
 	if (!watch_cursor)
 		watch_cursor = gdk_cursor_new(GDK_WATCH);
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-    	meet->tips = tips;
-#endif
 	meet->visible = visible;
 
 	meet->window 		= gtkut_window_new(GTK_WINDOW_TOPLEVEL, "vcal_meeting_gtk");
diff --git a/src/prefs_summaries.c b/src/prefs_summaries.c
index d9a3108..4951101 100644
--- a/src/prefs_summaries.c
+++ b/src/prefs_summaries.c
@@ -512,9 +512,6 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 		(vbox2, checkbtn_show_tooltips,
 		 _("Show tooltips"));
 
-#if !GTK_CHECK_VERSION(2,12,0) && !GENERIC_UMPC
-	gtk_widget_hide(checkbtn_show_tooltips);
-#endif
 	hbox2 = gtk_hbox_new (FALSE, 8);
 	gtk_widget_show (hbox2);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, TRUE, 0);
diff --git a/src/printing.c b/src/printing.c
index e4cb1f1..0646236 100644
--- a/src/printing.c
+++ b/src/printing.c
@@ -441,11 +441,8 @@ static gboolean cb_preview(GtkPrintOperation        *operation,
   
 	/* toolbar */
 	toolbar = gtk_toolbar_new();
-#if (GTK_CHECK_VERSION(2,16,0))
   	gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#else
-	gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#endif
+
 	switch (prefs_common.toolbar_style) {
 		case TOOLBAR_ICON:
 			gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
@@ -464,16 +461,9 @@ static gboolean cb_preview(GtkPrintOperation        *operation,
 
 	gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-#define CLAWS_SET_TOOL_ITEM_TIP(widget,tip) { \
-	gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(widget), GTK_TOOLTIPS(tips),			\
-			tip, NULL);								\
-}
-#else
 #define CLAWS_SET_TOOL_ITEM_TIP(widget,tip) { \
 	gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), tip);				\
 }
-#endif	
 
 #define TOOLBAR_ITEM(item,text,tooltip,cb,cbdata) {								\
 	item = GTK_WIDGET(gtk_tool_button_new_from_stock(text));					\
diff --git a/src/summary_search.c b/src/summary_search.c
index ac14f31..97adcd4 100644
--- a/src/summary_search.c
+++ b/src/summary_search.c
@@ -149,21 +149,9 @@ static gboolean key_pressed		(GtkWidget	*widget,
 					 GdkEventKey	*event,
 					 gpointer	 data);
 
-#if !GTK_CHECK_VERSION(2,14,0)
-/* Work around http://bugzilla.gnome.org/show_bug.cgi?id=56070 */
 #define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {					\
-	gboolean in_btn = FALSE;							\
-	if (GTK_IS_BUTTON(widget))							\
-		in_btn = GTK_BUTTON(widget)->in_button;					\
 	gtk_widget_set_sensitive(widget, sensitive);					\
-	if (GTK_IS_BUTTON(widget))							\
-		GTK_BUTTON(widget)->in_button = in_btn;					\
 }
-#else
-#define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {					\
-	gtk_widget_set_sensitive(widget, sensitive);					\
-}
-#endif
 
 static gchar* add_history_get(GtkWidget *from, GList **history)
 {
diff --git a/src/summaryview.c b/src/summaryview.c
index bb1358c..05c40b6 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -525,9 +525,6 @@ SummaryView *summary_create(MainWindow *mainwin)
 	debug_print("Creating summary view...\n");
 	summaryview = g_new0(SummaryView, 1);
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-	summaryview->tooltips = tips;
-#endif
 #define SUMMARY_VBOX_SPACING 3
 	vbox = gtk_vbox_new(FALSE, SUMMARY_VBOX_SPACING);
 	
@@ -8008,9 +8005,6 @@ void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item)
 	guint new, unread, unreadmarked, marked, total;
 	guint replied, forwarded, locked, ignored, watched;
 	static gboolean tips_initialized = FALSE;
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *tips = summaryview->tooltips;
-#endif
 
 	if (prefs_common.layout_mode != SMALL_LAYOUT) {
 		if (tips_initialized) {
diff --git a/src/summaryview.h b/src/summaryview.h
index 205e2a1..140c410 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -172,9 +172,6 @@ private:
 	FolderItem *search_root_folder;
 
 	guint mark_as_read_timeout_tag;
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 };
 
 SummaryView	*summary_create(MainWindow *mainwin);
diff --git a/src/toolbar.c b/src/toolbar.c
index 0f79780..ee04e80 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -874,35 +874,18 @@ gboolean toolbar_check_action_btns(ToolbarType type)
 	return modified;
 }
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-#define CLAWS_SET_TOOL_ITEM_TIP(widget,tip) { \
-	gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(widget), GTK_TOOLTIPS(toolbar_tips),	\
-			tip, NULL);								\
-}
-#else
 #define CLAWS_SET_TOOL_ITEM_TIP(widget,tip) { \
 	gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), tip);				\
 }
-#endif	
 
-#if !(GTK_CHECK_VERSION(2,12,0))
-#define CLAWS_SET_ARROW_TIP(widget,tip) { \
-	gtk_menu_tool_button_set_arrow_tooltip(GTK_MENU_TOOL_BUTTON(widget), GTK_TOOLTIPS(toolbar_tips),	\
-			tip, NULL);								\
-}
-#else
 #define CLAWS_SET_ARROW_TIP(widget,tip) { \
 	gtk_menu_tool_button_set_arrow_tooltip_text(GTK_MENU_TOOL_BUTTON(widget), tip);				\
 }
-#endif	
 
 static void activate_compose_button (Toolbar           *toolbar,
 				     ToolbarStyle      style,
 				     ComposeButtonType type)
 {
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *toolbar_tips = toolbar->tooltips;
-#endif
 	if ((!toolbar->compose_mail_btn))
 		return;
 
@@ -939,9 +922,6 @@ static void activate_learn_button (Toolbar           *toolbar,
 				     ToolbarStyle      style,
 				     LearnButtonType type)
 {
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *toolbar_tips = toolbar->tooltips;
-#endif
 	if ((!toolbar->learn_spam_btn))
 		return;
 
@@ -1907,11 +1887,6 @@ Toolbar *toolbar_create(ToolbarType 	 type,
 	GSList *toolbar_list;
 	Toolbar *toolbar_data;
 	GtkWidget *menu;
-#ifndef GENERIC_UMPC
-#if !(GTK_CHECK_VERSION(2,12,0))
-	GtkTooltips *toolbar_tips = gtk_tooltips_new();
-#endif
-#endif	
 	toolbar_read_config_file(type);
 	toolbar_list = toolbar_get_list(type);
 
@@ -1919,11 +1894,8 @@ Toolbar *toolbar_create(ToolbarType 	 type,
 
 	toolbar = gtk_toolbar_new();
 
-#if (GTK_CHECK_VERSION(2,16,0))
 	gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#else
-	gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);
-#endif
+
 	gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH);
 	gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), TRUE);
 	
@@ -2211,11 +2183,7 @@ Toolbar *toolbar_create(ToolbarType 	 type,
 
 	}
 	toolbar_data->toolbar = toolbar;
-#ifndef GENERIC_UMPC
-#if !(GTK_CHECK_VERSION(2,12,0))
-	toolbar_data->tooltips = toolbar_tips;
-#endif
-#endif
+
 	gtk_widget_show_all(toolbar);
 
 	if (type == TOOLBAR_MAIN) {
@@ -2324,61 +2292,9 @@ void toolbar_update(ToolbarType type, gpointer data)
 	}
 }
 
-#if !GTK_CHECK_VERSION(2,14,0)
-/* Work around http://bugzilla.gnome.org/show_bug.cgi?id=56070 */
 #define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {		\
-	gboolean in_btn1 = FALSE, in_btn2 = FALSE;		\
-	if (GTK_IS_BUTTON(widget))				\
-		in_btn1 = GTK_BUTTON(widget)->in_button;	\
-	else if (GTK_IS_MENU_TOOL_BUTTON(widget)) {		\
-		GtkWidget *child = gtk_bin_get_child(		\
-			GTK_BIN(widget)); 			\
-		GList *gchild = gtk_container_get_children(	\
-			GTK_CONTAINER(child)); 			\
-		GtkWidget *btn = (GtkWidget *)gchild->data;	\
-		GtkWidget *arr = (GtkWidget *)			\
-			(gchild->next?gchild->next->data:NULL);	\
-		g_list_free(gchild);				\
-		if (GTK_IS_BUTTON(btn))				\
-			in_btn1 = GTK_BUTTON(btn)->in_button;	\
-		if (GTK_IS_BUTTON(arr))				\
-			in_btn2 = GTK_BUTTON(arr)->in_button;	\
-	}							\
-	else if (GTK_IS_TOOL_ITEM(widget)) {			\
-		GtkWidget *child = gtk_bin_get_child(		\
-			GTK_BIN(widget)); 			\
-		if (GTK_IS_BUTTON(child))			\
-			in_btn1 = GTK_BUTTON(child)->in_button;	\
-	}							\
 	gtk_widget_set_sensitive(widget, sensitive);		\
-	if (GTK_IS_BUTTON(widget))				\
-		GTK_BUTTON(widget)->in_button = in_btn1;	\
-	else if (GTK_IS_MENU_TOOL_BUTTON(widget)) {		\
-		GtkWidget *child = gtk_bin_get_child(		\
-			GTK_BIN(widget)); 			\
-		GList *gchild = gtk_container_get_children(	\
-			GTK_CONTAINER(child)); 			\
-		GtkWidget *btn = (GtkWidget *)gchild->data;	\
-		GtkWidget *arr = (GtkWidget *)			\
-			(gchild->next?gchild->next->data:NULL);	\
-		g_list_free(gchild);				\
-		if (GTK_IS_BUTTON(btn))				\
-			GTK_BUTTON(btn)->in_button = in_btn1;	\
-		if (GTK_IS_BUTTON(arr))				\
-			GTK_BUTTON(arr)->in_button = in_btn2;	\
-	}							\
-	else if (GTK_IS_TOOL_ITEM(widget)) {			\
-		GtkWidget *child = gtk_bin_get_child(		\
-			GTK_BIN(widget)); 			\
-		if (GTK_IS_BUTTON(child))			\
-			GTK_BUTTON(child)->in_button = in_btn1;	\
-	}							\
 }
-#else
-#define GTK_BUTTON_SET_SENSITIVE(widget,sensitive) {		\
-	gtk_widget_set_sensitive(widget, sensitive);		\
-}
-#endif
 
 void toolbar_main_set_sensitive(gpointer data)
 {
@@ -2625,9 +2541,6 @@ static void toolbar_init(Toolbar * toolbar)
 #ifdef USE_ENCHANT
 	toolbar->spellcheck_btn    = NULL;
 #endif
-#if !GTK_CHECK_VERSION(2,12,0)
-	toolbar->tooltips          = NULL;
-#endif
 
 	toolbar_destroy(toolbar);
 }
diff --git a/src/toolbar.h b/src/toolbar.h
index c51204c..f8b1f21 100644
--- a/src/toolbar.h
+++ b/src/toolbar.h
@@ -108,9 +108,6 @@ struct _Toolbar {
 #ifdef USE_ENCHANT
 	GtkWidget *spellcheck_btn;
 #endif
-#if !GTK_CHECK_VERSION(2,12,0)
-	GtkTooltips *tooltips;
-#endif
 };
 
 struct _ToolbarItem {

-----------------------------------------------------------------------

Summary of changes:
 src/compose.c                                    |   10 ---
 src/compose.h                                    |    3 -
 src/gtk/filesel.c                                |    8 --
 src/gtk/gtksctree.c                              |    7 --
 src/gtk/gtksctree.h                              |    3 -
 src/message_search.c                             |   12 ---
 src/mimeview.c                                   |    6 --
 src/mimeview.h                                   |    3 -
 src/noticeview.c                                 |    6 --
 src/noticeview.h                                 |    3 -
 src/plugins/notification/notification_trayicon.c |    5 +-
 src/plugins/pdf_viewer/poppler_viewer.c          |    8 +-
 src/plugins/pdf_viewer/poppler_viewer.h          |    4 +-
 src/plugins/vcalendar/day-view.c                 |   17 +---
 src/plugins/vcalendar/month-view.c               |   32 +-------
 src/plugins/vcalendar/vcal_meeting_gtk.c         |   18 -----
 src/prefs_summaries.c                            |    3 -
 src/printing.c                                   |   12 +--
 src/procmime.c                                   |   11 ++-
 src/statusbar.c                                  |    2 +-
 src/summary_search.c                             |   17 +---
 src/summaryview.c                                |   11 +--
 src/summaryview.h                                |    3 -
 src/toolbar.c                                    |   91 +---------------------
 src/toolbar.h                                    |    3 -
 src/wizard.c                                     |   20 ++---
 26 files changed, 39 insertions(+), 279 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list