libnautilus-extension: Drop widget provider

We don't want extensions to inject random inconsistent widgets
into our window.

If there are good reasons for this, in the future we can introduce a
new model-like API instead of a widget-based one.
This commit is contained in:
António Fernandes 2022-08-06 17:19:40 +01:00
parent bc55ff7599
commit b625533fa4
5 changed files with 0 additions and 168 deletions

View file

@ -5,7 +5,6 @@ libnautilus_extension_headers = [
'nautilus-column.h',
'nautilus-file-info.h',
'nautilus-info-provider.h',
'nautilus-location-widget-provider.h',
'nautilus-menu-provider.h',
'nautilus-properties-model-provider.h',
'nautilus-properties-model.h',
@ -40,7 +39,6 @@ libnautilus_extension_sources = [
'nautilus-extension-private.h',
'nautilus-file-info.c',
'nautilus-info-provider.c',
'nautilus-location-widget-provider.c',
'nautilus-menu-item.c',
'nautilus-menu-provider.c',
'nautilus-properties-model-provider.c',

View file

@ -23,7 +23,6 @@
#include <libnautilus-extension/nautilus-extension-enum-types.h>
#include <libnautilus-extension/nautilus-file-info.h>
#include <libnautilus-extension/nautilus-info-provider.h>
#include <libnautilus-extension/nautilus-location-widget-provider.h>
#include <libnautilus-extension/nautilus-menu.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-extension/nautilus-properties-model.h>

View file

@ -1,48 +0,0 @@
/*
* nautilus-location-widget-provider.c - Interface for Nautilus
* extensions that provide extra widgets for a location
*
* Copyright (C) 2005 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*
*/
#include "nautilus-location-widget-provider.h"
G_DEFINE_INTERFACE (NautilusLocationWidgetProvider, nautilus_location_widget_provider,
G_TYPE_OBJECT)
static void
nautilus_location_widget_provider_default_init (NautilusLocationWidgetProviderInterface *klass)
{
}
GtkWidget *
nautilus_location_widget_provider_get_widget (NautilusLocationWidgetProvider *self,
const char *uri,
GtkWidget *window)
{
NautilusLocationWidgetProviderInterface *iface;
g_return_val_if_fail (NAUTILUS_IS_LOCATION_WIDGET_PROVIDER (self), NULL);
iface = NAUTILUS_LOCATION_WIDGET_PROVIDER_GET_IFACE (self);
g_return_val_if_fail (iface->get_widget != NULL, NULL);
return iface->get_widget (self, uri, window);
}

View file

@ -1,86 +0,0 @@
/*
* nautilus-info-provider.h - Interface for Nautilus extensions that
* provide info about files.
*
* Copyright (C) 2003 Novell, Inc.
* Copyright (C) 2005 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Dave Camp <dave@ximian.com>
* Alexander Larsson <alexl@redhat.com>
*
*/
/* This interface is implemented by Nautilus extensions that want to
* provide extra location widgets for a particular location.
* Extensions are called when Nautilus displays a location.
*/
#pragma once
#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION)
#warning "Only <nautilus-extension.h> should be included directly."
#endif
#include <glib-object.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define NAUTILUS_TYPE_LOCATION_WIDGET_PROVIDER (nautilus_location_widget_provider_get_type ())
G_DECLARE_INTERFACE (NautilusLocationWidgetProvider, nautilus_location_widget_provider,
NAUTILUS, LOCATION_WIDGET_PROVIDER,
GObject)
/**
* SECTION:nautilus-location-widget-provider
* @title: NautilusLocationWidgetProvider
* @short_description: Interface to provide additional location widgets
*
* #NautilusLocationWidgetProvider allows extension to provide additional location
* widgets in the file manager views.
*/
/**
* NautilusLocationWidgetProviderInterface:
* @g_iface: The parent interface.
* @get_widget: Returns a #GtkWidget.
* See nautilus_location_widget_provider_get_widget() for details.
*
* Interface for extensions to provide additional location widgets.
*/
struct _NautilusLocationWidgetProviderInterface
{
GTypeInterface g_iface;
GtkWidget *(*get_widget) (NautilusLocationWidgetProvider *provider,
const char *uri,
GtkWidget *window);
};
/**
* nautilus_location_widget_provider_get_widget:
* @provider: a #NautilusLocationWidgetProvider
* @uri: the URI of the location
* @window: parent #GtkWindow
*
* Returns: (transfer none) (nullable): the location widget for @provider at @uri
*/
GtkWidget *nautilus_location_widget_provider_get_widget (NautilusLocationWidgetProvider *provider,
const char *uri,
GtkWidget *window);
G_END_DECLS

View file

@ -45,7 +45,6 @@
#include "nautilus-module.h"
#include "nautilus-monitor.h"
#include "nautilus-profile.h"
#include <nautilus-extension.h>
#include "nautilus-ui-utilities.h"
#include <eel/eel-vfs-extensions.h>
@ -2592,34 +2591,6 @@ nautilus_window_slot_show_special_location_bar (NautilusWindowSlot *self,
nautilus_window_slot_add_extra_location_widget (self, bar);
}
static void
slot_add_extension_extra_widgets (NautilusWindowSlot *self)
{
GList *providers, *l;
GtkWidget *widget;
char *uri;
NautilusWindow *window;
providers = nautilus_module_get_extensions_for_type (NAUTILUS_TYPE_LOCATION_WIDGET_PROVIDER);
window = nautilus_window_slot_get_window (self);
uri = nautilus_window_slot_get_location_uri (self);
for (l = providers; l != NULL; l = l->next)
{
NautilusLocationWidgetProvider *provider;
provider = NAUTILUS_LOCATION_WIDGET_PROVIDER (l->data);
widget = nautilus_location_widget_provider_get_widget (provider, uri, GTK_WIDGET (window));
if (widget != NULL)
{
nautilus_window_slot_add_extra_location_widget (self, widget);
}
}
g_free (uri);
nautilus_module_extension_list_free (providers);
}
static void
nautilus_window_slot_update_for_new_location (NautilusWindowSlot *self)
{
@ -2789,8 +2760,6 @@ nautilus_window_slot_setup_extra_location_widgets (NautilusWindowSlot *self)
data);
nautilus_directory_unref (directory);
slot_add_extension_extra_widgets (self);
}
static void