]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-theme-boxes.c
Merge branch 'debugger'
[empathy.git] / libempathy-gtk / empathy-theme-boxes.c
index 458543fa405de3182fdcaa3f23eca1fd3c0b9f46..f5224278caace526613ea0891e515e5fa2b0ac06 100644 (file)
@@ -15,8 +15,8 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
  *
  * Authors: Xavier Claessens <xclaesse@gmail.com>
  */
@@ -167,7 +167,7 @@ table_size_allocate_cb (GtkWidget     *view,
         gtk_widget_get_size_request (box, NULL, &height);
 
        width = allocation->width;
-       
+
        width -= \
                gtk_text_view_get_right_margin (GTK_TEXT_VIEW (view)) - \
                gtk_text_view_get_left_margin (GTK_TEXT_VIEW (view));
@@ -208,9 +208,9 @@ theme_boxes_maybe_append_header (EmpathyThemeBoxes *theme,
        DEBUG ("Maybe add fancy header");
 
        /* Only insert a header if the previously inserted block is not the same
-        * as this one. This catches all the different cases:
+        * as this one.
         */
-       if (last_contact && empathy_contact_equal (last_contact, contact)) {
+       if (empathy_contact_equal (last_contact, contact)) {
                return;
        }
 
@@ -259,7 +259,7 @@ theme_boxes_maybe_append_header (EmpathyThemeBoxes *theme,
 
        /* Add the message receive time */
        time = empathy_message_get_timestamp (msg);
-       tmp = empathy_time_to_string_local (time, 
+       tmp = empathy_time_to_string_local (time,
                                           EMPATHY_TIME_FORMAT_DISPLAY_SHORT);
        str = g_strdup_printf ("<i>%s</i>", tmp);
        label2 = g_object_new (GTK_TYPE_LABEL,
@@ -269,16 +269,18 @@ theme_boxes_maybe_append_header (EmpathyThemeBoxes *theme,
                               NULL);
        g_free (tmp);
        g_free (str);
-       
+
        /* Set foreground color of labels to the same color than the header tag. */
        table = gtk_text_buffer_get_tag_table (buffer);
        tag = gtk_text_tag_table_lookup (table, EMPATHY_THEME_BOXES_TAG_HEADER);
        g_object_get (tag, "foreground-set", &color_set, NULL);
        if (color_set) {
-               GdkColor color;
+               GdkColor *color;
+
                g_object_get (tag, "foreground-gdk", &color, NULL);
-               gtk_widget_modify_fg (label1, GTK_STATE_NORMAL, &color);
-               gtk_widget_modify_fg (label2, GTK_STATE_NORMAL, &color);
+               gtk_widget_modify_fg (label1, GTK_STATE_NORMAL, color);
+               gtk_widget_modify_fg (label2, GTK_STATE_NORMAL, color);
+               gdk_color_free (color);
        }
 
        /* Pack labels into the box */
@@ -328,7 +330,7 @@ theme_boxes_append_message (EmpathyChatTextView *view,
            TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
                gchar *body;
 
-               body = g_strdup_printf (" * %s %s", 
+               body = g_strdup_printf (" * %s %s",
                                        empathy_contact_get_name (sender),
                                        empathy_message_get_body (message));
                empathy_chat_text_view_append_body (EMPATHY_CHAT_TEXT_VIEW (view),
@@ -347,7 +349,7 @@ theme_boxes_notify_show_avatars_cb (EmpathyConf *conf,
                                    gpointer     user_data)
 {
        EmpathyThemeBoxesPriv *priv = GET_PRIV (user_data);
-       
+
        empathy_conf_get_bool (conf, key, &priv->show_avatars);
 }