summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-07-19 21:37:30 +0800
committerraveit65 <[email protected]>2022-07-20 21:40:42 +0200
commit89b26e091b4a1a46c1c238820af116a97b98b178 (patch)
tree281575ca86174b54ac026eb65211699d0023403d /src
parent4d5a705583db002ea95687a2c35464f77eb8206f (diff)
downloadcaja-89b26e091b4a1a46c1c238820af116a97b98b178.tar.bz2
caja-89b26e091b4a1a46c1c238820af116a97b98b178.tar.xz
add new extension for widget view
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-widget-view.c23
1 files changed, 19 insertions, 4 deletions
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 =