[nautilus/wip/csoriano/destktop-split2: 5/60] application: allow overriding open_location_full



commit 7b4f4ad7a05afb3d8a675780d6d03657dc794572
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 3abd083..f73b2a7 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -335,6 +335,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;
@@ -1457,6 +1473,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 71f1d75..66c875d 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -34,6 +34,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]