Mercurial > pidgin.yaz
comparison src/plugin.c @ 5981:81564bb4db68
[gaim-migrate @ 6429]
Saving and loading the current plugin list should work once again.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Wed, 02 Jul 2003 06:00:22 +0000 |
| parents | 53782414bc3a |
| children | f9428d38c03b |
comparison
equal
deleted
inserted
replaced
| 5980:34341fd4f11e | 5981:81564bb4db68 |
|---|---|
| 128 return NULL; | 128 return NULL; |
| 129 } | 129 } |
| 130 | 130 |
| 131 #endif /* GAIM_PLUGINS */ | 131 #endif /* GAIM_PLUGINS */ |
| 132 | 132 |
| 133 static void | |
| 134 update_plugin_prefs(void) | |
| 135 { | |
| 136 GList *pl; | |
| 137 GList *files = NULL; | |
| 138 GaimPlugin *p; | |
| 139 | |
| 140 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) { | |
| 141 p = pl->data; | |
| 142 | |
| 143 if(p->info->type != GAIM_PLUGIN_PROTOCOL && | |
| 144 p->info->type != GAIM_PLUGIN_LOADER) { | |
| 145 files = g_list_append(files, p->path); | |
| 146 } | |
| 147 } | |
| 148 | |
| 149 gaim_prefs_set_string_list("/plugins/loaded", files); | |
| 150 g_list_free(files); | |
| 151 } | |
| 152 | |
| 153 static gint | 133 static gint |
| 154 compare_prpl(GaimPlugin *a, GaimPlugin *b) | 134 compare_prpl(GaimPlugin *a, GaimPlugin *b) |
| 155 { | 135 { |
| 156 /* neg if a before b, 0 if equal, pos if a after b */ | 136 /* neg if a before b, 0 if equal, pos if a after b */ |
| 157 return ((GAIM_IS_PROTOCOL_PLUGIN(a) | 137 return ((GAIM_IS_PROTOCOL_PLUGIN(a) |
| 297 if (loader_info->load != NULL) | 277 if (loader_info->load != NULL) |
| 298 loader_info->load(plugin); | 278 loader_info->load(plugin); |
| 299 } | 279 } |
| 300 | 280 |
| 301 loaded_plugins = g_list_append(loaded_plugins, plugin); | 281 loaded_plugins = g_list_append(loaded_plugins, plugin); |
| 302 update_plugin_prefs(); | |
| 303 | 282 |
| 304 plugin->loaded = TRUE; | 283 plugin->loaded = TRUE; |
| 305 | 284 |
| 306 /* TODO */ | 285 /* TODO */ |
| 307 if (load_cb != NULL) | 286 if (load_cb != NULL) |
| 319 { | 298 { |
| 320 #ifdef GAIM_PLUGINS | 299 #ifdef GAIM_PLUGINS |
| 321 g_return_val_if_fail(plugin != NULL, FALSE); | 300 g_return_val_if_fail(plugin != NULL, FALSE); |
| 322 | 301 |
| 323 loaded_plugins = g_list_remove(loaded_plugins, plugin); | 302 loaded_plugins = g_list_remove(loaded_plugins, plugin); |
| 324 update_plugin_prefs(); | |
| 325 | 303 |
| 326 g_return_val_if_fail(gaim_plugin_is_loaded(plugin), FALSE); | 304 g_return_val_if_fail(gaim_plugin_is_loaded(plugin), FALSE); |
| 327 | 305 |
| 328 gaim_debug(GAIM_DEBUG_INFO, "plugins", "Unloading plugin %s\n", | 306 gaim_debug(GAIM_DEBUG_INFO, "plugins", "Unloading plugin %s\n", |
| 329 plugin->info->name); | 307 plugin->info->name); |
