[Xfce4-commits] [xfce/thunar] 08/10: Extend reload functions to allow a full reload

noreply at xfce.org noreply at xfce.org
Sat Apr 18 14:23:11 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit b839b29d6dfa57aab9c3cec97eca7624a483a45e
Author: Harald Judt <h.judt at gmx.at>
Date:   Fri Apr 17 11:29:34 2015 +0200

    Extend reload functions to allow a full reload
    
    Usually a folder is reloaded automatically on file changes, and the user
    shouldn't have to do it manually. However, when the user *wants* to do
    it manually, everything is expected to be reloaded, even the files in
    cache, because their info may have changed. At the moment, this does not
    happen, and there can be various issues with cached file info, so extension
    is a first step to allow the user to decide to reload everything in the
    folder.
---
 thunar/thunar-application.c   |    2 +-
 thunar/thunar-standard-view.c |    8 +++++---
 thunar/thunar-view.c          |    9 ++++++---
 thunar/thunar-view.h          |    6 ++++--
 thunar/thunar-window.c        |   18 +++++++++++-------
 5 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 46a519b..8ce6683 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -497,7 +497,7 @@ thunar_application_launch_finished (ThunarJob  *job,
 
   /* the job completed, refresh the interface
    * directly to make it feel snappy */
-  thunar_view_reload (view);
+  thunar_view_reload (view, FALSE);
 }
 
 
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index ea96b3b..06b9376 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -139,7 +139,8 @@ static ThunarZoomLevel      thunar_standard_view_get_zoom_level             (Thu
 static void                 thunar_standard_view_set_zoom_level             (ThunarView               *view,
                                                                              ThunarZoomLevel           zoom_level);
 static void                 thunar_standard_view_reset_zoom_level           (ThunarView               *view);
-static void                 thunar_standard_view_reload                     (ThunarView               *view);
+static void                 thunar_standard_view_reload                     (ThunarView               *view,
+                                                                             gboolean                  reload_info);
 static gboolean             thunar_standard_view_get_visible_range          (ThunarView               *view,
                                                                              ThunarFile              **start_file,
                                                                              ThunarFile              **end_file);
@@ -1704,7 +1705,8 @@ thunar_standard_view_reset_zoom_level (ThunarView *view)
 
 
 static void
-thunar_standard_view_reload (ThunarView *view)
+thunar_standard_view_reload (ThunarView *view,
+                             gboolean    reload_info)
 {
   ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (view);
   ThunarFolder       *folder;
@@ -2954,7 +2956,7 @@ thunar_standard_view_new_files (ThunarStandardView *standard_view,
   /* when performing dnd between 2 views, we force a reload on the source as well */
   source_view = g_object_get_data (G_OBJECT (standard_view), I_("source-view"));
   if (THUNAR_IS_VIEW (source_view))
-    thunar_view_reload (THUNAR_VIEW (source_view));
+    thunar_view_reload (THUNAR_VIEW (source_view), FALSE);
 }
 
 
diff --git a/thunar/thunar-view.c b/thunar/thunar-view.c
index 9fd19e6..29d2b63 100644
--- a/thunar/thunar-view.c
+++ b/thunar/thunar-view.c
@@ -253,15 +253,18 @@ thunar_view_reset_zoom_level (ThunarView *view)
 /**
  * thunar_view_reload:
  * @view : a #ThunarView instance.
+ * @reload_info : whether to reload file info for all files too
  *
  * Tells @view to reread the currently displayed folder
- * contents from the underlying media.
+ * contents from the underlying media. If reload_info is
+ * TRUE, it will reload information for all files too.
  **/
 void
-thunar_view_reload (ThunarView *view)
+thunar_view_reload (ThunarView *view,
+                    gboolean    reload_info)
 {
   _thunar_return_if_fail (THUNAR_IS_VIEW (view));
-  (*THUNAR_VIEW_GET_IFACE (view)->reload) (view);
+  (*THUNAR_VIEW_GET_IFACE (view)->reload) (view, reload_info);
 }
 
 
diff --git a/thunar/thunar-view.h b/thunar/thunar-view.h
index 3085098..9aa62f3 100644
--- a/thunar/thunar-view.h
+++ b/thunar/thunar-view.h
@@ -51,7 +51,8 @@ struct _ThunarViewIface
                                          ThunarZoomLevel zoom_level);
   void            (*reset_zoom_level)   (ThunarView     *view);
 
-  void            (*reload)             (ThunarView     *view);
+  void            (*reload)             (ThunarView     *view,
+                                         gboolean        reload_info);
 
   gboolean        (*get_visible_range)  (ThunarView     *view,
                                          ThunarFile    **start_file,
@@ -79,7 +80,8 @@ void            thunar_view_set_zoom_level      (ThunarView     *view,
                                                  ThunarZoomLevel zoom_level);
 void            thunar_view_reset_zoom_level    (ThunarView     *view);
 
-void            thunar_view_reload              (ThunarView     *view);
+void            thunar_view_reload              (ThunarView     *view,
+                                                 gboolean        reload_info);
 
 gboolean        thunar_view_get_visible_range   (ThunarView     *view,
                                                  ThunarFile    **start_file,
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 68c1b2b..bc51b5e 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -104,7 +104,8 @@ static void     thunar_window_set_property                (GObject
                                                            const GValue           *value,
                                                            GParamSpec             *pspec);
 static gboolean thunar_window_back                        (ThunarWindow           *window);
-static gboolean thunar_window_reload                      (ThunarWindow           *window);
+static gboolean thunar_window_reload                      (ThunarWindow           *window,
+                                                           gboolean                reload_info);
 static gboolean thunar_window_toggle_sidepane             (ThunarWindow           *window);
 static gboolean thunar_window_toggle_menubar              (ThunarWindow           *window);
 static void     thunar_window_toggle_menubar_deactivate   (GtkWidget              *menubar,
@@ -257,7 +258,8 @@ struct _ThunarWindowClass
 
   /* internal action signals */
   gboolean (*back)            (ThunarWindow *window);
-  gboolean (*reload)          (ThunarWindow *window);
+  gboolean (*reload)          (ThunarWindow *window,
+                               gboolean      reload_info);
   gboolean (*toggle_sidepane) (ThunarWindow *window);
   gboolean (*toggle_menubar)  (ThunarWindow *window);
   gboolean (*zoom_in)         (ThunarWindow *window);
@@ -514,8 +516,9 @@ thunar_window_class_init (ThunarWindowClass *klass)
                   G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                   G_STRUCT_OFFSET (ThunarWindowClass, reload),
                   g_signal_accumulator_true_handled, NULL,
-                  _thunar_marshal_BOOLEAN__VOID,
-                  G_TYPE_BOOLEAN, 0);
+                  _thunar_marshal_BOOLEAN__BOOLEAN,
+                  G_TYPE_BOOLEAN, 1,
+                  G_TYPE_BOOLEAN);
 
   /**
    * ThunarWindow::toggle-sidepane:
@@ -1130,14 +1133,15 @@ thunar_window_back (ThunarWindow *window)
 
 
 static gboolean
-thunar_window_reload (ThunarWindow *window)
+thunar_window_reload (ThunarWindow *window,
+                      gboolean      reload_info)
 {
   _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE);
 
   /* force the view to reload */
   if (G_LIKELY (window->view != NULL))
     {
-      thunar_view_reload (THUNAR_VIEW (window->view));
+      thunar_view_reload (THUNAR_VIEW (window->view), reload_info);
       return TRUE;
     }
 
@@ -2478,7 +2482,7 @@ thunar_window_action_reload (GtkAction    *action,
   _thunar_return_if_fail (THUNAR_IS_WINDOW (window));
 
   /* force the view to reload */
-  g_signal_emit (G_OBJECT (window), window_signals[RELOAD], 0, &result);
+  g_signal_emit (G_OBJECT (window), window_signals[RELOAD], 0, TRUE, &result);
 
   /* update the location bar to show the current directory */
   if (window->location_bar != NULL)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list