about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-13 00:49:53 +0100
committerJames Booth <boothj5@gmail.com>2016-07-13 00:49:53 +0100
commit9af921f26038b2b8ea8ed2a370192e7bb4413ca3 (patch)
tree5e53b4400a0d45a4d1c7db88f348df24b4d7b126 /src
parent7abf5062612d15f457a9246b90393dab769437a6 (diff)
downloadprofani-tty-9af921f26038b2b8ea8ed2a370192e7bb4413ca3.tar.gz
Remove redundant plugin dir function
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugins.c20
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);
 
iv>
a0331a9b ^
b75d9d45 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48