Remove unneeded arguments of xface_get_from_header
authorRicardo Mones <ricardo@mones.org>
Wed, 12 Feb 2014 22:22:37 +0000 (23:22 +0100)
committerRicardo Mones <ricardo@mones.org>
Wed, 12 Feb 2014 22:28:33 +0000 (23:28 +0100)
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/headerview.c
src/messageview.c
src/prefs_customheader.c
src/summaryview.c
src/textview.c

index 5f477d9..0c95fcc 100644 (file)
@@ -1090,18 +1090,13 @@ gboolean get_tag_range(GtkTextIter *iter,
 }
 
 #if HAVE_LIBCOMPFACE
-GtkWidget *xface_get_from_header(const gchar *o_xface, GdkColor *background,
-                                GdkWindow *window)
+GtkWidget *xface_get_from_header(const gchar *o_xface)
 {
        static gchar *xpm_xface[XPM_XFACE_HEIGHT];
        static gboolean xpm_xface_init = TRUE;
        gchar xface[2048];
        strncpy(xface, o_xface, sizeof(xface));
 
-       if (!window) {
-               g_warning("no window\n");
-               return NULL;
-       }
        if (uncompface(xface) < 0) {
                g_warning("uncompface failed\n");
                return NULL;
index de01d4f..a961dd8 100644 (file)
@@ -161,8 +161,7 @@ GtkWidget *gtkut_get_browse_directory_btn(const gchar *label);
 GtkWidget *gtkut_get_replace_btn(const gchar *label);
 GtkWidget *gtkut_get_options_frame(GtkWidget *box, GtkWidget **frame, const gchar *frame_label);
 #if HAVE_LIBCOMPFACE
-GtkWidget *xface_get_from_header(const gchar *o_xface, GdkColor *background,
-                                GdkWindow *window);
+GtkWidget *xface_get_from_header(const gchar *o_xface);
 #endif
 gboolean get_tag_range(GtkTextIter *iter,
                                       GtkTextTag *tag,
index a520e15..1ea12ba 100644 (file)
@@ -271,7 +271,7 @@ static gint headerview_show_xface(HeaderView *headerview, MsgInfo *msginfo)
                headerview->image = NULL;
        }
 
-       image = xface_get_from_header(xface, &hbox->style->white, hbox->window);
+       image = xface_get_from_header(xface);
 
        if (image) {
                gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
index 930ac66..1f1f094 100644 (file)
@@ -2844,9 +2844,7 @@ static void add_address_cb(GtkAction *action, gpointer data)
        else {
                gchar *xface = procmsg_msginfo_get_avatar(full_msginfo, AVATAR_XFACE);
                if (xface) {
-                       image = xface_get_from_header(xface,
-                                       &(gtk_widget_get_style(messageview->mainwin->summaryview->ctree)->white),
-                                       gtk_widget_get_window(messageview->window));
+                       image = xface_get_from_header(xface);
                }
        }
 #endif
index 36c2737..b5cec77 100644 (file)
@@ -923,11 +923,7 @@ static gboolean prefs_custom_header_selected(GtkTreeSelection *selector,
        } 
 #if HAVE_LIBCOMPFACE
 else if (!strcmp2("X-Face", ch->name)) {
-               GdkColor color;
-               color.pixel = 0;
-               preview = GTK_IMAGE(xface_get_from_header(ch->value, 
-                                         &color, 
-                                         mainwindow_get_mainwindow()->window->window));        
+               preview = GTK_IMAGE(xface_get_from_header(ch->value));  
                pixbuf = gtk_image_get_pixbuf(preview);
                gtk_image_set_from_pixbuf (GTK_IMAGE(customhdr.preview), pixbuf);
                gtk_widget_show(customhdr.preview);
index 91e6c90..3bd2ac0 100644 (file)
@@ -4704,9 +4704,7 @@ void summary_add_address(SummaryView *summaryview)
        else {
                gchar *xface = procmsg_msginfo_get_avatar(full_msginfo, AVATAR_XFACE);
                if (xface) {
-                       image = xface_get_from_header(xface,
-                                       &summaryview->ctree->style->white,
-                                       summaryview->mainwin->window->window);
+                       image = xface_get_from_header(xface);
                }
        }
 #endif
index b7ead66..cac63bf 100644 (file)
@@ -2064,9 +2064,7 @@ static void textview_show_xface(TextView *textview)
        window = mainwindow_get_mainwindow() ?
                        mainwindow_get_mainwindow()->window->window :
                        textview->text->window;
-       textview->image = xface_get_from_header(xface,
-                               &textview->text->style->white,
-                               window);
+       textview->image = xface_get_from_header(xface);
        cm_return_if_fail(textview->image != NULL);
 
        gtk_widget_show(textview->image);
@@ -3206,9 +3204,7 @@ static void add_uri_to_addrbook_cb (GtkAction *action, TextView *textview)
                                                textview->messageview->msginfo,
                                                AVATAR_XFACE);
                        if (xface) {
-                               image = xface_get_from_header(xface,
-                                               &textview->text->style->white,
-                                               mainwindow_get_mainwindow()->window->window);
+                               image = xface_get_from_header(xface);
                        }
                }
 #endif