comparison pidgin-twitter.c @ 5:6ac1867d7e8e

string list should be initialized with NULL
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 30 Apr 2008 17:02:47 +0900
parents 53ee194b5ff5
children ca8f95431962
comparison
equal deleted inserted replaced
4:9ac8cea32513 5:6ac1867d7e8e
91 { 91 {
92 GMatchInfo *match_info; 92 GMatchInfo *match_info;
93 GList *list, *lp; 93 GList *list, *lp;
94 94
95 list = purple_prefs_get_string_list(OPT_USERLIST); 95 list = purple_prefs_get_string_list(OPT_USERLIST);
96 g_return_if_fail(list != NULL);
96 97
97 g_regex_match (preg, *str, 0, &match_info); 98 g_regex_match (preg, *str, 0, &match_info);
98 while (g_match_info_matches (match_info)) 99 while (g_match_info_matches (match_info))
99 { 100 {
100 gchar *user = g_match_info_fetch (match_info, 0); 101 gchar *user = g_match_info_fetch (match_info, 0);
216 }; 217 };
217 218
218 static void 219 static void
219 init_plugin(PurplePlugin *plugin) 220 init_plugin(PurplePlugin *plugin)
220 { 221 {
221 GList *list;
222
223 g_type_init(); 222 g_type_init();
224 list = g_list_alloc();
225 223
226 /* add plugin preferences */ 224 /* add plugin preferences */
227 purple_prefs_add_none(OPT_PIDGINTWITTER); 225 purple_prefs_add_none(OPT_PIDGINTWITTER);
228 purple_prefs_add_bool(OPT_TRANSLATE, TRUE); 226 purple_prefs_add_bool(OPT_TRANSLATE, TRUE);
229 purple_prefs_add_bool(OPT_PLAYSOUND, TRUE); 227 purple_prefs_add_bool(OPT_PLAYSOUND, TRUE);
230 purple_prefs_add_string_list(OPT_USERLIST, list); 228 purple_prefs_add_string_list(OPT_USERLIST, NULL);
231 229
232 /* compile regex */ 230 /* compile regex */
233 preg = g_regex_new("@[A-Za-z0-9-_]+", 0, 0, NULL); 231 preg = g_regex_new("@[A-Za-z0-9_]+", 0, 0, NULL);
234
235 } 232 }
236 233
237 PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info) 234 PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info)