From 9af921f26038b2b8ea8ed2a370192e7bb4413ca3 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 13 Jul 2016 00:49:53 +0100 Subject: Remove redundant plugin dir function --- src/plugins/plugins.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/plugins') 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); -- cgit 1.4.1-2-gfad0 ype='search' size='10' name='q' value=''/>
path: root/Makefile
blob: 7e2c62dacc1b22b6db3619e21bd5055778b49596 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150