[nautilus/wip/csoriano/desktop-split: 37/53] file: allow overriding invalidate_attributes_internal



commit ab3a2f2de999469e04137fcee1b43860a4b74dbf
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Mar 30 15:02:12 2016 +0200

    file: allow overriding invalidate_attributes_internal
    
    We are special casing some cases where we want to do something different
    in subclasses.
    
    Allow to override this function so subclasses can use it.

 libnautilus-private/nautilus-file.c |   12 ++++++++++--
 libnautilus-private/nautilus-file.h |    3 +++
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 4a413ca..0c7410c 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -7424,8 +7424,15 @@ nautilus_file_invalidate_extension_info_internal (NautilusFile *file)
 }
 
 void
-nautilus_file_invalidate_attributes_internal (NautilusFile *file,
-                                             NautilusFileAttributes file_attributes)
+nautilus_file_invalidate_attributes_internal (NautilusFile           *file,
+                                              NautilusFileAttributes  file_attributes)
+{
+        NAUTILUS_FILE_CLASS (G_OBJECT_GET_CLASS (file))->invalidate_attributes_internal (file, 
file_attributes);
+}
+
+static void
+real_invalidate_attributes_internal (NautilusFile           *file,
+                                     NautilusFileAttributes  file_attributes)
 {
        Request request;
 
@@ -8006,6 +8013,7 @@ nautilus_file_class_init (NautilusFileClass *class)
        class->rename = real_rename;
        class->get_target_uri = real_get_target_uri;
        class->drag_can_accept_files = real_drag_can_accept_files;
+       class->invalidate_attributes_internal = real_invalidate_attributes_internal;
 
        signals[CHANGED] =
                g_signal_new ("changed",
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index 77b4fe1..a6e265b 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -601,6 +601,9 @@ typedef struct {
        char*                 (* get_target_uri)          (NautilusFile                   *file);
 
        gboolean              (* drag_can_accept_files)   (NautilusFile                   *drop_target_item);
+
+       void                  (* invalidate_attributes_internal) (NautilusFile            *file,
+                                                                 NautilusFileAttributes   file_attributes);
 } NautilusFileClass;
 
 #endif /* NAUTILUS_FILE_H */


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