[libgda] GdaBrowser: improved startup time
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: improved startup time
- Date: Wed, 20 Jul 2011 20:37:39 +0000 (UTC)
commit 2f9c6ba9ac568c081c2b3595675baf06749cefce
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Jul 20 22:32:43 2011 +0200
GdaBrowser: improved startup time
tools/browser/browser-favorites.c | 11 +++++------
tools/browser/schema-browser/favorite-selector.c | 7 +++----
2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/tools/browser/browser-favorites.c b/tools/browser/browser-favorites.c
index c6434b0..52e84ab 100644
--- a/tools/browser/browser-favorites.c
+++ b/tools/browser/browser-favorites.c
@@ -178,6 +178,8 @@ static gboolean
meta_store_addons_init (BrowserFavorites *bfav, GError **error)
{
GError *lerror = NULL;
+ if (bfav->priv->store_cnc)
+ return TRUE;
if (!gda_meta_store_schema_add_custom_object (bfav->priv->store, FAVORITES_TABLE_DESC, &lerror)) {
g_set_error (error, 0, 0, "%s",
@@ -542,8 +544,7 @@ browser_favorites_add (BrowserFavorites *bfav, guint session_id,
g_return_val_if_fail (fav, FALSE);
g_return_val_if_fail (fav->contents, FALSE);
- if (! bfav->priv->store_cnc &&
- ! meta_store_addons_init (bfav, error))
+ if (! meta_store_addons_init (bfav, error))
return FALSE;
store_cnc = bfav->priv->store_cnc;
@@ -815,8 +816,7 @@ browser_favorites_list (BrowserFavorites *bfav, guint session_id, BrowserFavorit
g_return_val_if_fail (BROWSER_IS_FAVORITES (bfav), NULL);
g_return_val_if_fail ((type != 0) || (order_key >= 0), NULL);
- if (! bfav->priv->store_cnc &&
- ! meta_store_addons_init (bfav, error))
+ if (! meta_store_addons_init (bfav, error))
return NULL;
b = gda_sql_builder_new (GDA_SQL_STATEMENT_SELECT);
@@ -978,8 +978,7 @@ browser_favorites_delete (BrowserFavorites *bfav, guint session_id,
g_return_val_if_fail ((fav->id >= 0) || fav->contents, FALSE);
memset (&efav, 0, sizeof (BrowserFavoritesAttributes));
- if (! bfav->priv->store_cnc &&
- ! meta_store_addons_init (bfav, error))
+ if (! meta_store_addons_init (bfav, error))
return FALSE;
if (! gda_lockable_trylock (GDA_LOCKABLE (bfav->priv->store_cnc))) {
diff --git a/tools/browser/schema-browser/favorite-selector.c b/tools/browser/schema-browser/favorite-selector.c
index fff975d..398a13b 100644
--- a/tools/browser/schema-browser/favorite-selector.c
+++ b/tools/browser/schema-browser/favorite-selector.c
@@ -235,10 +235,9 @@ favorite_selector_new (BrowserConnection *bcnc)
g_object_unref (manager);
/* update the tree's contents */
- if (! gda_tree_update_all (tsel->priv->tree, NULL)) {
- if (tsel->priv->idle_update_favorites == 0)
- tsel->priv->idle_update_favorites = g_idle_add ((GSourceFunc) idle_update_favorites, tsel);
- }
+ if (tsel->priv->idle_update_favorites == 0)
+ tsel->priv->idle_update_favorites = g_idle_add ((GSourceFunc) idle_update_favorites,
+ tsel);
/* header */
GtkWidget *label;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]