[nautilus/wip/csoriano/destktop-split2: 28/33] desktop-window-slot: override creation of views



commit 3e4bb6bf5993018b942f6a951dd31034c18be73c
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Mar 22 13:41:47 2016 +0100

    desktop-window-slot: override creation of views
    
    Now that we can create our own custom views in subclasses of the window
    slot, we can remove the special casing for subclasses in window slot and
    instead use inheritance for it.
    
    This commit move the creation of the desktop view to the desktop slot.

 src/nautilus-desktop-window-slot.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-desktop-window-slot.c b/src/nautilus-desktop-window-slot.c
index 5a2d4f1..728e850 100644
--- a/src/nautilus-desktop-window-slot.c
+++ b/src/nautilus-desktop-window-slot.c
@@ -17,6 +17,7 @@
  */
 
 #include "nautilus-desktop-window-slot.h"
+#include "nautilus-desktop-canvas-view.h"
 
 struct _NautilusDesktopWindowSlot
 {
@@ -25,6 +26,13 @@ struct _NautilusDesktopWindowSlot
 
 G_DEFINE_TYPE (NautilusDesktopWindowSlot, nautilus_desktop_window_slot, NAUTILUS_TYPE_WINDOW_SLOT)
 
+static NautilusView *
+real_get_view_for_location (NautilusWindowSlot *self,
+                            GFile              *location)
+{
+  return NAUTILUS_VIEW (nautilus_desktop_canvas_view_new (self));
+}
+
 NautilusDesktopWindowSlot *
 nautilus_desktop_window_slot_new (NautilusWindow *window)
 {
@@ -36,6 +44,9 @@ nautilus_desktop_window_slot_new (NautilusWindow *window)
 static void
 nautilus_desktop_window_slot_class_init (NautilusDesktopWindowSlotClass *klass)
 {
+  NautilusWindowSlotClass *parent_class = NAUTILUS_WINDOW_SLOT_CLASS (klass);
+
+  parent_class->get_view_for_location = real_get_view_for_location;
 }
 
 static void


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