/pidgin/main: 0636daf13ce3: Get rid of another warnings

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Fri Aug 16 06:05:20 EDT 2013


Changeset: 0636daf13ce3c3b1df34f57216d2a681a61474c3
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-08-16 12:05 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/0636daf13ce3

Description:

Get rid of another warnings

diffstat:

 pidgin/gtkwebviewtoolbar.c |  9 +++++++++
 pidgin/plugins/webkit.c    |  3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diffs (39 lines):

diff --git a/pidgin/gtkwebviewtoolbar.c b/pidgin/gtkwebviewtoolbar.c
--- a/pidgin/gtkwebviewtoolbar.c
+++ b/pidgin/gtkwebviewtoolbar.c
@@ -1097,6 +1097,12 @@ update_buttons(GtkWebViewToolbar *toolba
 	g_free(tmp);
 
 	tmp = gtk_webview_get_current_forecolor(GTK_WEBVIEW(toolbar->webview));
+	/* TODO: rgb()/rgba() colors are not supported by GTK, so let's get rid
+	 * of such warnings for now. There are two solutions: rewrite those
+	 * colors to #aabbcc or implement the toolbar in javascript.
+	 */
+	if (tmp && strncmp(tmp, "rgb", 3) == 0)
+		tmp[0] = '\0';
 	toggle_action_set_active_block(GTK_TOGGLE_ACTION(priv->fgcolor),
 	                               (tmp && *tmp), toolbar);
 	if (tmp && *tmp) {
@@ -1108,6 +1114,9 @@ update_buttons(GtkWebViewToolbar *toolba
 	g_free(tmp);
 
 	tmp = gtk_webview_get_current_backcolor(GTK_WEBVIEW(toolbar->webview));
+	/* TODO: see comment above */
+	if (tmp && strncmp(tmp, "rgb", 3) == 0)
+		tmp[0] = '\0';
 	toggle_action_set_active_block(GTK_TOGGLE_ACTION(priv->bgcolor),
 	                               (tmp && *tmp), toolbar);
 	if (tmp && *tmp) {
diff --git a/pidgin/plugins/webkit.c b/pidgin/plugins/webkit.c
--- a/pidgin/plugins/webkit.c
+++ b/pidgin/plugins/webkit.c
@@ -90,7 +90,8 @@ remove_inspector(PidginConversation *gtk
 	WebKitWebSettings *settings;
 
 	win = g_object_get_data(G_OBJECT(webview), "inspector-window");
-	gtk_widget_destroy(win);
+	if (win != NULL)
+		gtk_widget_destroy(win);
 	g_object_set_data(G_OBJECT(webview), "inspector-window", NULL);
 
 	settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));



More information about the Commits mailing list