[Xfce4-commits] <parole:master> Added command line -n to disable plugins loading.

Ali Abdallah noreply at xfce.org
Thu Nov 12 16:24:02 CET 2009


Updating branch refs/heads/master
         to 26a1d454264eff1cf214a30108971eaacdb75dd4 (commit)
       from b387812cd58ecae81a35f99f23a3c0939a177ece (commit)

commit 26a1d454264eff1cf214a30108971eaacdb75dd4
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Thu Nov 12 16:21:37 2009 +0100

    Added command line -n to disable plugins loading.

 parole/main.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/parole/main.c b/parole/main.c
index be22829..01343cd 100644
--- a/parole/main.c
+++ b/parole/main.c
@@ -177,11 +177,13 @@ int main (int argc, char **argv)
     gboolean raise_volume = FALSE;
     gboolean lower_volume = FALSE;
     gboolean mute = FALSE;
+    gboolean load_plugins = TRUE;
     gchar    *client_id = NULL;
     
     GOptionEntry option_entries[] = 
     {
 	{ "new-instance", 'i', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &new_instance, N_("Open a new instance"), NULL },
+	{ "no-plugins", 'n', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &load_plugins, N_("Do not load plugins"), NULL },
 	{ "play", 'p', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &play, N_("Play or pause if already playing"), NULL },
 	{ "stop", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &stop, N_("Stop playing"), NULL },
 	{ "next-track", 'N', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &next_track, N_("Next track"), NULL },
@@ -306,15 +308,19 @@ int main (int argc, char **argv)
 	    g_error_free (error);
 	}
 
-	plugins = parole_plugins_manager_new ();
-	parole_plugins_manager_load_plugins (plugins);
+	if ( load_plugins )
+	{
+	    plugins = parole_plugins_manager_new ();
+	    parole_plugins_manager_load_plugins (plugins);
+	}
 	g_object_unref (builder);
 	
 	gdk_notify_startup_complete ();
 	gtk_main ();
 	
 	parole_dbus_release_name (PAROLE_DBUS_NAME);
-	g_object_unref (plugins);
+	if ( load_plugins)
+	    g_object_unref (plugins);
 	g_object_unref (session);
     }
 



More information about the Xfce4-commits mailing list