[frogr] Make sure project's path gets always updated



commit 2baf33afe6621924b23107b0eda4f8a40d03e689
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat Dec 22 18:53:14 2012 +0100

    Make sure project's path gets always updated

 src/frogr-controller.c |    2 ++
 src/frogr-main-view.c  |   16 +++++++++-------
 src/frogr-main-view.h  |    2 ++
 3 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index d2f0e91..689e786 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -3078,6 +3078,7 @@ frogr_controller_open_project_from_file (FrogrController *self, const gchar *pat
              json_object_get_int_member (root_object, "n_groups"),
              json_object_get_int_member (root_object, "n_tags"));
 
+      frogr_main_view_update_project_path (priv->mainview, path);
       frogr_model_deserialize (model, data_object);
       result = TRUE;
     }
@@ -3150,6 +3151,7 @@ frogr_controller_save_project_to_file (FrogrController *self, const gchar *path)
       return FALSE;
     }
 
+  frogr_main_view_update_project_path (priv->mainview, path);
   return TRUE;
 }
 
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index ed6a8c6..e7a8208 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1229,7 +1229,7 @@ _open_project_dialog_response_cb (GtkDialog *dialog,
 
           /* Load from disk and update project's path */
           if (frogr_controller_open_project_from_file (priv->controller, filename))
-            _update_project_path (self, filename);
+            _update_window_title (self, FALSE);
           g_free (filename);
         }
     }
@@ -1284,12 +1284,7 @@ _save_project_to_file (FrogrMainView *self, const gchar *filepath)
 
   /* Save to disk and update project's path */
   if (frogr_controller_save_project_to_file (priv->controller, filepath))
-    {
-      _update_project_path (self, filepath);
-
-      /* Update title marking it as non-dirty (just saved) */
-      _update_window_title (self, FALSE);
-    }
+    _update_window_title (self, FALSE);
 }
 
 static void
@@ -2218,6 +2213,13 @@ frogr_main_view_new (GtkApplication *app)
 }
 
 void
+frogr_main_view_update_project_path (FrogrMainView *self, const gchar *path)
+{
+  g_return_if_fail(FROGR_IS_MAIN_VIEW (self));
+  _update_project_path (self, path);
+}
+
+void
 frogr_main_view_set_status_text (FrogrMainView *self,
                                  const gchar *text)
 {
diff --git a/src/frogr-main-view.h b/src/frogr-main-view.h
index 7d4e85a..7f70a11 100644
--- a/src/frogr-main-view.h
+++ b/src/frogr-main-view.h
@@ -51,6 +51,8 @@ GType frogr_main_view_get_type (void) G_GNUC_CONST;
 
 FrogrMainView *frogr_main_view_new (GtkApplication *app);
 
+void frogr_main_view_update_project_path (FrogrMainView *self, const gchar *path);
+
 void frogr_main_view_set_status_text (FrogrMainView *self, const gchar *text);
 
 void frogr_main_view_show_progress (FrogrMainView *self, const gchar *text);



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