SF.net SVN: geany:[3934] trunk/src/document.c

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Jul 8 22:20:41 UTC 2009


Revision: 3934
          http://geany.svn.sourceforge.net/geany/?rev=3934&view=rev
Author:   eht16
Date:     2009-07-08 22:20:41 +0000 (Wed, 08 Jul 2009)

Log Message:
-----------
Simplify the USE_GIO_FILEMON preprocessor checks.

Modified Paths:
--------------
    trunk/src/document.c

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2009-07-08 22:20:17 UTC (rev 3933)
+++ trunk/src/document.c	2009-07-08 22:20:41 UTC (rev 3934)
@@ -48,10 +48,13 @@
 #include <glib/gstdio.h>
 
 /* uncomment to use GIO based file monitoring, though it is not completely stable yet */
-/* #define USE_GIO_FILEMON 1 */
-
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
-# include <gio/gio.h>
+/*#define USE_GIO_FILEMON 1*/
+#if USE_GIO_FILEMON
+# ifdef HAVE_GIO
+#  include <gio/gio.h>
+# else
+#  undef USE_GIO_FILEMON
+# endif
 #endif
 
 #include "document.h"
@@ -423,7 +426,7 @@
 }
 
 
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
+#if USE_GIO_FILEMON
 static void monitor_file_changed_cb(G_GNUC_UNUSED GFileMonitor *monitor, G_GNUC_UNUSED GFile *file,
 									G_GNUC_UNUSED GFile *other_file, GFileMonitorEvent event,
 									GeanyDocument *doc)
@@ -483,7 +486,7 @@
 	 * doesn't work at all for remote files and legacy polling is too slow. */
 	if (! doc->priv->is_remote)
 	{
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
+#if USE_GIO_FILEMON
 		gchar *locale_filename;
 
 		/* stop any previous monitoring */
@@ -719,7 +722,7 @@
 	sci_set_line_numbers(doc->editor->sci, editor_prefs.show_linenumber_margin, 0);
 	sci_goto_pos(doc->editor->sci, 0, TRUE);
 
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
+#if USE_GIO_FILEMON
 	monitor_file_setup(doc);
 #else
 	doc->priv->mtime = time(NULL);
@@ -1391,7 +1394,7 @@
 
 static gboolean document_update_timestamp(GeanyDocument *doc, const gchar *locale_filename)
 {
-#if ! defined(HAVE_GIO) || ! defined(USE_GIO_FILEMON)
+#if ! USE_GIO_FILEMON
 	struct stat st;
 
 	g_return_val_if_fail(doc != NULL, FALSE);
@@ -2694,7 +2697,7 @@
 {
 	static GdkColor red = {0, 0xFFFF, 0, 0};
 	static GdkColor green = {0, 0, 0x7FFF, 0};
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
+#if USE_GIO_FILEMON
 	static GdkColor orange = {0, 0xFFFF, 0x7FFF, 0};
 #endif
 	GdkColor *color = NULL;
@@ -2703,7 +2706,7 @@
 
 	if (doc->changed)
 		color = &red;
-#if defined(HAVE_GIO) && defined(USE_GIO_FILEMON)
+#if USE_GIO_FILEMON
 	else if (doc->priv->file_disk_status == FILE_CHANGED)
 		color = &orange;
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list