[vinagre] Re-enabled command-line options provided by plugins



commit 6b6dec1679a31a1a605566083a61770955021a98
Author: Jonh Wendell <jwendell gnome org>
Date:   Thu Aug 26 14:31:58 2010 -0300

    Re-enabled command-line options provided by plugins

 vinagre/vinagre-main.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/vinagre/vinagre-main.c b/vinagre/vinagre-main.c
index cb012f0..aeb6a93 100644
--- a/vinagre/vinagre-main.c
+++ b/vinagre/vinagre-main.c
@@ -38,6 +38,7 @@
 #include "vinagre-ssh.h"
 #include "vinagre-options.h"
 #include "vinagre-protocol-ext.h"
+#include "vinagre-plugins-engine.h"
 
 #ifdef HAVE_TELEPATHY
 #include "vinagre-tubes-manager.h"
@@ -50,10 +51,11 @@
 int main (int argc, char **argv) {
   GOptionContext       *context;
   GError               *error = NULL;
-  GSList               *l, *plugins;
   GtkWindow            *window;
   GtkApplication       *app;
-//  VinagrePluginsEngine *engine;
+  GHashTable           *extensions;
+  GHashTableIter        iter;
+  VinagreProtocolExt   *extension;
 #ifdef HAVE_TELEPATHY
   VinagreTubesManager *vinagre_tubes_manager;
 #endif
@@ -73,8 +75,7 @@ int main (int argc, char **argv) {
 
   /* Init plugins engine */
   vinagre_debug_message (DEBUG_APP, "Init plugins");
-  //engine = vinagre_plugins_engine_get_default ();
-  //plugins = (GSList *) vinagre_plugins_engine_get_plugin_list (engine);
+  extensions = vinagre_plugins_engine_get_plugins_by_protocol (vinagre_plugins_engine_get_default ());
 
   /* Setup command line options */
   context = g_option_context_new (_("- Remote Desktop Viewer"));
@@ -85,21 +86,17 @@ int main (int argc, char **argv) {
   g_option_context_add_group (context, g_irepository_get_option_group ());
 #endif
 
-/*
-  for (l = plugins; l; l = l->next)
+  g_hash_table_iter_init (&iter, extensions);
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&extension))
     {
-      GSList            *groups, *l2;
-      VinagrePluginInfo *info = VINAGRE_PLUGIN_INFO (l->data);
-
-      if (!vinagre_plugin_info_is_active (info))
-	continue;
+      GSList *groups, *l;
 
-      groups = vinagre_plugin_get_context_groups (info->plugin);
-      for (l2 = groups; l2; l2 = l2->next)
-	g_option_context_add_group (context, (GOptionGroup *)l2->data);
+      groups = vinagre_protocol_ext_get_context_groups (extension);
+      for (l = groups; l; l = l->next)
+	g_option_context_add_group (context, (GOptionGroup *)l->data);
       g_slist_free (groups);
     }
-*/
+
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
   if (error)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]