Kaydet (Commit) 4a5c07a1 authored tarafından Nick Treleaven's avatar Nick Treleaven

Remove TEMPLATES_GET_FILENAME() macro.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5694 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 8e6ed990
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:
......
......@@ -61,12 +61,6 @@ static void templates_replace_command(GString *text, const gchar *file_name,
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 gchar *read_file(const gchar *locale_fname)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment