+
+/* Load those plugins we always want to use. No error output; just
+ * try. */
+void plugin_load_standard_plugins (void)
+{
+ static const char *names[] = {
+#ifdef G_OS_WIN32
+ "pgpmime",
+ "pgpinline",
+#endif
+ NULL
+ };
+ int i;
+ gchar *error, *filename;
+
+ for (i=0; names[i]; i++) {
+ /* Simple hack to check whether the plugin has already
+ * been loaded but checking only for the basename. */
+ GSList *cur = plugins;
+ for(; cur; cur = cur->next) {
+ Plugin *p = (Plugin *)cur->data;
+ if (strstr(p->filename, names[i]))
+ break;
+ }
+ if (!cur) { /* Not yet loaded. */
+ /* FIXME: get_plugin_dir () returns with a trailing
+ * (back)slash; this should be fixed so that we can use
+ * g_module_build_path here. */
+ filename = g_strconcat (get_plugin_dir(),
+ names[i], NULL);
+ error = NULL;
+ plugin_load(filename, &error);
+ g_free (error);
+ g_free(filename);
+ }
+ }
+}
+
+