Bugzilla – Attachment 203586 Details for
Bug 230478
main-menu: pointless thumbnailing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Avoid reloading tile tables unnecessarily
0005-Reload-only-tables-that-have-not-been-loaded.patch (text/plain), 4.76 KB, created by
Federico Mena Quintero
on 2008-03-24 17:28:08 UTC
(
hide
)
Description:
Avoid reloading tile tables unnecessarily
Filename:
MIME Type:
Creator:
Federico Mena Quintero
Created:
2008-03-24 17:28:08 UTC
Size:
4.76 KB
patch
obsolete
>From dfb7dbd04a12ef1dfbd81ed172919c8943695f17 Mon Sep 17 00:00:00 2001 >From: Federico Mena Quintero <federico@gnu.org> >Date: Wed, 19 Dec 2007 19:12:59 -0600 >Subject: [PATCH] Reload only tables that have not been loaded > 2007-12-19 Federico Mena Quintero <federico@novell.com> > > * main-menu/src/tile-table.c (tile_table_new): Don't reload the > table here. This prevents unnecessary loading at startup... > > * main-menu/src/main-menu-ui.c (select_page): ... but rather > reload them here when selecting a page. > (main_menu_ui_new): Reload the sys_table here, at startup. > (apply_lockdown_settings): And don't reload all the tables here. > (set_table_section_visible): Don't take into account the number of > tiles within a table; only consider whether that type of tile is > allowed to be visible. Make the code shorter. > (reload_file_table): New function; reload a file table and keep > track of which ones have been reloaded. > (reload_file_table_if_not_loaded): New function. > (select_page): Only reload file tables that have not been loaded before. > >Signed-off-by: Federico Mena Quintero <federico@gnu.org> >--- > ChangeLog | 4 ++++ > main-menu/src/main-menu-ui.c | 41 ++++++++++++++++++++++++++++++++--------- > 2 files changed, 36 insertions(+), 9 deletions(-) > >diff --git a/ChangeLog b/ChangeLog >index 8f0859d..2619b01 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -10,6 +10,10 @@ > (set_table_section_visible): Don't take into account the number of > tiles within a table; only consider whether that type of tile is > allowed to be visible. Make the code shorter. >+ (reload_file_table): New function; reload a file table and keep >+ track of which ones have been reloaded. >+ (reload_file_table_if_not_loaded): New function. >+ (select_page): Only reload file tables that have not been loaded before. > > 2007-12-19 Federico Mena Quintero <federico@novell.com> > >diff --git a/main-menu/src/main-menu-ui.c b/main-menu/src/main-menu-ui.c >index a95a960..edf79c2 100644 >--- a/main-menu/src/main-menu-ui.c >+++ b/main-menu/src/main-menu-ui.c >@@ -101,6 +101,7 @@ typedef struct { > gulong page_selectors_toggled_ids[3]; > gint notebook_page_ids [3]; > >+ gboolean file_tables_loaded[5]; > TileTable *file_tables [5]; > GtkWidget *table_sections [5]; > gboolean allowable_types [5]; >@@ -303,6 +304,24 @@ main_menu_ui_new (PanelApplet *applet) > } > > static void >+reload_file_table (MainMenuUI *this, int table_num) >+{ >+ MainMenuUIPrivate *priv = PRIVATE (this); >+ >+ tile_table_reload (priv->file_tables[table_num]); >+ priv->file_tables_loaded[table_num] = TRUE; >+} >+ >+static void >+reload_file_table_if_not_loaded (MainMenuUI *this, int table_num) >+{ >+ MainMenuUIPrivate *priv = PRIVATE (this); >+ >+ if (!priv->file_tables_loaded[table_num]) >+ reload_file_table (this, table_num); >+} >+ >+static void > main_menu_ui_class_init (MainMenuUIClass *this_class) > { > GObjectClass *g_obj_class = G_OBJECT_CLASS (this_class); >@@ -1133,17 +1152,17 @@ select_page (MainMenuUI *this, gboolean set_page_selector_button) > > switch (curr_page) { > case APPS_PAGE: >- tile_table_reload (priv->file_tables[USER_APPS_TABLE]); >- tile_table_reload (priv->file_tables[RCNT_APPS_TABLE]); >+ reload_file_table_if_not_loaded (this, USER_APPS_TABLE); >+ reload_file_table_if_not_loaded (this, RCNT_APPS_TABLE); > break; > > case DOCS_PAGE: >- tile_table_reload (priv->file_tables[USER_DOCS_TABLE]); >- tile_table_reload (priv->file_tables[RCNT_DOCS_TABLE]); >+ reload_file_table_if_not_loaded (this, USER_DOCS_TABLE); >+ reload_file_table_if_not_loaded (this, RCNT_DOCS_TABLE); > break; > > case DIRS_PAGE: >- tile_table_reload (priv->file_tables[USER_DIRS_TABLE]); >+ reload_file_table_if_not_loaded (this, USER_DIRS_TABLE); > break; > > default: >@@ -2008,11 +2027,11 @@ tile_table_notify_cb (GObject *g_obj, GParamSpec *pspec, gpointer user_data) > > switch (table_id) { > case USER_APPS_TABLE: >- tile_table_reload (priv->file_tables [RCNT_APPS_TABLE]); >+ reload_file_table (this, RCNT_APPS_TABLE); > break; > > case USER_DOCS_TABLE: >- tile_table_reload (priv->file_tables [RCNT_DOCS_TABLE]); >+ reload_file_table (this, RCNT_DOCS_TABLE); > break; > > default: >@@ -2252,13 +2271,17 @@ slab_gdk_message_filter (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer user_d > static void > user_app_agent_notify_cb (GObject *g_obj, GParamSpec *pspec, gpointer user_data) > { >- tile_table_reload (PRIVATE (user_data)->file_tables [RCNT_APPS_TABLE]); >+ MainMenuUI *this = MAIN_MENU_UI (user_data); >+ >+ reload_file_table (this, RCNT_APPS_TABLE); > } > > static void > user_doc_agent_notify_cb (GObject *g_obj, GParamSpec *pspec, gpointer user_data) > { >- tile_table_reload (PRIVATE (user_data)->file_tables [RCNT_DOCS_TABLE]); >+ MainMenuUI *this = MAIN_MENU_UI (user_data); >+ >+ reload_file_table (this, RCNT_DOCS_TABLE); > } > > static void >-- >1.5.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 230478
:
203582
|
203583
|
203584
|
203585
|
203586
|
206381