[nautilus/wip/csoriano/destktop-split2: 12/33] application: allow overriding open_location_full



commit 675f89d4a14b73e01bb4ed6a434c1b9ea732afdc
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Mar 15 10:54:48 2016 +0100

    application: allow overriding open_location_full
    
    So it can work over inheritance. This will be needed for the desktop
    handling.

 src/nautilus-application.c |   18 ++++++++++++++++++
 src/nautilus-application.h |    7 +++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 24afe97..c0296e7 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -336,6 +336,22 @@ nautilus_application_open_location_full (NautilusApplication     *self,
                                          NautilusWindow          *target_window,
                                          NautilusWindowSlot      *target_slot)
 {
+        NAUTILUS_APPLICATION_CLASS (G_OBJECT_GET_CLASS (self))->open_location_full (self,
+                                                                                    location,
+                                                                                    flags,
+                                                                                    selection,
+                                                                                    target_window,
+                                                                                    target_slot);
+}
+
+static void
+real_open_location_full (NautilusApplication     *self,
+                         GFile                   *location,
+                         NautilusWindowOpenFlags  flags,
+                         GList                   *selection,
+                         NautilusWindow          *target_window,
+                         NautilusWindowSlot      *target_slot)
+{
         NautilusWindowSlot *active_slot;
         NautilusWindow *active_window;
         GFile *old_location;
@@ -1458,6 +1474,8 @@ nautilus_application_class_init (NautilusApplicationClass *class)
        application_class->command_line = nautilus_application_command_line;
        application_class->handle_local_options = nautilus_application_handle_local_options;
 
+       class->open_location_full = real_open_location_full;
+
        gtkapp_class = GTK_APPLICATION_CLASS (class);
        gtkapp_class->window_added = nautilus_application_window_added;
        gtkapp_class->window_removed = nautilus_application_window_removed;
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 0e50071..f6f8b8c 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -35,6 +35,13 @@ G_DECLARE_DERIVABLE_TYPE (NautilusApplication, nautilus_application, NAUTILUS, A
 
 struct _NautilusApplicationClass {
        GtkApplicationClass parent_class;
+
+        void  (*open_location_full) (NautilusApplication     *application,
+                                     GFile                   *location,
+                                     NautilusWindowOpenFlags  flags,
+                                     GList                   *selection,
+                                     NautilusWindow          *target_window,
+                                     NautilusWindowSlot      *target_slot);
 };
 
 NautilusApplication * nautilus_application_new (void);


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