[nautilus] bookmark-list: Clean up code



commit ec4241a80b029d0bb13d3f95a963d5f7bd5acd1a
Author: Yi-Soo An <yisooan gmail com>
Date:   Sun Mar 17 20:31:14 2019 +0900

    bookmark-list: Clean up code
    
    Clean up do_finalize method to use NautilusBookmarkList object
    instead of casting to itself every lines.

 src/nautilus-bookmark-list.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index ad25b66d6..6a6162a0a 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -162,15 +162,17 @@ clear (NautilusBookmarkList *bookmarks)
 static void
 do_finalize (GObject *object)
 {
-    if (NAUTILUS_BOOKMARK_LIST (object)->monitor != NULL)
+    NautilusBookmarkList *self = NAUTILUS_BOOKMARK_LIST (object);
+
+    if (self->monitor != NULL)
     {
-        g_file_monitor_cancel (NAUTILUS_BOOKMARK_LIST (object)->monitor);
-        NAUTILUS_BOOKMARK_LIST (object)->monitor = NULL;
+        g_file_monitor_cancel (self->monitor);
+        self->monitor = NULL;
     }
 
-    g_queue_free (NAUTILUS_BOOKMARK_LIST (object)->pending_ops);
+    g_queue_free (self->pending_ops);
 
-    clear (NAUTILUS_BOOKMARK_LIST (object));
+    clear (self);
 
     G_OBJECT_CLASS (nautilus_bookmark_list_parent_class)->finalize (object);
 }


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