[Goodies-commits] r5497 - thunar-shares-plugin/trunk/thunar-plugin

Daniel Morales danielm at xfce.org
Wed Oct 1 17:34:47 CEST 2008


Author: danielm
Date: 2008-10-01 15:34:47 +0000 (Wed, 01 Oct 2008)
New Revision: 5497

Modified:
   thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c
Log:
Revert the menu provider (for now)

Modified: thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c
===================================================================
--- thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c	2008-10-01 13:56:43 UTC (rev 5496)
+++ thunar-shares-plugin/trunk/thunar-plugin/tsp-provider.c	2008-10-01 15:34:47 UTC (rev 5497)
@@ -38,7 +38,6 @@
 
 static void     tsp_provider_page_provider_init  (ThunarxPropertyPageProviderIface *iface);
 static void     tsp_provider_prefs_provider_init (ThunarxPreferencesProviderIface  *iface);
-static void     tsp_provider_menu_provider_init  (ThunarxMenuProviderIface         *iface);
 
 static GList   *tsp_provider_get_pages           (ThunarxPropertyPageProvider      *provider,
                                                   GList                            *files);
@@ -46,13 +45,6 @@
 static GList   *tsp_provider_get_actions         (ThunarxPreferencesProvider       *provider,
                                                   GtkWidget                        *window);
 
-static GList   *tsp_provider_get_file_actions    (ThunarxMenuProvider              *provider,
-                                                  GtkWidget                        *window,
-                                                  GList                            *files);
-
-static void     tsp_provider_unshare_activated   (GtkAction                        *action,
-                                                  GtkWindow                        *window);
-
 static void     tsp_provider_prefs_activated     (GtkWindow                        *window);
 
 struct _TspProviderClass
@@ -73,9 +65,7 @@
                                THUNARX_IMPLEMENT_INTERFACE (THUNARX_TYPE_PROPERTY_PAGE_PROVIDER,
                                                             tsp_provider_page_provider_init)
                                THUNARX_IMPLEMENT_INTERFACE (THUNARX_TYPE_PREFERENCES_PROVIDER,
-                                                            tsp_provider_prefs_provider_init)
-                               THUNARX_IMPLEMENT_INTERFACE (THUNARX_TYPE_MENU_PROVIDER,
-                                                            tsp_provider_menu_provider_init));
+                                                            tsp_provider_prefs_provider_init));
 
 static void
 tsp_provider_class_init (TspProviderClass *klass)
@@ -115,12 +105,6 @@
   iface->get_actions = tsp_provider_get_actions;
 }
 
-static void
-tsp_provider_menu_provider_init (ThunarxMenuProviderIface *iface)
-{
-  iface->get_file_actions = tsp_provider_get_file_actions;
-}
-
 static GList*
 tsp_provider_get_pages (ThunarxPropertyPageProvider *property_page_provider,
                         GList                       *files)
@@ -156,69 +140,7 @@
   return g_list_prepend (NULL, action);
 }
 
-static GList*
-tsp_provider_get_file_actions (ThunarxMenuProvider *provider,
-                               GtkWidget           *window,
-                               GList               *files)
-{
-  GtkAction *action;
-  gboolean   is_shared;
-  GClosure  *closure;
-  gchar     *folder_path;
-
-  if (g_list_length (files) != 1){
-    return NULL;
-  } else if (!libshares_is_shareable (THUNARX_FILE_INFO (files->data))){
-    return NULL;
-  }
-
-  folder_path = libshares_get_local_file (THUNARX_FILE_INFO (files->data));
-
-  if (G_LIKELY (folder_path == NULL)){
-    return NULL;
-  }
-
-  shares_get_path_is_shared (folder_path, &is_shared, NULL);
-
-  if (!is_shared)
-  {
-    g_free (folder_path);
-    return NULL;
-  }
-
-  action = gtk_action_new ("Tsp::thunar-shares-unshare",
-                           _("Unshare..."),
-                           _("Unshare the folder"),
-                           NULL);
-
-  g_object_set (G_OBJECT (action), "icon-name", "gnome-fs-share", NULL);
-  
-  g_object_set_qdata_full (G_OBJECT (action), tsp_action_folders_quark,
-                           g_strdup (folder_path), (GDestroyNotify) g_free);
-
-  closure = g_cclosure_new_object (G_CALLBACK (tsp_provider_unshare_activated), G_OBJECT (window));
-  g_signal_connect_closure (G_OBJECT (action), "activate", closure, TRUE);
-
-  g_free (folder_path);
-
-  return g_list_prepend (NULL, action);
-}
-
 static void
-tsp_provider_unshare_activated (GtkAction  *action,
-                                GtkWindow  *window)
-{
-  gchar *folder;
-
-  folder = g_object_get_qdata (G_OBJECT (action), tsp_action_folders_quark);
-
-  if (folder == NULL)
-    return;
-
-  libshares_shares_unshare (folder);
-}
-
-static void
 tsp_provider_prefs_activated (GtkWindow *window)
 {
   GtkWidget *dialog;




More information about the Goodies-commits mailing list