From 06eaa4df064c18169012713fccd1d14a09d6c07a Mon Sep 17 00:00:00 2001
From: Alexander Schwinn <alexxcons@xfce.org>
Date: Sun, 21 Jun 2020 22:49:08 +0200
Subject: [PATCH] Remove obsolete dispose method to prevent warning (Issue
 #319) Fixes #319

---
 thunar/thunar-history.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/thunar/thunar-history.c b/thunar/thunar-history.c
index 50f1bee1d..f4c83d006 100644
--- a/thunar/thunar-history.c
+++ b/thunar/thunar-history.c
@@ -50,7 +50,6 @@ enum
 
 
 static void            thunar_history_navigator_init         (ThunarNavigatorIface *iface);
-static void            thunar_history_dispose                (GObject              *object);
 static void            thunar_history_finalize               (GObject              *object);
 static void            thunar_history_get_property           (GObject              *object,
                                                               guint                 prop_id,
@@ -102,7 +101,6 @@ thunar_history_class_init (ThunarHistoryClass *klass)
   GObjectClass *gobject_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->dispose = thunar_history_dispose;
   gobject_class->finalize = thunar_history_finalize;
   gobject_class->get_property = thunar_history_get_property;
   gobject_class->set_property = thunar_history_set_property;
@@ -148,19 +146,6 @@ thunar_history_init (ThunarHistory *history)
 
 
 
-static void
-thunar_history_dispose (GObject *object)
-{
-  ThunarHistory *history = THUNAR_HISTORY (object);
-
-  /* disconnect from the current directory */
-  thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (history), NULL);
-
-  (*G_OBJECT_CLASS (thunar_history_parent_class)->dispose) (object);
-}
-
-
-
 static void
 thunar_history_finalize (GObject *object)
 {
@@ -290,8 +275,11 @@ thunar_history_set_current_directory (ThunarNavigator *navigator,
     }
 
   /* notify listeners */
-  g_object_notify (G_OBJECT (history), "current-directory");
-  g_signal_emit (G_OBJECT (history), history_signals[HISTORY_CHANGED], 0, history);
+  if (current_directory != NULL)
+    {
+      g_object_notify (G_OBJECT (history), "current-directory");
+      g_signal_emit (G_OBJECT (history), history_signals[HISTORY_CHANGED], 0, history);
+    }
 }
 
 
-- 
GitLab