diff --git a/src/config/accounts.c b/src/config/accounts.c index 6549819b..c494564d 100644 --- a/src/config/accounts.c +++ b/src/config/accounts.c @@ -44,6 +44,7 @@ static gchar *string_keys[] = {"jid", "server", "resource", "presence.last", "pr static void _fix_legacy_accounts(const char * const account_name); static void _save_accounts(void); +static gchar * _get_accounts_file(void); void accounts_load(void) @@ -51,7 +52,7 @@ accounts_load(void) log_info("Loading accounts"); all_ac = autocomplete_new(); enabled_ac = autocomplete_new(); - accounts_loc = files_get_accounts_file(); + accounts_loc = _get_accounts_file(); accounts = g_key_file_new(); g_key_file_load_from_file(accounts, accounts_loc, G_KEY_FILE_KEEP_COMMENTS, @@ -530,3 +531,17 @@ _save_accounts(void) char *g_accounts_data = g_key_file_to_data(accounts, &g_data_size, NULL); g_file_set_contents(accounts_loc, g_accounts_data, g_data_size, NULL); } + +static gchar * +_get_accounts_file(void) +{ + gchar *xdg_data = xdg_get_data_home(); + GString *logfile = g_string_new(xdg_data); + g_string_append(logfile, "/profanity/accounts"); + gchar *result = strdup(logfile->str); + g_free(xdg_data); + g_string_free(logfile, TRUE); + + return result; +} + diff --git a/src/files.c b/src/files.c index 988baa36..671ba309 100644 --- a/src/files.c +++ b/src/files.c @@ -45,19 +45,6 @@ files_create_directories(void) _files_create_themes_directory(); } -gchar * -files_get_accounts_file(void) -{ - gchar *xdg_data = xdg_get_data_home(); - GString *logfile = g_string_new(xdg_data); - g_string_append(logfile, "/profanity/accounts"); - gchar *result = strdup(logfile->str); - g_free(xdg_data); - g_string_free(logfile, TRUE); - - return result; -} - gchar * files_get_themes_dir(void) { diff --git a/src/files.h b/src/files.h index fc33f208..735473aa 100644 --- a/src/files.h +++ b/src/files.h @@ -25,6 +25,5 @@ void files_create_directories(void); gchar* files_get_themes_dir(void); -gchar* files_get_accounts_file(void); #endif