[nautilus] view-factory: remove supports_uri()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] view-factory: remove supports_uri()
- Date: Mon, 8 Apr 2013 23:09:46 +0000 (UTC)
commit cb2713d18f3a7e9ab5811fb92e47d7b5182745de
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Apr 8 18:30:54 2013 -0400
view-factory: remove supports_uri()
There's really no use for this in the current Nautilus, and we're
getting rid of nautilus-view-factory.
src/nautilus-canvas-view.c | 24 +------------------
src/nautilus-desktop-canvas-view.c | 15 +-----------
src/nautilus-empty-view.c | 24 +------------------
src/nautilus-list-view.c | 24 +------------------
src/nautilus-view-factory.c | 44 ------------------------------------
src/nautilus-view-factory.h | 14 -----------
src/nautilus-window-slot.c | 9 -------
7 files changed, 4 insertions(+), 150 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 5ffc9ec..61ee1c2 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -2270,27 +2270,6 @@ nautilus_canvas_view_create (NautilusWindowSlot *slot)
return NAUTILUS_VIEW (view);
}
-static gboolean
-nautilus_canvas_view_supports_uri (const char *uri,
- GFileType file_type,
- const char *mime_type)
-{
- if (file_type == G_FILE_TYPE_DIRECTORY) {
- return TRUE;
- }
- if (strcmp (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0){
- return TRUE;
- }
- if (g_str_has_prefix (uri, "trash:")) {
- return TRUE;
- }
- if (g_str_has_prefix (uri, EEL_SEARCH_URI)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
#define TRANSLATE_VIEW_INFO(view_info) \
view_info.view_combo_label = _(view_info.view_combo_label); \
view_info.view_menu_label_with_mnemonic = _(view_info.view_menu_label_with_mnemonic); \
@@ -2309,8 +2288,7 @@ static NautilusViewInfo nautilus_canvas_view = {
N_("The icon view encountered an error."),
N_("The icon view encountered an error while starting up."),
N_("Display this location with the icon view."),
- nautilus_canvas_view_create,
- nautilus_canvas_view_supports_uri
+ nautilus_canvas_view_create
};
void
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index d17341e..5652db8 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -759,18 +759,6 @@ nautilus_desktop_canvas_view_create (NautilusWindowSlot *slot)
return NAUTILUS_VIEW (view);
}
-static gboolean
-nautilus_desktop_canvas_view_supports_uri (const char *uri,
- GFileType file_type,
- const char *mime_type)
-{
- if (g_str_has_prefix (uri, EEL_DESKTOP_URI)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
static NautilusViewInfo nautilus_desktop_canvas_view = {
NAUTILUS_DESKTOP_CANVAS_VIEW_ID,
"Desktop View",
@@ -778,8 +766,7 @@ static NautilusViewInfo nautilus_desktop_canvas_view = {
N_("The desktop view encountered an error."),
N_("The desktop view encountered an error while starting up."),
"Display this location with the desktop view.",
- nautilus_desktop_canvas_view_create,
- nautilus_desktop_canvas_view_supports_uri
+ nautilus_desktop_canvas_view_create
};
void
diff --git a/src/nautilus-empty-view.c b/src/nautilus-empty-view.c
index 5820038..a9208b7 100644
--- a/src/nautilus-empty-view.c
+++ b/src/nautilus-empty-view.c
@@ -313,27 +313,6 @@ nautilus_empty_view_create (NautilusWindowSlot *slot)
return NAUTILUS_VIEW (view);
}
-static gboolean
-nautilus_empty_view_supports_uri (const char *uri,
- GFileType file_type,
- const char *mime_type)
-{
- if (file_type == G_FILE_TYPE_DIRECTORY) {
- return TRUE;
- }
- if (strcmp (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0){
- return TRUE;
- }
- if (g_str_has_prefix (uri, "trash:")) {
- return TRUE;
- }
- if (g_str_has_prefix (uri, EEL_SEARCH_URI)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
static NautilusViewInfo nautilus_empty_view = {
NAUTILUS_EMPTY_VIEW_ID,
"Empty",
@@ -341,8 +320,7 @@ static NautilusViewInfo nautilus_empty_view = {
"_Empty View",
"The empty view encountered an error.",
"Display this location with the empty view.",
- nautilus_empty_view_create,
- nautilus_empty_view_supports_uri
+ nautilus_empty_view_create
};
void
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 989c40a..b0b5517 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -3297,27 +3297,6 @@ nautilus_list_view_create (NautilusWindowSlot *slot)
return NAUTILUS_VIEW (view);
}
-static gboolean
-nautilus_list_view_supports_uri (const char *uri,
- GFileType file_type,
- const char *mime_type)
-{
- if (file_type == G_FILE_TYPE_DIRECTORY) {
- return TRUE;
- }
- if (strcmp (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0){
- return TRUE;
- }
- if (g_str_has_prefix (uri, "trash:")) {
- return TRUE;
- }
- if (g_str_has_prefix (uri, EEL_SEARCH_URI)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
static NautilusViewInfo nautilus_list_view = {
NAUTILUS_LIST_VIEW_ID,
/* translators: this is used in the view selection dropdown
@@ -3328,8 +3307,7 @@ static NautilusViewInfo nautilus_list_view = {
N_("The list view encountered an error."),
N_("The list view encountered an error while starting up."),
N_("Display this location with the list view."),
- nautilus_list_view_create,
- nautilus_list_view_supports_uri
+ nautilus_list_view_create
};
void
diff --git a/src/nautilus-view-factory.c b/src/nautilus-view-factory.c
index dfaaa1f..f9f94e1 100644
--- a/src/nautilus-view-factory.c
+++ b/src/nautilus-view-factory.c
@@ -75,47 +75,3 @@ nautilus_view_factory_create (const char *id,
}
return view;
}
-
-gboolean
-nautilus_view_factory_view_supports_uri (const char *id,
- GFile *location,
- GFileType file_type,
- const char *mime_type)
-{
- const NautilusViewInfo *view_info;
- char *uri;
- gboolean res;
-
- view_info = nautilus_view_factory_lookup (id);
- if (view_info == NULL) {
- return FALSE;
- }
- uri = g_file_get_uri (location);
- res = view_info->supports_uri (uri, file_type, mime_type);
- g_free (uri);
- return res;
-
-}
-
-GList *
-nautilus_view_factory_get_views_for_uri (const char *uri,
- GFileType file_type,
- const char *mime_type)
-{
- GList *l, *res;
- const NautilusViewInfo *view_info;
-
- res = NULL;
-
- for (l = registered_views; l != NULL; l = l->next) {
- view_info = l->data;
-
- if (view_info->supports_uri (uri, file_type, mime_type)) {
- res = g_list_prepend (res, g_strdup (view_info->id));
- }
- }
-
- return g_list_reverse (res);
-}
-
-
diff --git a/src/nautilus-view-factory.h b/src/nautilus-view-factory.h
index 652da3b..68f9235 100644
--- a/src/nautilus-view-factory.h
+++ b/src/nautilus-view-factory.h
@@ -44,10 +44,6 @@ struct _NautilusViewInfo {
char *startup_error_label; /* The foo view encountered an error while starting up. */
char *display_location_label; /* Display this location with the foo view. */
NautilusView * (*create) (NautilusWindowSlot *slot);
- /* BONOBOTODO: More args here */
- gboolean (*supports_uri) (const char *uri,
- GFileType file_type,
- const char *mime_type);
};
@@ -55,16 +51,6 @@ void nautilus_view_factory_register (NautilusViewInf
const NautilusViewInfo *nautilus_view_factory_lookup (const char *id);
NautilusView * nautilus_view_factory_create (const char *id,
NautilusWindowSlot *slot);
-gboolean nautilus_view_factory_view_supports_uri (const char *id,
- GFile *location,
- GFileType file_type,
- const char *mime_type);
-GList * nautilus_view_factory_get_views_for_uri (const char *uri,
- GFileType file_type,
- const char *mime_type);
-
-
-
G_END_DECLS
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 6573c68..91e42ab 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1258,15 +1258,6 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
if (view_id == NULL) {
view_id = nautilus_global_preferences_get_default_folder_viewer_preference_as_iid ();
-
- if (view_id != NULL &&
- !nautilus_view_factory_view_supports_uri (view_id,
- location,
- nautilus_file_get_file_type (file),
- mimetype)) {
- g_free (view_id);
- view_id = NULL;
- }
}
g_free (mimetype);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]