summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcaja-extension/Makefile.am2
-rw-r--r--src/file-manager/fm-widget-view.c23
2 files changed, 21 insertions, 4 deletions
diff --git a/libcaja-extension/Makefile.am b/libcaja-extension/Makefile.am
index ef5cc10e..540afbc1 100644
--- a/libcaja-extension/Makefile.am
+++ b/libcaja-extension/Makefile.am
@@ -26,6 +26,7 @@ libcaja_extension_include_HEADERS = \
caja-column-provider.h \
caja-column.h \
caja-extension-types.h \
+ caja-widget-view-provider.h \
caja-file-info.h \
caja-info-provider.h \
caja-location-widget-provider.h \
@@ -40,6 +41,7 @@ libcaja_extension_include_HEADERS = \
libcaja_extension_la_SOURCES = \
caja-column-provider.c \
caja-column.c \
+ caja-widget-view-provider.c \
caja-extension-i18n.h \
caja-extension-types.c \
caja-extension-private.h \
diff --git a/src/file-manager/fm-widget-view.c b/src/file-manager/fm-widget-view.c
index 9d2aeff1..c22643a8 100644
--- a/src/file-manager/fm-widget-view.c
+++ b/src/file-manager/fm-widget-view.c
@@ -32,6 +32,9 @@
#include <libcaja-private/caja-file-utilities.h>
#include <libcaja-private/caja-view.h>
#include <libcaja-private/caja-view-factory.h>
+#include <libcaja-private/caja-extensions.h>
+#include <libcaja-private/caja-module.h>
+#include <libcaja-extension/caja-widget-view-provider.h>
#include "fm-widget-view.h"
@@ -344,13 +347,14 @@ fm_widget_view_iface_init (CajaViewIface *iface)
static void
fm_widget_view_init (FMWidgetView *widget_view)
{
+ GtkWindow *window;
+ window = fm_directory_view_get_containing_window (FM_DIRECTORY_VIEW(widget_view));
}
static CajaView *
fm_widget_view_create (CajaWindowSlotInfo *slot)
{
FMWidgetView *view;
-
g_assert (CAJA_IS_WINDOW_SLOT_INFO (slot));
view = g_object_new (FM_TYPE_WIDGET_VIEW,
@@ -365,11 +369,22 @@ fm_widget_view_supports_uri (const char *uri,
GFileType file_type,
const char *mime_type)
{
- if (g_str_has_prefix (uri, "computer://"))
+ GList *providers, *l;
+ gboolean result = FALSE;
+
+ providers = caja_extensions_get_for_type (CAJA_TYPE_WIDGET_VIEW_PROVIDER);
+
+ for (l = providers; l != NULL; l = l->next)
{
- return TRUE;
+ CajaWidgetViewProvider *provider;
+
+ provider = CAJA_WIDGET_VIEW_PROVIDER (l->data);
+ if (caja_widget_view_supports_uri (provider, uri, file_type, mime_type)) {
+ result = TRUE;
+ }
}
- return FALSE;
+ caja_module_extension_list_free (providers);
+ return result;
}
static CajaViewInfo fm_widget_view =