diff options
author | James Booth <boothj5@gmail.com> | 2016-07-13 00:49:53 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-07-13 00:49:53 +0100 |
commit | 9af921f26038b2b8ea8ed2a370192e7bb4413ca3 (patch) | |
tree | 5e53b4400a0d45a4d1c7db88f348df24b4d7b126 /src | |
parent | 7abf5062612d15f457a9246b90393dab769437a6 (diff) | |
download | profani-tty-9af921f26038b2b8ea8ed2a370192e7bb4413ca3.tar.gz |
Remove redundant plugin dir function
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/plugins.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 5096bdee..23d90fd3 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -62,8 +62,6 @@ static GHashTable *plugins; -static gchar* _get_plugins_dir(void); - void plugins_init(void) { @@ -133,7 +131,7 @@ plugins_init(void) gboolean plugins_install(const char *const plugin_name, const char *const filename) { - char *plugins_dir = _get_plugins_dir(); + char *plugins_dir = plugins_get_dir(); GString *target_path = g_string_new(plugins_dir); free(plugins_dir); g_string_append(target_path, "/"); @@ -245,16 +243,6 @@ plugins_reload(const char *const name) return res; } -static gchar* -_get_plugins_dir(void) -{ - gchar *xdg_data = xdg_get_data_home(); - GString *plugins_dir = g_string_new(xdg_data); - g_free(xdg_data); - g_string_append(plugins_dir, "/profanity/plugins"); - return g_string_free(plugins_dir, FALSE); -} - void _plugins_unloaded_list_dir(const gchar *const dir, GSList **result) { @@ -278,7 +266,7 @@ GSList* plugins_unloaded_list(void) { GSList *result = NULL; - char *plugins_dir = _get_plugins_dir(); + char *plugins_dir = plugins_get_dir(); _plugins_unloaded_list_dir(plugins_dir, &result); free(plugins_dir); @@ -843,13 +831,13 @@ plugins_shutdown(void) disco_close(); } -gchar * +char* plugins_get_dir(void) { gchar *xdg_data = xdg_get_data_home(); GString *plugins_dir = g_string_new(xdg_data); g_string_append(plugins_dir, "/profanity/plugins"); - gchar *result = strdup(plugins_dir->str); + char *result = strdup(plugins_dir->str); g_free(xdg_data); g_string_free(plugins_dir, TRUE); |