[frogr] Don't ever fetch tags when tags autocompletion is not enabled



commit 9277142958e4cbda4dadc7a72f79487af46c1e00
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri Feb 25 01:50:48 2011 +0100

    Don't ever fetch tags when tags autocompletion is not enabled

 src/frogr-controller.c |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index cdcc430..3e5babf 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -1003,9 +1003,11 @@ _on_pictures_uploaded (FrogrController *self,
       FrogrControllerPrivate *priv = NULL;
       priv = FROGR_CONTROLLER_GET_PRIVATE (self);
 
-      /* Fetch sets and tags right after finishing */
+      /* Fetch sets and tags (if needed) right after finishing */
       _fetch_sets (self);
-      _fetch_tags (self);
+
+      if (frogr_config_get_tags_autocompletion (priv->config))
+        _fetch_tags (self);
 
       DEBUG ("%s", "Success uploading pictures!");
     }
@@ -1026,11 +1028,17 @@ _fetch_everything (FrogrController *self)
 {
   g_return_if_fail(FROGR_IS_CONTROLLER (self));
 
+  FrogrControllerPrivate *priv = NULL;
+
   _fetch_account_info (self);
   _fetch_account_extra_info (self);
   _fetch_sets (self);
   _fetch_groups (self);
-  _fetch_tags (self);
+
+  /* No need to retrieve tags if tags autocompletion is disabled */
+  priv = FROGR_CONTROLLER_GET_PRIVATE (self);
+  if (frogr_config_get_tags_autocompletion (priv->config))
+    _fetch_tags (self);
 }
 
 static void
@@ -1984,11 +1992,14 @@ frogr_controller_show_details_dialog (FrogrController *self,
   mainview_model = frogr_main_view_get_model (priv->mainview);
   tags_list = frogr_main_view_model_get_tags_list (mainview_model);
 
-  /* Fetch the tags list first if needed */
-  if (frogr_main_view_model_n_tags (mainview_model) == 0 && !priv->tags_fetched)
+  if (frogr_config_get_tags_autocompletion (priv->config))
     {
-      frogr_main_view_show_progress (priv->mainview, _("Retrieving list of tagsâ?¦"));
-      _fetch_tags (self);
+      /* Fetch the tags list first if needed */
+      if (frogr_main_view_model_n_tags (mainview_model) == 0 && !priv->tags_fetched)
+        {
+          frogr_main_view_show_progress (priv->mainview, _("Retrieving list of tagsâ?¦"));
+          _fetch_tags (self);
+        }
     }
 
   /* Show the dialog when possible */
@@ -2007,11 +2018,14 @@ frogr_controller_show_add_tags_dialog (FrogrController *self,
   priv = FROGR_CONTROLLER_GET_PRIVATE (self);
   mainview_model = frogr_main_view_get_model (priv->mainview);
 
-  /* Fetch the tags list first if needed */
-  if (frogr_main_view_model_n_tags (mainview_model) == 0 && !priv->tags_fetched)
+  if (frogr_config_get_tags_autocompletion (priv->config))
     {
-      frogr_main_view_show_progress (priv->mainview, _("Retrieving list of tagsâ?¦"));
-      _fetch_tags (self);
+      /* Fetch the tags list first if needed */
+      if (frogr_main_view_model_n_tags (mainview_model) == 0 && !priv->tags_fetched)
+        {
+          frogr_main_view_show_progress (priv->mainview, _("Retrieving list of tagsâ?¦"));
+          _fetch_tags (self);
+        }
     }
 
   /* Show the dialog when possible */



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