[gnome-logs] Remove size group for the widgets in each row



commit 808466cfb6d8358e1d4766b9497634e58aa98718
Author: Jonathan Kang <jonathan121537 gmail com>
Date:   Fri Jul 7 09:31:36 2017 +0800

    Remove size group for the widgets in each row
    
    GtkSizeGroup is used to make sure widgets in diffirent rows request the
    same amount of space  while implementing "Use a single row for each
    log entry" in commit 995bacac51ee84516e9d0c4950dcc1edd45cdd64.
    But adding too many widgets to GtkSizeGroup leads to poor performance,
    which make scrolling the list in Logs very slow.
    
    Fix that by removing the GtkSizeGroup. As there are not too many widgets
    in the "Important" category, keep the category size group to make
    category labels request the same amount of space.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784216

 src/gl-eventviewlist.c |   12 ------------
 src/gl-eventviewrow.c  |   20 --------------------
 src/gl-eventviewrow.h  |    2 --
 3 files changed, 0 insertions(+), 34 deletions(-)
---
diff --git a/src/gl-eventviewlist.c b/src/gl-eventviewlist.c
index 59af348..71681e1 100644
--- a/src/gl-eventviewlist.c
+++ b/src/gl-eventviewlist.c
@@ -44,8 +44,6 @@ typedef struct
     GlUtilClockFormat clock_format;
     GtkListBox *entries_box;
     GtkSizeGroup *category_sizegroup;
-    GtkSizeGroup *message_sizegroup;
-    GtkSizeGroup *time_sizegroup;
     GtkWidget *categories;
     GtkWidget *event_search;
     GtkWidget *event_scrolled;
@@ -338,7 +336,6 @@ gl_event_list_view_create_row_widget (gpointer item,
                                       gpointer user_data)
 {
     GtkWidget *rtn;
-    GtkWidget *time_label;
     GlCategoryList *list;
     GlCategoryListFilter filter;
     GlEventViewList *view = user_data;
@@ -367,11 +364,6 @@ gl_event_list_view_create_row_widget (gpointer item,
                                      GL_EVENT_VIEW_ROW_CATEGORY_NONE);
     }
 
-    time_label = gl_event_view_row_get_time_label (GL_EVENT_VIEW_ROW (rtn));
-
-    gtk_size_group_add_widget (GTK_SIZE_GROUP (priv->time_sizegroup),
-                               time_label);
-
     return rtn;
 }
 
@@ -874,8 +866,6 @@ gl_event_view_list_finalize (GObject *object)
     g_clear_object (&priv->journal_model);
     g_clear_pointer (&priv->search_text, g_free);
     g_object_unref (priv->category_sizegroup);
-    g_object_unref (priv->message_sizegroup);
-    g_object_unref (priv->time_sizegroup);
 }
 
 static void
@@ -921,8 +911,6 @@ gl_event_view_list_init (GlEventViewList *view)
     priv->search_text = NULL;
     priv->boot_match = NULL;
     priv->category_sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-    priv->message_sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
-    priv->time_sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
     categories = GL_CATEGORY_LIST (priv->categories);
 
diff --git a/src/gl-eventviewrow.c b/src/gl-eventviewrow.c
index e0ff308..a838add 100644
--- a/src/gl-eventviewrow.c
+++ b/src/gl-eventviewrow.c
@@ -108,26 +108,6 @@ gl_event_view_row_get_category_label (GlEventViewRow *row)
     return priv->category_label;
 }
 
-GtkWidget *
-gl_event_view_row_get_message_label (GlEventViewRow *row)
-{
-    GlEventViewRowPrivate *priv;
-
-    priv = gl_event_view_row_get_instance_private (row);
-
-    return priv->message_label;
-}
-
-GtkWidget *
-gl_event_view_row_get_time_label (GlEventViewRow *row)
-{
-    GlEventViewRowPrivate *priv;
-
-    priv = gl_event_view_row_get_instance_private (row);
-
-    return priv->time_label;
-}
-
 static void
 gl_event_view_row_finalize (GObject *object)
 {
diff --git a/src/gl-eventviewrow.h b/src/gl-eventviewrow.h
index eb52c69..941f4f4 100644
--- a/src/gl-eventviewrow.h
+++ b/src/gl-eventviewrow.h
@@ -50,8 +50,6 @@ const gchar * gl_event_view_row_get_command_line (GlEventViewRow *row);
 const gchar * gl_event_view_row_get_message (GlEventViewRow *row);
 guint64 gl_event_view_row_get_timestamp (GlEventViewRow *row);
 GtkWidget * gl_event_view_row_get_category_label (GlEventViewRow *row);
-GtkWidget * gl_event_view_row_get_message_label (GlEventViewRow *row);
-GtkWidget * gl_event_view_row_get_time_label (GlEventViewRow *row);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]