[nautilus: 4/10] tree-sidebar: don't implement NautilusSidebar/Provider anymore
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus: 4/10] tree-sidebar: don't implement NautilusSidebar/Provider anymore
- Date: Fri, 3 Dec 2010 18:26:19 +0000 (UTC)
commit 1fe934a9955579103b72cd86c5ba83b9c7b4966a
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Dec 3 19:03:43 2010 +0100
tree-sidebar: don't implement NautilusSidebar/Provider anymore
src/file-manager/fm-tree-view.c | 82 ++-------------------------------------
src/file-manager/fm-tree-view.h | 5 ++-
2 files changed, 8 insertions(+), 79 deletions(-)
---
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index acc99a8..55ec26f 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -49,7 +49,6 @@
#include <libnautilus-private/nautilus-icon-names.h>
#include <libnautilus-private/nautilus-program-choosing.h>
#include <libnautilus-private/nautilus-tree-view-drag-dest.h>
-#include <libnautilus-private/nautilus-sidebar-provider.h>
#include <libnautilus-private/nautilus-module.h>
#include <libnautilus-private/nautilus-window-info.h>
#include <libnautilus-private/nautilus-window-slot-info.h>
@@ -112,24 +111,15 @@ typedef struct {
static GdkAtom copied_files_atom;
-static void fm_tree_view_iface_init (NautilusSidebarIface *iface);
-static void sidebar_provider_iface_init (NautilusSidebarProviderIface *iface);
static void fm_tree_view_activate_file (FMTreeView *view,
NautilusFile *file,
NautilusWindowOpenFlags flags);
-static GType fm_tree_view_provider_get_type (void);
static void create_popup_menu (FMTreeView *view);
-G_DEFINE_TYPE_WITH_CODE (FMTreeView, fm_tree_view, GTK_TYPE_SCROLLED_WINDOW,
- G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_SIDEBAR,
- fm_tree_view_iface_init));
+G_DEFINE_TYPE (FMTreeView, fm_tree_view, GTK_TYPE_SCROLLED_WINDOW)
#define parent_class fm_tree_view_parent_class
-G_DEFINE_TYPE_WITH_CODE (FMTreeViewProvider, fm_tree_view_provider, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_SIDEBAR_PROVIDER,
- sidebar_provider_iface_init));
-
static void
notify_clipboard_info (NautilusClipboardMonitor *monitor,
NautilusClipboardInfo *info,
@@ -1587,38 +1577,6 @@ fm_tree_view_class_init (FMTreeViewClass *class)
copied_files_atom = gdk_atom_intern ("x-special/gnome-copied-files", FALSE);
}
-
-static const char *
-fm_tree_view_get_sidebar_id (NautilusSidebar *sidebar)
-{
- return TREE_SIDEBAR_ID;
-}
-
-static char *
-fm_tree_view_get_tab_label (NautilusSidebar *sidebar)
-{
- return g_strdup (_("Tree"));
-}
-
-static char *
-fm_tree_view_get_tab_tooltip (NautilusSidebar *sidebar)
-{
- return g_strdup (_("Show Tree"));
-}
-
-static GdkPixbuf *
-fm_tree_view_get_tab_icon (NautilusSidebar *sidebar)
-{
- return NULL;
-}
-
-static void
-fm_tree_view_is_visible_changed (NautilusSidebar *sidebar,
- gboolean is_visible)
-{
- /* Do nothing */
-}
-
static void
hidden_files_mode_changed_callback (NautilusWindowInfo *window,
FMTreeView *view)
@@ -1627,16 +1585,6 @@ hidden_files_mode_changed_callback (NautilusWindowInfo *window,
}
static void
-fm_tree_view_iface_init (NautilusSidebarIface *iface)
-{
- iface->get_sidebar_id = fm_tree_view_get_sidebar_id;
- iface->get_tab_label = fm_tree_view_get_tab_label;
- iface->get_tab_tooltip = fm_tree_view_get_tab_tooltip;
- iface->get_tab_icon = fm_tree_view_get_tab_icon;
- iface->is_visible_changed = fm_tree_view_is_visible_changed;
-}
-
-static void
fm_tree_view_set_parent_window (FMTreeView *sidebar,
NautilusWindowInfo *window)
{
@@ -1658,9 +1606,8 @@ fm_tree_view_set_parent_window (FMTreeView *sidebar,
}
-static NautilusSidebar *
-fm_tree_view_create (NautilusSidebarProvider *provider,
- NautilusWindowInfo *window)
+GtkWidget *
+nautilus_tree_sidebar_new (NautilusWindowInfo *window)
{
FMTreeView *sidebar;
@@ -1668,27 +1615,6 @@ fm_tree_view_create (NautilusSidebarProvider *provider,
fm_tree_view_set_parent_window (sidebar, window);
g_object_ref_sink (sidebar);
- return NAUTILUS_SIDEBAR (sidebar);
+ return GTK_WIDGET (sidebar);
}
-static void
-sidebar_provider_iface_init (NautilusSidebarProviderIface *iface)
-{
- iface->create = fm_tree_view_create;
-}
-
-static void
-fm_tree_view_provider_init (FMTreeViewProvider *sidebar)
-{
-}
-
-static void
-fm_tree_view_provider_class_init (FMTreeViewProviderClass *class)
-{
-}
-
-void
-fm_tree_view_register (void)
-{
- nautilus_module_add_type (fm_tree_view_provider_get_type ());
-}
diff --git a/src/file-manager/fm-tree-view.h b/src/file-manager/fm-tree-view.h
index 9211d0f..69e67e1 100644
--- a/src/file-manager/fm-tree-view.h
+++ b/src/file-manager/fm-tree-view.h
@@ -31,6 +31,8 @@
#include <gtk/gtk.h>
+#include <libnautilus-private/nautilus-window-info.h>
+
#define FM_TYPE_TREE_VIEW fm_tree_view_get_type()
#define FM_TREE_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_TREE_VIEW, FMTreeView))
@@ -58,6 +60,7 @@ typedef struct {
} FMTreeViewClass;
GType fm_tree_view_get_type (void);
-void fm_tree_view_register (void);
+
+GtkWidget *nautilus_tree_sidebar_new (NautilusWindowInfo *window);
#endif /* FM_TREE_VIEW_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]