[baobab/reroot-view: 16/31] Fold two functions together



commit 57b98e9b1e17cc167d1cc601caa0543f6e6a54a2
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Wed Jun 17 19:49:02 2020 +0200

    Fold two functions together
    
    scan_active_location was now called only by scan_location.

 src/baobab-window.vala | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)
---
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 69b0c45..c6e658b 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -283,21 +283,6 @@ namespace Baobab {
             file_chooser.show ();
         }
 
-        void scan_location (Location location, bool force = false) {
-            cancel_scan ();
-
-            active_location = location;
-
-            pathbar.location = location;
-            folder_display.location = location;
-
-            // Update the timestamp for GtkRecentManager
-            location_list.add_location (location);
-
-            treeview.model = null;
-            scan_active_location (force);
-        }
-
         void location_activated (Location location) {
             location.mount_volume.begin ((location_, res) => {
                 try {
@@ -638,9 +623,20 @@ namespace Baobab {
             }
         }
 
-        void scan_active_location (bool force) {
-            var scanner = active_location.scanner;
+        void scan_location (Location location, bool force = false) {
+            cancel_scan ();
+
+            active_location = location;
+
+            pathbar.location = location;
+            folder_display.location = location;
+
+            // Update the timestamp for GtkRecentManager
+            location_list.add_location (location);
 
+            treeview.model = null;
+
+            var scanner = active_location.scanner;
             scan_completed_handler = scanner.completed.connect (scanner_completed);
 
             clear_message ();


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