SF.net SVN: geany: [2568] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri May 9 17:14:37 UTC 2008


Revision: 2568
          http://geany.svn.sourceforge.net/geany/?rev=2568&view=rev
Author:   ntrel
Date:     2008-05-09 10:14:35 -0700 (Fri, 09 May 2008)

Log Message:
-----------
Add source_only argument for filetypes_find_source() and rename.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/filetypes.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-05-09 17:07:20 UTC (rev 2567)
+++ trunk/ChangeLog	2008-05-09 17:14:35 UTC (rev 2568)
@@ -20,6 +20,8 @@
    Update api_version for new line breaking struct fields.
  * src/filetypes.c:
    Set filetype::id automatically in filetype_add().
+ * src/filetypes.c:
+   Add source_only argument for filetypes_find_source() and rename.
 
 
 2008-05-08  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c	2008-05-09 17:07:20 UTC (rev 2567)
+++ trunk/src/filetypes.c	2008-05-09 17:14:35 UTC (rev 2568)
@@ -504,9 +504,9 @@
 
 typedef gboolean FileTypesPredicate(filetype *ft, gpointer user_data);
 
-/* Find a filetype that predicate returns TRUE for, otherwise return NULL.
- * Only search source file filetypes. */
-static filetype *filetypes_find_source(FileTypesPredicate predicate, gpointer user_data)
+/* Find a filetype that predicate returns TRUE for, otherwise return NULL. */
+static filetype *filetypes_find(gboolean source_only,
+		FileTypesPredicate predicate, gpointer user_data)
 {
 	guint i;
 
@@ -514,7 +514,7 @@
 	{
 		filetype *ft = filetypes[i];
 
-		if (i == GEANY_FILETYPES_NONE)
+		if (source_only && i == GEANY_FILETYPES_NONE)
 			continue;	/* None is not for source files */
 
 		if (predicate(ft, user_data))
@@ -560,7 +560,7 @@
 	setptr(base_filename, g_utf8_strdown(base_filename, -1));
 #endif
 
-	ft = filetypes_find_source(match_basename, base_filename);
+	ft = filetypes_find(TRUE, match_basename, base_filename);
 	if (ft == NULL)
 		ft = filetypes[GEANY_FILETYPES_NONE];
 


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