SF.net SVN: geany:[5595] trunk/src/keyfile.c
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Mar 17 12:08:07 UTC 2011
Revision: 5595
http://geany.svn.sourceforge.net/geany/?rev=5595&view=rev
Author: ntrel
Date: 2011-03-17 12:08:06 +0000 (Thu, 17 Mar 2011)
Log Message:
-----------
Use utils_build_path() for simplicity where the result is only used immediately (it returns a temporary buffer).
Modified Paths:
--------------
trunk/src/keyfile.c
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2011-03-15 22:42:09 UTC (rev 5594)
+++ trunk/src/keyfile.c 2011-03-17 12:08:06 UTC (rev 5595)
@@ -924,7 +924,7 @@
*/
void configuration_reload_default_session(void)
{
- gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
+ const gchar *configfile = utils_build_path(app->configdir, "geany.conf", NULL);
GKeyFile *config = g_key_file_new();
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
@@ -932,22 +932,20 @@
configuration_load_session_files(config, FALSE);
g_key_file_free(config);
- g_free(configfile);
}
gboolean configuration_load(void)
{
- gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
+ const gchar *configfile = utils_build_path(app->configdir, "geany.conf", NULL);
GKeyFile *config = g_key_file_new();
if (! g_file_test(configfile, G_FILE_TEST_IS_REGULAR))
{ /* config file does not (yet) exist, so try to load a global config file which may be */
/* created by distributors */
geany_debug("No user config file found, trying to use global configuration.");
- setptr(configfile, g_strconcat(app->datadir, G_DIR_SEPARATOR_S "geany.conf", NULL));
+ configfile = utils_build_path(app->datadir, "geany.conf", NULL);
}
-
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
load_dialog_prefs(config);
@@ -959,7 +957,6 @@
g_signal_emit_by_name(geany_object, "load-settings", config);
g_key_file_free(config);
- g_free(configfile);
return TRUE;
}
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