SF.net SVN: geany:[5694] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Apr 5 15:47:31 UTC 2011


Revision: 5694
          http://geany.svn.sourceforge.net/geany/?rev=5694&view=rev
Author:   ntrel
Date:     2011-04-05 15:47:31 +0000 (Tue, 05 Apr 2011)

Log Message:
-----------
Remove TEMPLATES_GET_FILENAME() macro.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-04-04 18:06:09 UTC (rev 5693)
+++ trunk/ChangeLog	2011-04-05 15:47:31 UTC (rev 5694)
@@ -1,3 +1,9 @@
+2011-04-05  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/templates.c:
+   Remove TEMPLATES_GET_FILENAME() macro.
+
+
 2011-04-04  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * scintilla/gtk/ScintillaGTK.cxx:

Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c	2011-04-04 18:06:09 UTC (rev 5693)
+++ trunk/src/templates.c	2011-04-05 15:47:31 UTC (rev 5694)
@@ -61,12 +61,6 @@
 	const gchar *file_type, const gchar *func_name);
 
 
-/* some simple macros to reduce code size and make the code readable */
-#define TEMPLATES_GET_FILENAME(shortname) \
-	g_strconcat(app->configdir, \
-		G_DIR_SEPARATOR_S GEANY_TEMPLATES_SUBDIR G_DIR_SEPARATOR_S, shortname, NULL)
-
-
 static gchar *read_file(const gchar *locale_fname)
 {
 	gchar *contents;
@@ -97,12 +91,13 @@
 
 static void read_template(const gchar *name, gint id)
 {
-	gchar *fname = TEMPLATES_GET_FILENAME(name);
+	gchar *fname = g_build_path(G_DIR_SEPARATOR_S, app->configdir,
+		GEANY_TEMPLATES_SUBDIR, name, NULL);
 
 	/* try system if user template doesn't exist */
 	if (!g_file_test(fname, G_FILE_TEST_EXISTS))
-		setptr(fname, g_strconcat(app->datadir,
-			G_DIR_SEPARATOR_S GEANY_TEMPLATES_SUBDIR G_DIR_SEPARATOR_S, name, NULL));
+		setptr(fname, g_build_path(G_DIR_SEPARATOR_S, app->datadir,
+			GEANY_TEMPLATES_SUBDIR, name, NULL));
 
 	templates[id] = read_file(fname);
 	g_free(fname);


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