Revision: 5349
http://geany.svn.sourceforge.net/geany/?rev=5349&view=rev
Author: ntrel
Date: 2010-11-01 15:18:32 +0000 (Mon, 01 Nov 2010)
Log Message:
-----------
Detect user and system filetype configuration files as Conf
filetype.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/filetypes.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-01 15:17:22 UTC (rev 5348)
+++ trunk/ChangeLog 2010-11-01 15:18:32 UTC (rev 5349)
@@ -3,6 +3,9 @@
* src/utils.c, src/main.c:
Remove trailing directory separator for app->datadir and
app->docdir for consistency with the other directory fields.
+ * src/filetypes.c:
+ Detect user and system filetype configuration files as Conf
+ filetype.
2010-11-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2010-11-01 15:17:22 UTC (rev 5348)
+++ trunk/src/filetypes.c 2010-11-01 15:18:32 UTC (rev 5349)
@@ -726,6 +726,33 @@
}
+static GeanyFiletype *check_builtin_filenames(const gchar *utf8_filename)
+{
+ gchar *lfn = NULL;
+ const gchar *path;
+ gboolean found = FALSE;
+
+#ifdef G_OS_WIN32
+ /* use lower case basename */
+ lfn = g_utf8_strdown(utf8_filename, -1);
+#else
+ lfn = g_strdup(utf8_filename);
+#endif
+ setptr(lfn, utils_get_locale_from_utf8(lfn));
+
+ path = utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.", NULL);
+ if (g_str_has_prefix(lfn, path))
+ found = TRUE;
+
+ path = utils_build_path(app->datadir, "filetypes.", NULL);
+ if (g_str_has_prefix(lfn, path))
+ found = TRUE;
+
+ g_free(lfn);
+ return found ? filetypes[GEANY_FILETYPES_CONF] : NULL;
+}
+
+
/* Detect filetype only based on the filename extension.
* utf8_filename can include the full path. */
GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename)
@@ -733,6 +760,10 @@
gchar *base_filename;
GeanyFiletype *ft;
+ ft = check_builtin_filenames(utf8_filename);
+ if (ft)
+ return ft;
+
/* to match against the basename of the file (because of Makefile*) */
base_filename = g_path_get_basename(utf8_filename);
#ifdef G_OS_WIN32
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5348
http://geany.svn.sourceforge.net/geany/?rev=5348&view=rev
Author: ntrel
Date: 2010-11-01 15:17:22 +0000 (Mon, 01 Nov 2010)
Log Message:
-----------
Remove trailing directory separator for app->datadir and
app->docdir for consistency with the other directory fields.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/main.c
trunk/src/utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-01 10:57:58 UTC (rev 5347)
+++ trunk/ChangeLog 2010-11-01 15:17:22 UTC (rev 5348)
@@ -1,6 +1,13 @@
+2010-11-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/utils.c, src/main.c:
+ Remove trailing directory separator for app->datadir and
+ app->docdir for consistency with the other directory fields.
+
+
2010-11-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
- * data/filetypes.ada:
+ * data/filetypes.ada:
Fix comments for Ada. Thanks to Jonas Baggett for reporting.
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2010-11-01 10:57:58 UTC (rev 5347)
+++ trunk/src/main.c 2010-11-01 15:17:22 UTC (rev 5348)
@@ -382,8 +382,8 @@
g_free(install_dir);
#else
- data_dir = g_strconcat(GEANY_DATADIR, "/geany/", NULL); /* e.g. /usr/share/geany */
- doc_dir = g_strconcat(GEANY_DOCDIR, "/html/", NULL);
+ data_dir = g_strconcat(GEANY_DATADIR, "/geany", NULL); /* e.g. /usr/share/geany */
+ doc_dir = g_strconcat(GEANY_DOCDIR, "/html", NULL);
#endif
/* convert path names to locale encoding */
@@ -587,12 +587,6 @@
}
-#ifdef G_OS_WIN32
-# define DIR_SEP "\\" /* on Windows we need an additional dir separator */
-#else
-# define DIR_SEP ""
-#endif
-
static gint create_config_dir(void)
{
gint saved_errno = 0;
@@ -666,7 +660,7 @@
gchar *text = g_strconcat(
"Copy files from ", app->datadir, " to this directory to overwrite "
"them. To use the defaults, just delete the file in this directory.\nFor more information read "
-"the documentation (in ", app->docdir, DIR_SEP "index.html or visit " GEANY_HOMEPAGE ").", NULL);
+"the documentation (in ", app->docdir, G_DIR_SEPARATOR_S "index.html or visit " GEANY_HOMEPAGE ").", NULL);
utils_write_file(filedefs_readme, text);
g_free(text);
}
@@ -687,7 +681,7 @@
{
gchar *text = g_strconcat(
"There are several template files in this directory. For these templates you can use wildcards.\n\
-For more information read the documentation (in ", app->docdir, DIR_SEP "index.html or visit " GEANY_HOMEPAGE ").",
+For more information read the documentation (in ", app->docdir, G_DIR_SEPARATOR_S "index.html or visit " GEANY_HOMEPAGE ").",
NULL);
utils_write_file(templates_readme, text);
g_free(text);
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2010-11-01 10:57:58 UTC (rev 5347)
+++ trunk/src/utils.c 2010-11-01 15:17:22 UTC (rev 5348)
@@ -1948,7 +1948,7 @@
g_strdelimit(uri, "\\", '/'); /* replace '\\' by '/' */
#else
skip = 7;
- uri = g_strconcat("file://", app->docdir, "index.html", NULL);
+ uri = g_strconcat("file://", app->docdir, "/index.html", NULL);
#endif
if (! g_file_test(uri + skip, G_FILE_TEST_IS_REGULAR))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5347
http://geany.svn.sourceforge.net/geany/?rev=5347&view=rev
Author: frlan
Date: 2010-11-01 10:57:58 +0000 (Mon, 01 Nov 2010)
Log Message:
-----------
Fix comments for Ada. Thanks to Jonas Baggett for reporting.
Modified Paths:
--------------
trunk/ChangeLog
trunk/data/filetypes.ada
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-01 09:56:15 UTC (rev 5346)
+++ trunk/ChangeLog 2010-11-01 10:57:58 UTC (rev 5347)
@@ -1,3 +1,9 @@
+2010-11-01 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+
+ * data/filetypes.ada:
+ Fix comments for Ada. Thanks to Jonas Baggett for reporting.
+
+
2010-10-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* Makefile.am:
Modified: trunk/data/filetypes.ada
===================================================================
--- trunk/data/filetypes.ada 2010-11-01 09:56:15 UTC (rev 5346)
+++ trunk/data/filetypes.ada 2010-11-01 10:57:58 UTC (rev 5347)
@@ -27,7 +27,7 @@
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
+comment_open=--
comment_close=
# set to false if a comment character/string should start at column 0 of a line, true uses any
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.