[nautilus/wip/exalm/libhandy: 69/77] general: Remove tab position setting




commit b60508c9e3a7578e7e70fcb8a268ee869c47a574
Author: Christopher Davis <christopherdavis gnome org>
Date:   Sat Jul 9 21:19:00 2022 -0400

    general: Remove tab position setting
    
    This hidden setting was added back when tabs were introduced in
    commit 07cf7db47fd5fae64201f1cff73e39fd8aed2f54
    
    That commit provides no motivation for this setting, and neither does
    the bug it references: https://bugzilla.gnome.org/show_bug.cgi?id=48034
    
    The same commit added a "tabs_enable" setting too, so it's fair assume
    this setting doesn't solve any problem, it was just a trend of older
    times to make everything configurable.
    
    Let's remove the setting and assume the default behavior. Also remove
    the related NAUTILUS_OPEN_FLAG_SLOT_APPEND flag.
    
    (Diff and message amended by António Fernandes<antoniof gnome org>)

 data/org.gnome.nautilus.gschema.xml | 13 -------------
 src/nautilus-enums.h                |  3 +--
 src/nautilus-global-preferences.h   |  6 ------
 src/nautilus-mime-actions.c         |  4 +---
 src/nautilus-window.c               | 14 +-------------
 5 files changed, 3 insertions(+), 37 deletions(-)
---
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index 883f4a8fe..e32cac3e3 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -49,11 +49,6 @@
     <value value="2" nick="large"/>
   </enum>
 
-  <enum id="org.gnome.nautilus.TabPosition">
-    <value value="0" nick="after-current-tab"/>
-    <value value="1" nick="end"/>
-  </enum>
-
   <enum id="org.gnome.nautilus.SearchFilterTimeType">
     <value value="0" nick="last_modified"/>
     <value value="1" nick="last_used"/>
@@ -76,14 +71,6 @@
   </schema>
 
   <schema path="/org/gnome/nautilus/preferences/" id="org.gnome.nautilus.preferences" 
gettext-domain="nautilus">
-    <key name="tabs-open-position" enum="org.gnome.nautilus.TabPosition">
-      <aliases>
-        <alias value='after_current_tab' target='after-current-tab'/>
-      </aliases>
-      <default>'after-current-tab'</default>
-      <summary>Where to position newly open tabs in browser windows</summary>
-      <description>If set to “after-current-tab”, then new tabs are inserted after the current tab. If set 
to “end”, then new tabs are appended to the end of the tab list.</description>
-    </key>
     <key type="b" name="always-use-location-entry">
       <default>false</default>
       <summary>Always use the location entry, instead of the pathbar</summary>
diff --git a/src/nautilus-enums.h b/src/nautilus-enums.h
index 2cb9b4c80..669b3c453 100644
--- a/src/nautilus-enums.h
+++ b/src/nautilus-enums.h
@@ -75,6 +75,5 @@ typedef enum
     NAUTILUS_OPEN_FLAG_NORMAL           = 1 << 0,
     NAUTILUS_OPEN_FLAG_NEW_WINDOW       = 1 << 1,
     NAUTILUS_OPEN_FLAG_NEW_TAB          = 1 << 2,
-    NAUTILUS_OPEN_FLAG_SLOT_APPEND      = 1 << 3,
-    NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE = 1 << 4,
+    NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE = 1 << 3,
 } NautilusOpenFlags;
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index 6d3b0473c..5168f383f 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -36,12 +36,6 @@ G_BEGIN_DECLS
 #define NAUTILUS_PREFERENCES_MOUSE_FORWARD_BUTTON              "mouse-forward-button"
 #define NAUTILUS_PREFERENCES_MOUSE_BACK_BUTTON                 "mouse-back-button"
 
-typedef enum
-{
-       NAUTILUS_NEW_TAB_POSITION_AFTER_CURRENT_TAB,
-       NAUTILUS_NEW_TAB_POSITION_END,
-} NautilusNewTabPosition;
-
 /* Single/Double click preference  */
 #define NAUTILUS_PREFERENCES_CLICK_POLICY                      "click-policy"
 
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 97fca0c2f..fa6db308f 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1643,9 +1643,7 @@ activate_files_internal (ActivateParameters *parameters)
 
     if (parameters->slot != NULL)
     {
-        if ((parameters->flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0 &&
-            g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_NEW_TAB_POSITION) ==
-            NAUTILUS_NEW_TAB_POSITION_AFTER_CURRENT_TAB)
+        if ((parameters->flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0)
         {
             /* When inserting N tabs after the current one,
              * we first open tab N, then tab N-1, ..., then tab 0.
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 9c8b8b78e..d29627394 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -543,9 +543,7 @@ nautilus_window_initialize_slot (NautilusWindow     *window,
                                      window);
     nautilus_notebook_add_tab (GTK_NOTEBOOK (window->notebook),
                                slot,
-                               (flags & NAUTILUS_OPEN_FLAG_SLOT_APPEND) != 0 ?
-                               -1 :
-                               gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook)) + 1,
+                               -1,
                                FALSE);
     g_signal_handlers_unblock_by_func (window->notebook,
                                        G_CALLBACK (notebook_switch_page_cb),
@@ -563,19 +561,9 @@ nautilus_window_open_location_full (NautilusWindow     *window,
                                     NautilusWindowSlot *target_slot)
 {
     NautilusWindowSlot *active_slot;
-    gboolean new_tab_at_end;
 
     /* Assert that we are not managing new windows */
     g_assert (!(flags & NAUTILUS_OPEN_FLAG_NEW_WINDOW));
-    /* if the flags say we want a new tab, open a slot in the current window */
-    if ((flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0)
-    {
-        new_tab_at_end = g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_NEW_TAB_POSITION) 
== NAUTILUS_NEW_TAB_POSITION_END;
-        if (new_tab_at_end)
-        {
-            flags |= NAUTILUS_OPEN_FLAG_SLOT_APPEND;
-        }
-    }
 
     active_slot = nautilus_window_get_active_slot (window);
     if (!target_slot)


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