nautilus r13984 - in trunk: . libnautilus-private



Author: alexl
Date: Wed Mar 26 15:50:01 2008
New Revision: 13984
URL: http://svn.gnome.org/viewvc/nautilus?rev=13984&view=rev

Log:
2008-03-26  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-monitor.c:
        (nautilus_monitor_directory):
	Avoid constantly trying to create directory monitors
	if it fails once by returning an "empty"
	NautilusMonitor instead of NULL.



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-monitor.c

Modified: trunk/libnautilus-private/nautilus-monitor.c
==============================================================================
--- trunk/libnautilus-private/nautilus-monitor.c	(original)
+++ trunk/libnautilus-private/nautilus-monitor.c	Wed Mar 26 15:50:01 2008
@@ -126,15 +126,14 @@
 
 	dir_monitor = g_file_monitor_directory (location, G_FILE_MONITOR_WATCH_MOUNTS, NULL, NULL);
 
-	if (dir_monitor == NULL) {
-		return NULL;
-	}
-
 	ret = g_new0 (NautilusMonitor, 1);
 	ret->monitor = dir_monitor;
 
-	g_signal_connect (ret->monitor, "changed", (GCallback)dir_changed, ret);
+	if (ret->monitor) {
+		g_signal_connect (ret->monitor, "changed", (GCallback)dir_changed, ret);
+	}
 
+	/* We return a monitor even on failure, so we can avoid later trying again */
 	return ret;
 }
 



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