[Xfce4-commits] r29815 - in thunar/branches/migration-to-gio: . thunar

Jannis Pohlmann jannis at xfce.org
Wed Apr 15 00:32:29 CEST 2009


Author: jannis
Date: 2009-04-14 22:32:29 +0000 (Tue, 14 Apr 2009)
New Revision: 29815

Modified:
   thunar/branches/migration-to-gio/ChangeLog
   thunar/branches/migration-to-gio/thunar/thunar-preferences.c
   thunar/branches/migration-to-gio/thunar/thunar-sendto-model.c
   thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c
Log:
	* thunar/thunar-preferences.c, thunar/thunar-sendto-model.c,
	  thunar/thunar-shortcuts-model.c: Check whether the created file
	  monitor is != NULL before connecting to its "changed" signal.

Modified: thunar/branches/migration-to-gio/ChangeLog
===================================================================
--- thunar/branches/migration-to-gio/ChangeLog	2009-04-14 22:25:39 UTC (rev 29814)
+++ thunar/branches/migration-to-gio/ChangeLog	2009-04-14 22:32:29 UTC (rev 29815)
@@ -1,5 +1,11 @@
 2009-04-15	Jannis Pohlmann <jannis at xfce.org>
 
+	* thunar/thunar-preferences.c, thunar/thunar-sendto-model.c,
+	  thunar/thunar-shortcuts-model.c: Check whether the created file
+	  monitor is != NULL before connecting to its "changed" signal.
+
+2009-04-15	Jannis Pohlmann <jannis at xfce.org>
+
 	* thunar/thunar-gio-extensions.c: Add new functions
 	  g_file_new_for_desktop() and g_file_is_desktop().
 	* thunar/thunar-shortcuts-model.c: Monitor ~/.gtk-bookmarks using

Modified: thunar/branches/migration-to-gio/thunar/thunar-preferences.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-preferences.c	2009-04-14 22:25:39 UTC (rev 29814)
+++ thunar/branches/migration-to-gio/thunar/thunar-preferences.c	2009-04-14 22:32:29 UTC (rev 29815)
@@ -772,7 +772,8 @@
           /* monitor this file */
           file = g_file_new_for_path (filename);
           preferences->monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL);
-          g_signal_connect (preferences->monitor, "changed", G_CALLBACK (thunar_preferences_monitor), preferences);
+          if (G_LIKELY (preferences->monitor != NULL))
+            g_signal_connect (preferences->monitor, "changed", G_CALLBACK (thunar_preferences_monitor), preferences);
           g_object_unref (file);
 
           /* release the filename */

Modified: thunar/branches/migration-to-gio/thunar/thunar-sendto-model.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-sendto-model.c	2009-04-14 22:25:39 UTC (rev 29814)
+++ thunar/branches/migration-to-gio/thunar/thunar-sendto-model.c	2009-04-14 22:32:29 UTC (rev 29815)
@@ -287,8 +287,11 @@
 
           /* watch the directory for changes */
           monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
-          g_signal_connect (monitor, "changed", G_CALLBACK (thunar_sendto_model_event), sendto_model);
-          sendto_model->monitors = g_list_prepend (sendto_model->monitors, monitor);
+          if (G_LIKELY (monitor != NULL))
+            {
+              g_signal_connect (monitor, "changed", G_CALLBACK (thunar_sendto_model_event), sendto_model);
+              sendto_model->monitors = g_list_prepend (sendto_model->monitors, monitor);
+            }
 
           g_object_unref (file);
           g_free (dir);

Modified: thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c	2009-04-14 22:25:39 UTC (rev 29814)
+++ thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c	2009-04-14 22:32:29 UTC (rev 29815)
@@ -1,6 +1,7 @@
 /* $Id$ */
 /*-
  * Copyright (c) 2005-2006 Benedikt Meurer <benny at xfce.org>
+ * Copyright (c) 2009 Jannis Pohlmann <jannis at xfce.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -393,7 +394,7 @@
 
   /* register with the alteration monitor for the bookmarks file */
   model->monitor = g_file_monitor_file (bookmarks, G_FILE_MONITOR_NONE, NULL, NULL);
-  if (model->monitor != NULL)
+  if (G_LIKELY (model->monitor != NULL))
     g_signal_connect (model->monitor, "changed", G_CALLBACK (thunar_shortcuts_model_monitor), model);
 
   /* read the Gtk+ bookmarks file */




More information about the Xfce4-commits mailing list