[nautilus/wip/antoniof/new-pathbar: 42/43] enums: Make OpenFlags more generic




commit 2088eb399e74809b5cd334c63c02ceef839f5dcd
Author: António Fernandes <antoniof gnome org>
Date:   Sat Dec 18 20:58:57 2021 +0000

    enums: Make OpenFlags more generic
    
    GtkPlacesOpenFlags as public API are gone in GTK 4. In preparation,
    rename our NautilusWindowOpenFlags enumeration type and make it
    value-compatible with GtkPlacesOpenFlags.

 src/nautilus-application.c     | 36 ++++++++++++++++-----------------
 src/nautilus-application.h     |  4 ++--
 src/nautilus-canvas-view.c     |  8 ++++----
 src/nautilus-enums.h           | 11 +++++-----
 src/nautilus-files-view-dnd.c  |  2 +-
 src/nautilus-files-view.c      | 20 +++++++++---------
 src/nautilus-files-view.h      | 14 ++++++-------
 src/nautilus-list-view.c       |  8 ++++----
 src/nautilus-location-entry.c  |  2 +-
 src/nautilus-mime-actions.c    | 38 +++++++++++++++++-----------------
 src/nautilus-mime-actions.h    | 18 ++++++++---------
 src/nautilus-places-view.c     |  8 ++++----
 src/nautilus-window-slot-dnd.c |  2 +-
 src/nautilus-window-slot.c     | 12 +++++------
 src/nautilus-window-slot.h     |  8 ++++----
 src/nautilus-window.c          | 46 +++++++++++++++++++++---------------------
 src/nautilus-window.h          | 16 +++++++--------
 17 files changed, 127 insertions(+), 126 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 973e1b521..89a26615f 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -341,12 +341,12 @@ get_window_slot_for_location (NautilusApplication *self,
 }
 
 void
-nautilus_application_open_location_full (NautilusApplication     *self,
-                                         GFile                   *location,
-                                         NautilusWindowOpenFlags  flags,
-                                         GList                   *selection,
-                                         NautilusWindow          *target_window,
-                                         NautilusWindowSlot      *target_slot)
+nautilus_application_open_location_full (NautilusApplication *self,
+                                         GFile               *location,
+                                         NautilusOpenFlags    flags,
+                                         GList               *selection,
+                                         NautilusWindow      *target_window,
+                                         NautilusWindowSlot  *target_slot)
 {
     NAUTILUS_APPLICATION_CLASS (G_OBJECT_GET_CLASS (self))->open_location_full (self,
                                                                                 location,
@@ -357,12 +357,12 @@ nautilus_application_open_location_full (NautilusApplication     *self,
 }
 
 static void
-real_open_location_full (NautilusApplication     *self,
-                         GFile                   *location,
-                         NautilusWindowOpenFlags  flags,
-                         GList                   *selection,
-                         NautilusWindow          *target_window,
-                         NautilusWindowSlot      *target_slot)
+real_open_location_full (NautilusApplication *self,
+                         GFile               *location,
+                         NautilusOpenFlags    flags,
+                         GList               *selection,
+                         NautilusWindow      *target_window,
+                         NautilusWindowSlot  *target_slot)
 {
     NautilusWindowSlot *active_slot = NULL;
     NautilusWindow *active_window;
@@ -415,11 +415,11 @@ real_open_location_full (NautilusApplication     *self,
         target_window = nautilus_window_slot_get_window (target_slot);
     }
 
-    g_assert (!((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0 &&
-                (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0));
+    g_assert (!((flags & NAUTILUS_OPEN_FLAG_NEW_WINDOW) != 0 &&
+                (flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0));
 
     /* and if the flags specify so, this is overridden */
-    if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0)
+    if ((flags & NAUTILUS_OPEN_FLAG_NEW_WINDOW) != 0)
     {
         use_same = FALSE;
     }
@@ -454,7 +454,7 @@ real_open_location_full (NautilusApplication     *self,
 
     /* Application is the one that manages windows, so this flag shouldn't use
      * it anymore by any client */
-    flags &= ~NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+    flags &= ~NAUTILUS_OPEN_FLAG_NEW_WINDOW;
     nautilus_window_open_location_full (target_window, location, flags, selection, target_slot);
 }
 
@@ -690,7 +690,7 @@ action_new_window (GSimpleAction *action,
     home = g_file_new_for_path (g_get_home_dir ());
 
     nautilus_application_open_location_full (application, home,
-                                             NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW,
+                                             NAUTILUS_OPEN_FLAG_NEW_WINDOW,
                                              NULL, NULL, NULL);
 }
 
@@ -732,7 +732,7 @@ action_clone_window (GSimpleAction *action,
     }
 
     nautilus_application_open_location_full (NAUTILUS_APPLICATION (application), location,
-                                             NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW, NULL, NULL, NULL);
+                                             NAUTILUS_OPEN_FLAG_NEW_WINDOW, NULL, NULL, NULL);
 }
 
 static void
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index f915b0d4d..cbef12312 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -35,7 +35,7 @@ struct _NautilusApplicationClass {
 
         void  (*open_location_full) (NautilusApplication     *application,
                                      GFile                   *location,
-                                     NautilusWindowOpenFlags  flags,
+                                     NautilusOpenFlags        flags,
                                      GList                   *selection,
                                      NautilusWindow          *target_window,
                                      NautilusWindowSlot      *target_slot);
@@ -63,7 +63,7 @@ void nautilus_application_open_location (NautilusApplication *application,
 
 void nautilus_application_open_location_full (NautilusApplication     *application,
                                               GFile                   *location,
-                                              NautilusWindowOpenFlags  flags,
+                                              NautilusOpenFlags        flags,
                                               GList                   *selection,
                                               NautilusWindow          *target_window,
                                               NautilusWindowSlot      *target_slot);
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index ce162d414..b3e07cf19 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1074,7 +1074,7 @@ canvas_container_activate_alternate_callback (NautilusCanvasContainer *container
     GdkEventButton *button_event;
     GdkEventKey *key_event;
     gboolean open_in_tab, open_in_window;
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
 
     g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
     g_assert (container == get_canvas_container (canvas_view));
@@ -1102,13 +1102,13 @@ canvas_container_activate_alternate_callback (NautilusCanvasContainer *container
 
     if (open_in_tab)
     {
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+        flags |= NAUTILUS_OPEN_FLAG_NEW_TAB;
+        flags |= NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
     }
 
     if (open_in_window)
     {
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+        flags |= NAUTILUS_OPEN_FLAG_NEW_WINDOW;
     }
 
     DEBUG ("Activate alternate, open in tab %d, new window %d\n",
diff --git a/src/nautilus-enums.h b/src/nautilus-enums.h
index edfd99919..9f43800ca 100644
--- a/src/nautilus-enums.h
+++ b/src/nautilus-enums.h
@@ -76,8 +76,9 @@ typedef enum
 
 typedef enum
 {
-    NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW       = 1 << 0,
-    NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB          = 1 << 1,
-    NAUTILUS_WINDOW_OPEN_SLOT_APPEND           = 1 << 2,
-    NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE = 1 << 3,
-} NautilusWindowOpenFlags;
+    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,
+} NautilusOpenFlags;
diff --git a/src/nautilus-files-view-dnd.c b/src/nautilus-files-view-dnd.c
index 485a7661f..9c803b54d 100644
--- a/src/nautilus-files-view-dnd.c
+++ b/src/nautilus-files-view-dnd.c
@@ -401,7 +401,7 @@ nautilus_files_view_handle_hover (NautilusFilesView *view,
         !(current_location != NULL && g_file_equal (location, current_location)))
     {
         nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
-                                                 location, NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE,
+                                                 location, NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE,
                                                  NULL, NULL, slot);
     }
     g_object_unref (location);
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index dfb7fb26c..e5339fa7c 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1335,10 +1335,10 @@ nautilus_files_view_activate_selection (NautilusFilesView *view)
 }
 
 void
-nautilus_files_view_activate_files (NautilusFilesView       *view,
-                                    GList                   *files,
-                                    NautilusWindowOpenFlags  flags,
-                                    gboolean                 confirm_multiple)
+nautilus_files_view_activate_files (NautilusFilesView *view,
+                                    GList             *files,
+                                    NautilusOpenFlags  flags,
+                                    gboolean           confirm_multiple)
 {
     NautilusFilesViewPrivate *priv;
     GList *files_to_extract;
@@ -1389,9 +1389,9 @@ nautilus_files_view_activate_files (NautilusFilesView       *view,
 }
 
 void
-nautilus_files_view_activate_file (NautilusFilesView       *view,
-                                   NautilusFile            *file,
-                                   NautilusWindowOpenFlags  flags)
+nautilus_files_view_activate_file (NautilusFilesView *view,
+                                   NautilusFile      *file,
+                                   NautilusOpenFlags  flags)
 {
     g_autoptr (GList) files = NULL;
 
@@ -1473,8 +1473,8 @@ action_open_item_new_tab (GSimpleAction *action,
     {
         nautilus_files_view_activate_files (view,
                                             selection,
-                                            NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
-                                            NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE,
+                                            NAUTILUS_OPEN_FLAG_NEW_TAB |
+                                            NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE,
                                             FALSE);
     }
 }
@@ -4895,7 +4895,7 @@ open_one_in_new_window (gpointer data,
 
     nautilus_files_view_activate_file (NAUTILUS_FILES_VIEW (callback_data),
                                        NAUTILUS_FILE (data),
-                                       NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
+                                       NAUTILUS_OPEN_FLAG_NEW_WINDOW);
 }
 
 NautilusFile *
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index f1b31d464..92a5a3e53 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -259,13 +259,13 @@ gboolean            nautilus_files_view_get_loading                      (Nautil
 /* Hooks for subclasses to call. These are normally called only by
  * NautilusFilesView and its subclasses
  */
-void                nautilus_files_view_activate_files                   (NautilusFilesView       *view,
-                                                                          GList                   *files,
-                                                                          NautilusWindowOpenFlags  flags,
-                                                                          gboolean                 
confirm_multiple);
-void                nautilus_files_view_activate_file                    (NautilusFilesView       *view,
-                                                                          NautilusFile            *file,
-                                                                          NautilusWindowOpenFlags  flags);
+void                nautilus_files_view_activate_files                   (NautilusFilesView *view,
+                                                                          GList             *files,
+                                                                          NautilusOpenFlags  flags,
+                                                                          gboolean           
confirm_multiple);
+void                nautilus_files_view_activate_file                    (NautilusFilesView *view,
+                                                                          NautilusFile      *file,
+                                                                          NautilusOpenFlags  flags);
 void                nautilus_files_view_preview_files                    (NautilusFilesView *view,
                                                                           GList             *files,
                                                                           GArray            *locations);
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index b8248e0bc..9eacfca2b 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -210,18 +210,18 @@ activate_selected_items_alternate (NautilusListView *view,
                                    gboolean          open_in_tab)
 {
     GList *file_list;
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
 
     flags = 0;
 
     if (open_in_tab)
     {
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+        flags |= NAUTILUS_OPEN_FLAG_NEW_TAB;
+        flags |= NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
     }
     else
     {
-        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+        flags |= NAUTILUS_OPEN_FLAG_NEW_WINDOW;
     }
 
     if (file != NULL)
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index 8c2e1155a..75c925d59 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -309,7 +309,7 @@ drag_data_received_callback (GtkWidget        *widget,
         {
             location = g_file_new_for_uri (names[i]);
             nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
-                                                     location, NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW, NULL, 
NULL, NULL);
+                                                     location, NAUTILUS_OPEN_FLAG_NEW_WINDOW, NULL, NULL, 
NULL);
             g_object_unref (location);
         }
     }
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index eb331e9d1..f57b94e6d 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -76,7 +76,7 @@ typedef struct
     GList *mountables;
     GList *start_mountables;
     GList *not_mounted;
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     char *timed_wait_prompt;
     gboolean timed_wait_active;
     NautilusFileListHandle *files_handle;
@@ -990,7 +990,7 @@ typedef struct
     GtkWindow *parent_window;
     NautilusFile *file;
     GList *files;
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     char *activation_directory;
     gboolean user_confirmation;
     char *uri;
@@ -1433,7 +1433,7 @@ static void
 activate_files (ActivateParameters *parameters)
 {
     NautilusFile *file;
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     g_autoptr (GList) open_in_app_parameters = NULL;
     g_autoptr (GList) unhandled_open_in_app_uris = NULL;
     ApplicationLaunchParameters *one_parameters;
@@ -1563,22 +1563,22 @@ activate_files (ActivateParameters *parameters)
     flags = parameters->flags;
     if (count > 1)
     {
-        if ((parameters->flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) == 0)
+        if ((parameters->flags & NAUTILUS_OPEN_FLAG_NEW_WINDOW) == 0)
         {
-            flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+            flags |= NAUTILUS_OPEN_FLAG_NEW_TAB;
         }
         else
         {
-            flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+            flags |= NAUTILUS_OPEN_FLAG_NEW_WINDOW;
         }
     }
 
     if (parameters->slot != NULL &&
         (!parameters->user_confirmation ||
          confirm_multiple_windows (parameters->parent_window, count,
-                                   (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0)))
+                                   (flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0)))
     {
-        if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0 &&
+        if ((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)
         {
@@ -2171,12 +2171,12 @@ activation_start_mountables (ActivateParameters *parameters)
  *
  **/
 void
-nautilus_mime_activate_files (GtkWindow               *parent_window,
-                              NautilusWindowSlot      *slot,
-                              GList                   *files,
-                              const char              *launch_directory,
-                              NautilusWindowOpenFlags  flags,
-                              gboolean                 user_confirmation)
+nautilus_mime_activate_files (GtkWindow          *parent_window,
+                              NautilusWindowSlot *slot,
+                              GList              *files,
+                              const char         *launch_directory,
+                              NautilusOpenFlags   flags,
+                              gboolean            user_confirmation)
 {
     ActivateParameters *parameters;
     char *file_name;
@@ -2268,11 +2268,11 @@ nautilus_mime_activate_files (GtkWindow               *parent_window,
  **/
 
 void
-nautilus_mime_activate_file (GtkWindow               *parent_window,
-                             NautilusWindowSlot      *slot,
-                             NautilusFile            *file,
-                             const char              *launch_directory,
-                             NautilusWindowOpenFlags  flags)
+nautilus_mime_activate_file (GtkWindow          *parent_window,
+                             NautilusWindowSlot *slot,
+                             NautilusFile       *file,
+                             const char         *launch_directory,
+                             NautilusOpenFlags   flags)
 {
     GList *files;
 
diff --git a/src/nautilus-mime-actions.h b/src/nautilus-mime-actions.h
index 9765894cb..24b891b3b 100644
--- a/src/nautilus-mime-actions.h
+++ b/src/nautilus-mime-actions.h
@@ -39,16 +39,16 @@ gboolean               nautilus_mime_file_extracts                        (Nauti
 gboolean               nautilus_mime_file_opens_in_external_app           (NautilusFile            *file);
 gboolean               nautilus_mime_file_launches                        (NautilusFile            *file);
 void                   nautilus_mime_activate_files                       (GtkWindow               
*parent_window,
-                                                                          NautilusWindowSlot      *slot,
-                                                                          GList                   *files,
-                                                                          const char              
*launch_directory,
-                                                                          NautilusWindowOpenFlags  flags,
-                                                                          gboolean                 
user_confirmation);
+                                                                          NautilusWindowSlot *slot,
+                                                                          GList              *files,
+                                                                          const char         
*launch_directory,
+                                                                          NautilusOpenFlags   flags,
+                                                                          gboolean            
user_confirmation);
 void                   nautilus_mime_activate_file                        (GtkWindow               
*parent_window,
-                                                                          NautilusWindowSlot      *slot_info,
-                                                                          NautilusFile            *file,
-                                                                          const char              
*launch_directory,
-                                                                          NautilusWindowOpenFlags  flags);
+                                                                          NautilusWindowSlot *slot_info,
+                                                                          NautilusFile       *file,
+                                                                          const char         
*launch_directory,
+                                                                          NautilusOpenFlags   flags);
 gint                   nautilus_mime_types_get_number_of_groups           (void);
 const gchar*           nautilus_mime_types_group_get_name                 (gint                     
group_index);
 GPtrArray*             nautilus_mime_types_group_get_mimetypes            (gint                     
group_index);
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index a167ce02c..2e4372b06 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -66,7 +66,7 @@ open_location_cb (NautilusPlacesView *view,
                   GFile              *location,
                   GtkPlacesOpenFlags  open_flags)
 {
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     GtkWidget *slot;
 
     slot = gtk_widget_get_ancestor (GTK_WIDGET (view), NAUTILUS_TYPE_WINDOW_SLOT);
@@ -75,14 +75,14 @@ open_location_cb (NautilusPlacesView *view,
     {
         case GTK_PLACES_OPEN_NEW_TAB:
         {
-            flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
-                    NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+            flags = NAUTILUS_OPEN_FLAG_NEW_TAB |
+                    NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
         }
         break;
 
         case GTK_PLACES_OPEN_NEW_WINDOW:
         {
-            flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+            flags = NAUTILUS_OPEN_FLAG_NEW_WINDOW;
         }
         break;
 
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 6af9e20aa..8f5bd3383 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -94,7 +94,7 @@ switch_location (NautilusDragSlotProxyInfo *drag_info)
 
     location = nautilus_file_get_location (drag_info->target_file);
     nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
-                                             location, NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE,
+                                             location, NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE,
                                              NULL, NAUTILUS_WINDOW (window), NULL);
     g_object_unref (location);
 }
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 52389641d..bde3337dc 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1178,10 +1178,10 @@ static void load_new_location (NautilusWindowSlot *slot,
                                gboolean            tell_new_content_view);
 
 void
-nautilus_window_slot_open_location_full (NautilusWindowSlot      *self,
-                                         GFile                   *location,
-                                         NautilusWindowOpenFlags  flags,
-                                         GList                   *new_selection)
+nautilus_window_slot_open_location_full (NautilusWindowSlot *self,
+                                         GFile              *location,
+                                         NautilusOpenFlags   flags,
+                                         GList              *new_selection)
 {
     GFile *old_location;
     g_autolist (NautilusFile) old_selection = NULL;
@@ -1468,8 +1468,8 @@ viewed_file_changed_callback (NautilusFile       *file,
 }
 
 static void
-nautilus_window_slot_go_home (NautilusWindowSlot      *self,
-                              NautilusWindowOpenFlags  flags)
+nautilus_window_slot_go_home (NautilusWindowSlot *self,
+                              NautilusOpenFlags   flags)
 {
     GFile *home;
 
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index 0a6f1a1d0..3746e8fcd 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -52,10 +52,10 @@ NautilusWindow * nautilus_window_slot_get_window           (NautilusWindowSlot *
 void             nautilus_window_slot_set_window           (NautilusWindowSlot *slot,
                                                            NautilusWindow     *window);
 
-void nautilus_window_slot_open_location_full              (NautilusWindowSlot      *slot,
-                                                           GFile                   *location,
-                                                           NautilusWindowOpenFlags  flags,
-                                                           GList                   *new_selection);
+void nautilus_window_slot_open_location_full               (NautilusWindowSlot *slot,
+                                                            GFile              *location,
+                                                            NautilusOpenFlags   flags,
+                                                            GList              *new_selection);
 
 GFile * nautilus_window_slot_get_location                 (NautilusWindowSlot *slot);
 GFile * nautilus_window_slot_get_pending_location          (NautilusWindowSlot *slot);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c26f6f2ff..57595ba13 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -507,8 +507,8 @@ disconnect_slot (NautilusWindow     *window,
 }
 
 static NautilusWindowSlot *
-nautilus_window_create_and_init_slot (NautilusWindow          *window,
-                                      NautilusWindowOpenFlags  flags)
+nautilus_window_create_and_init_slot (NautilusWindow    *window,
+                                      NautilusOpenFlags  flags)
 {
     NautilusWindowSlot *slot;
 
@@ -519,9 +519,9 @@ nautilus_window_create_and_init_slot (NautilusWindow          *window,
 }
 
 void
-nautilus_window_initialize_slot (NautilusWindow          *window,
-                                 NautilusWindowSlot      *slot,
-                                 NautilusWindowOpenFlags  flags)
+nautilus_window_initialize_slot (NautilusWindow     *window,
+                                 NautilusWindowSlot *slot,
+                                 NautilusOpenFlags   flags)
 {
     g_assert (NAUTILUS_IS_WINDOW (window));
     g_assert (NAUTILUS_IS_WINDOW_SLOT (slot));
@@ -533,7 +533,7 @@ nautilus_window_initialize_slot (NautilusWindow          *window,
                                      window);
     nautilus_notebook_add_tab (NAUTILUS_NOTEBOOK (window->notebook),
                                slot,
-                               (flags & NAUTILUS_WINDOW_OPEN_SLOT_APPEND) != 0 ?
+                               (flags & NAUTILUS_OPEN_FLAG_SLOT_APPEND) != 0 ?
                                -1 :
                                gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook)) + 1,
                                FALSE);
@@ -546,24 +546,24 @@ nautilus_window_initialize_slot (NautilusWindow          *window,
 }
 
 void
-nautilus_window_open_location_full (NautilusWindow          *window,
-                                    GFile                   *location,
-                                    NautilusWindowOpenFlags  flags,
-                                    GList                   *selection,
-                                    NautilusWindowSlot      *target_slot)
+nautilus_window_open_location_full (NautilusWindow     *window,
+                                    GFile              *location,
+                                    NautilusOpenFlags   flags,
+                                    GList              *selection,
+                                    NautilusWindowSlot *target_slot)
 {
     NautilusWindowSlot *active_slot;
     gboolean new_tab_at_end;
 
     /* Assert that we are not managing new windows */
-    g_assert (!(flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW));
+    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_WINDOW_OPEN_FLAG_NEW_TAB) != 0)
+    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_WINDOW_OPEN_SLOT_APPEND;
+            flags |= NAUTILUS_OPEN_FLAG_SLOT_APPEND;
         }
     }
 
@@ -573,14 +573,14 @@ nautilus_window_open_location_full (NautilusWindow          *window,
         target_slot = active_slot;
     }
 
-    if (target_slot == NULL || (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0)
+    if (target_slot == NULL || (flags & NAUTILUS_OPEN_FLAG_NEW_TAB) != 0)
     {
         target_slot = nautilus_window_create_and_init_slot (window, flags);
     }
 
     /* Make the opened location the one active if we weren't ask for the
      * oposite, since it's the most usual use case */
-    if (!(flags & NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE))
+    if (!(flags & NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE))
     {
         gtk_window_present (GTK_WINDOW (window));
         nautilus_window_set_active_slot (window, target_slot);
@@ -716,7 +716,7 @@ nautilus_window_new_tab (NautilusWindow *window)
         }
 
         nautilus_window_open_location_full (window, location,
-                                            NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
+                                            NAUTILUS_OPEN_FLAG_NEW_TAB,
                                             NULL, NULL);
         g_object_unref (location);
     }
@@ -860,21 +860,21 @@ open_location_cb (NautilusWindow     *window,
                   GFile              *location,
                   GtkPlacesOpenFlags  open_flags)
 {
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     NautilusApplication *application;
 
     switch (open_flags)
     {
         case GTK_PLACES_OPEN_NEW_TAB:
         {
-            flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
-                    NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+            flags = NAUTILUS_OPEN_FLAG_NEW_TAB |
+                    NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
         }
         break;
 
         case GTK_PLACES_OPEN_NEW_WINDOW:
         {
-            flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
+            flags = NAUTILUS_OPEN_FLAG_NEW_WINDOW;
         }
         break;
 
@@ -1145,7 +1145,7 @@ action_restore_tab (GSimpleAction *action,
                     gpointer       user_data)
 {
     NautilusWindow *window = NAUTILUS_WINDOW (user_data);
-    NautilusWindowOpenFlags flags;
+    NautilusOpenFlags flags;
     g_autoptr (GFile) location = NULL;
     NautilusWindowSlot *slot;
     NautilusNavigationState *data;
@@ -1155,7 +1155,7 @@ action_restore_tab (GSimpleAction *action,
         return;
     }
 
-    flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB | NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
+    flags = NAUTILUS_OPEN_FLAG_NEW_TAB | NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
 
     data = g_queue_pop_head (window->tab_data_queue);
 
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index 5b9bf9133..6341d865f 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -60,11 +60,11 @@ typedef void (* NautilusWindowHandleExported) (NautilusWindow *window,
 NautilusWindow * nautilus_window_new                  (GdkScreen         *screen);
 void             nautilus_window_close                (NautilusWindow    *window);
 
-void nautilus_window_open_location_full               (NautilusWindow          *window,
-                                                       GFile                   *location,
-                                                       NautilusWindowOpenFlags  flags,
-                                                       GList                   *selection,
-                                                       NautilusWindowSlot      *target_slot);
+void nautilus_window_open_location_full               (NautilusWindow     *window,
+                                                       GFile              *location,
+                                                       NautilusOpenFlags   flags,
+                                                       GList              *selection,
+                                                       NautilusWindowSlot *target_slot);
 
 void             nautilus_window_new_tab              (NautilusWindow    *window);
 NautilusWindowSlot * nautilus_window_get_active_slot       (NautilusWindow *window);
@@ -105,9 +105,9 @@ void nautilus_window_end_dnd (NautilusWindow *window,
 void nautilus_window_search (NautilusWindow *window,
                              NautilusQuery  *query);
 
-void nautilus_window_initialize_slot (NautilusWindow          *window,
-                                      NautilusWindowSlot      *slot,
-                                      NautilusWindowOpenFlags  flags);
+void nautilus_window_initialize_slot (NautilusWindow     *window,
+                                      NautilusWindowSlot *slot,
+                                      NautilusOpenFlags   flags);
 
 gboolean nautilus_window_export_handle (NautilusWindow *window,
                                         NautilusWindowHandleExported callback,


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