Mercurial > audlegacy
annotate src/audacious/discovery.c @ 3408:aea3349e2c62 trunk
oops, missed an untranslated string in last.fm GUI
author | mf0102 <0102@gmx.at> |
---|---|
date | Thu, 30 Aug 2007 17:41:40 +0200 |
parents | 2619f4c62abe |
children | 3092a8b3fe34 |
rev | line source |
---|---|
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
1 /* BMP - Cross-platform multimedia player |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
2 * Copyright (C) 2003-2004 BMP development team. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
3 * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
4 * Based on XMMS: |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
5 * Copyright (C) 1998-2003 XMMS development team. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
6 * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
8 * it under the terms of the GNU Discovery Public License as published by |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
9 * the Free Software Foundation; under version 3 of the License. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
10 * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
14 * GNU Discovery Public License for more details. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
15 * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU Discovery Public License |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
17 * along with this program. If not, see <http://www.gnu.org/licenses>. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
18 * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
19 * The Audacious team does not consider modular code linking to |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
20 * Audacious or using our public API to be a derived work. |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
21 */ |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
22 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
23 #include <glib.h> |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
24 #include <string.h> |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
25 #include "plugin.h" |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
26 #include "discovery.h" |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
27 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
28 DiscoveryPluginData dp_data = { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
29 NULL, |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
30 NULL |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
31 }; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
32 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
33 GList * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
34 get_discovery_list(void) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
35 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
36 return dp_data.discovery_list; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
37 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
38 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
39 GList * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
40 get_discovery_enabled_list(void) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
41 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
42 return dp_data.enabled_list; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
43 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
44 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
45 static DiscoveryPlugin * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
46 get_discovery_plugin(gint i) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
47 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
48 GList *node = g_list_nth(get_discovery_list(), i); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
49 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
50 if (!node) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
51 return NULL; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
52 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
53 return DISCOVERY_PLUGIN(node->data); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
54 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
55 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
56 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
57 void |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
58 discovery_about(gint i) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
59 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
60 DiscoveryPlugin *plugin = get_discovery_plugin(i); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
61 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
62 if (!plugin || !plugin->about) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
63 return; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
64 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
65 plugin->about(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
66 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
67 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
68 void |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
69 discovery_configure(gint i) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
70 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
71 DiscoveryPlugin *plugin = get_discovery_plugin(i); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
72 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
73 if (!plugin || !plugin->configure) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
74 return; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
75 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
76 plugin->configure(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
77 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
78 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
79 static gboolean |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
80 discovery_plugin_is_enabled(DiscoveryPlugin * plugin) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
81 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
82 return (g_list_find(get_discovery_enabled_list(), plugin) != NULL); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
83 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
84 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
85 void |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
86 enable_discovery_plugin(gint i, gboolean enable) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
87 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
88 DiscoveryPlugin *plugin = get_discovery_plugin(i); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
89 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
90 if (!plugin) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
91 return; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
92 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
93 if (enable && !discovery_plugin_is_enabled(plugin)) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
94 dp_data.enabled_list = g_list_append(dp_data.enabled_list, plugin); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
95 if (plugin->init) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
96 plugin->init(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
97 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
98 else if (!enable && discovery_plugin_is_enabled(plugin)) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
99 dp_data.enabled_list = g_list_remove(dp_data.enabled_list, plugin); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
100 if (plugin->cleanup) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
101 plugin->cleanup(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
102 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
103 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
104 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
105 gboolean |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
106 discovery_enabled(gint i) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
107 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
108 return (g_list_find(dp_data.enabled_list, |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
109 get_discovery_plugin(i)) != NULL); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
110 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
111 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
112 gchar * |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
113 discovery_stringify_enabled_list(void) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
114 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
115 GString *enable_str; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
116 gchar *name; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
117 GList *node = get_discovery_enabled_list(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
118 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
119 if (!node) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
120 return NULL; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
121 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
122 name = g_path_get_basename(DISCOVERY_PLUGIN(node->data)->filename); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
123 enable_str = g_string_new(name); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
124 g_free(name); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
125 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
126 for (node = g_list_next(node); node; node = g_list_next(node)) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
127 name = g_path_get_basename(DISCOVERY_PLUGIN(node->data)->filename); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
128 g_string_append_c(enable_str, ','); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
129 g_string_append(enable_str, name); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
130 g_free(name); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
131 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
132 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
133 return g_string_free(enable_str, FALSE); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
134 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
135 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
136 void |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
137 discovery_enable_from_stringified_list(const gchar * list_str) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
138 { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
139 gchar **list, **str; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
140 DiscoveryPlugin *plugin; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
141 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
142 if (!list_str || !strcmp(list_str, "")) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
143 return; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
144 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
145 list = g_strsplit(list_str, ",", 0); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
146 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
147 for (str = list; *str; str++) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
148 GList *node; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
149 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
150 for (node = get_discovery_list(); node; node = g_list_next(node)) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
151 gchar *base; |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
152 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
153 base = g_path_get_basename(DISCOVERY_PLUGIN(node->data)->filename); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
154 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
155 if (!strcmp(*str, base)) { |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
156 plugin = DISCOVERY_PLUGIN(node->data); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
157 dp_data.enabled_list = g_list_append(dp_data.enabled_list, |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
158 plugin); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
159 if (plugin->init) |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
160 plugin->init(); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
161 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
162 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
163 g_free(base); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
164 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
165 } |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
166 |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
167 g_strfreev(list); |
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff
changeset
|
168 } |