summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mate-settings-daemon/mate-settings-manager.c9
-rw-r--r--mate-settings-daemon/mate-settings-plugin-info.c114
2 files changed, 14 insertions, 109 deletions
diff --git a/mate-settings-daemon/mate-settings-manager.c b/mate-settings-daemon/mate-settings-manager.c
index 5f15fc2..0c2258d 100644
--- a/mate-settings-daemon/mate-settings-manager.c
+++ b/mate-settings-daemon/mate-settings-manager.c
@@ -353,15 +353,6 @@ mate_settings_manager_stop (MateSettingsManager *manager)
{
g_debug ("Stopping settings manager");
-#ifdef ENABLE_PYTHON
- /* Note: that this may cause finalization of objects by
- * running the garbage collector. Since some of the plugin may
- * have installed callbacks upon object finalization it must
- * run before we get rid of the plugins.
- */
- mate_settings_python_shutdown ();
-#endif
-
_unload_all (manager);
}
diff --git a/mate-settings-daemon/mate-settings-plugin-info.c b/mate-settings-daemon/mate-settings-plugin-info.c
index 17bc0d6..79373e6 100644
--- a/mate-settings-daemon/mate-settings-plugin-info.c
+++ b/mate-settings-daemon/mate-settings-plugin-info.c
@@ -39,19 +39,12 @@
#define PLUGIN_PRIORITY_MAX 1
#define PLUGIN_PRIORITY_DEFAULT 100
-typedef enum
-{
- MATE_SETTINGS_PLUGIN_LOADER_C,
- MATE_SETTINGS_PLUGIN_LOADER_PY
-} MateSettingsPluginLoader;
-
struct MateSettingsPluginInfoPrivate
{
char *file;
GSettings *settings;
char *location;
- MateSettingsPluginLoader loader;
GTypeModule *module;
char *name;
@@ -66,8 +59,7 @@ struct MateSettingsPluginInfoPrivate
int active : 1;
/* A plugin is unavailable if it is not possible to activate it
- due to an error loading the plugin module (e.g. for Python plugins
- when the interpreter has not been correctly initializated) */
+ due to an error loading the plugin module */
int available : 1;
guint enabled_notification_id;
@@ -213,20 +205,6 @@ mate_settings_plugin_info_fill_from_file (MateSettingsPluginInfo *info,
goto out;
}
- /* Get the loader for this plugin */
- str = g_key_file_get_string (plugin_file, PLUGIN_GROUP, "Loader", NULL);
- if (str != NULL && strcmp (str, "python") == 0) {
- info->priv->loader = MATE_SETTINGS_PLUGIN_LOADER_PY;
-#ifndef ENABLE_PYTHON
- g_warning ("Cannot load Python plugin '%s' since mate_settings was not "
- "compiled with Python support.", filename);
- goto out;
-#endif
- } else {
- info->priv->loader = MATE_SETTINGS_PLUGIN_LOADER_C;
- }
- g_free (str);
-
/* Get Name */
str = g_key_file_get_locale_string (plugin_file, PLUGIN_GROUP, "Name", NULL, NULL);
if (str != NULL) {
@@ -360,70 +338,20 @@ load_plugin_module (MateSettingsPluginInfo *info)
mate_settings_profile_start ("%s", info->priv->location);
- switch (info->priv->loader) {
- case MATE_SETTINGS_PLUGIN_LOADER_C:
- dirname = g_path_get_dirname (info->priv->file);
- g_return_val_if_fail (dirname != NULL, FALSE);
-
- path = g_module_build_path (dirname, info->priv->location);
- g_free (dirname);
- g_return_val_if_fail (path != NULL, FALSE);
-
- info->priv->module = G_TYPE_MODULE (mate_settings_module_new (path));
- g_free (path);
-
- break;
+ dirname = g_path_get_dirname (info->priv->file);
+ g_return_val_if_fail (dirname != NULL, FALSE);
-#ifdef ENABLE_PYTHON
- case MATE_SETTINGS_PLUGIN_LOADER_PY:
- {
- char *dir;
+ path = g_module_build_path (dirname, info->priv->location);
+ g_free (dirname);
+ g_return_val_if_fail (path != NULL, FALSE);
- if (!mate_settings_python_init ()) {
- /* Mark plugin as unavailable and fails */
- info->priv->available = FALSE;
-
- g_warning ("Cannot load Python plugin '%s' since mate_settings "
- "was not able to initialize the Python interpreter.",
- info->priv->name);
-
- goto out;
- }
-
- dir = g_path_get_dirname (info->priv->file);
-
- g_return_val_if_fail ((info->priv->location != NULL) &&
- (info->priv->location[0] != '\0'),
- FALSE);
-
- info->priv->module = G_TYPE_MODULE (
- mate_settings_python_module_new (dir, info->priv->location));
-
- g_free (dir);
- break;
- }
-#endif
- default:
- g_return_val_if_reached (FALSE);
- }
+ info->priv->module = G_TYPE_MODULE (mate_settings_module_new (path));
+ g_free (path);
if (!g_type_module_use (info->priv->module)) {
- switch (info->priv->loader) {
- case MATE_SETTINGS_PLUGIN_LOADER_C:
- g_warning ("Cannot load plugin '%s' since file '%s' cannot be read.",
- info->priv->name,
- mate_settings_module_get_path (MATE_SETTINGS_MODULE (info->priv->module)));
- break;
-
- case MATE_SETTINGS_PLUGIN_LOADER_PY:
- g_warning ("Cannot load Python plugin '%s' since file '%s' cannot be read.",
- info->priv->name,
- info->priv->location);
- break;
-
- default:
- g_return_val_if_reached (FALSE);
- }
+ g_warning ("Cannot load plugin '%s' since file '%s' cannot be read.",
+ info->priv->name,
+ mate_settings_module_get_path (MATE_SETTINGS_MODULE (info->priv->module)));
g_object_unref (G_OBJECT (info->priv->module));
info->priv->module = NULL;
@@ -434,26 +362,12 @@ load_plugin_module (MateSettingsPluginInfo *info)
goto out;
}
- switch (info->priv->loader) {
- case MATE_SETTINGS_PLUGIN_LOADER_C:
- info->priv->plugin =
- MATE_SETTINGS_PLUGIN (mate_settings_module_new_object (MATE_SETTINGS_MODULE (info->priv->module)));
- break;
-
-#ifdef ENABLE_PYTHON
- case MATE_SETTINGS_PLUGIN_LOADER_PY:
- info->priv->plugin =
- MATE_SETTINGS_PLUGIN (mate_settings_python_module_new_object (MATE_SETTINGS_PYTHON_MODULE (info->priv->module)));
- break;
-#endif
-
- default:
- g_return_val_if_reached (FALSE);
- }
+ info->priv->plugin =
+ MATE_SETTINGS_PLUGIN (mate_settings_module_new_object (MATE_SETTINGS_MODULE (info->priv->module)));
g_type_module_unuse (info->priv->module);
ret = TRUE;
- out:
+out:
mate_settings_profile_end ("%s", info->priv->location);
return ret;
}