summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2012-07-15 00:17:06 +0100
committerBastien Nocera <hadess@hadess.net>2012-07-15 00:20:32 +0100
commit5ea6326b91cfc30835febe8f715fa33e96fa48a2 (patch)
tree7d307db510adc1cb55a75867606ebdd507dab8e1
parentf511986abe99d542abfbdfea6376443d93bb494a (diff)
downloadtotem-5ea6326b91cfc30835febe8f715fa33e96fa48a2.tar.gz
main: Remove recent functionality
As it's moved to the recent plugin.
-rw-r--r--src/totem-menu.c88
-rw-r--r--src/totem-menu.h4
-rw-r--r--src/totem-object.c11
3 files changed, 0 insertions, 103 deletions
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 1293ed289..31b3c598e 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -633,94 +633,6 @@ totem_setup_recent (Totem *totem)
totem_recent_manager_changed_callback (totem->recent_manager, totem);
}
-static void
-recent_info_cb (GFile *file,
- GAsyncResult *res,
- Totem *totem)
-{
- GtkRecentData data;
- char *groups[] = { NULL, NULL };
- GFileInfo *file_info;
- const char *uri, *display_name;
-
- memset (&data, 0, sizeof (data));
-
- file_info = g_file_query_info_finish (file, res, NULL);
- uri = g_object_get_data (G_OBJECT (file), "uri");
- display_name = g_object_get_data (G_OBJECT (file), "display_name");
-
- /* Probably an unsupported URI scheme */
- if (file_info == NULL) {
- data.display_name = g_strdup (display_name);
- /* Bogus mime-type, we just want it added */
- data.mime_type = g_strdup ("video/x-totem-stream");
- groups[0] = (gchar*) "TotemStreams";
- } else {
- data.mime_type = g_strdup (g_file_info_get_content_type (file_info));
- data.display_name = g_strdup (g_file_info_get_display_name (file_info));
- g_object_unref (file_info);
- groups[0] = (gchar*) "Totem";
- }
-
- data.app_name = g_strdup (g_get_application_name ());
- data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
- data.groups = groups;
- if (gtk_recent_manager_add_full (totem->recent_manager,
- uri, &data) == FALSE) {
- g_warning ("Couldn't add recent file for '%s'", uri);
- }
-
- g_free (data.display_name);
- g_free (data.mime_type);
- g_free (data.app_name);
- g_free (data.app_exec);
-
- g_object_unref (file);
-}
-
-void
-totem_action_add_recent (Totem *totem,
- const char *uri,
- const char *display_name,
- const char *content_type)
-{
- GFile *file;
-
- if (totem_is_special_mrl (uri) != FALSE)
- return;
-
- /* If we already have a content-type, the display_name is
- * probably decent as well */
- if (content_type != NULL) {
- GtkRecentData data;
- char *groups[] = { NULL, NULL };
-
- memset (&data, 0, sizeof (data));
-
- data.mime_type = (char *) content_type;
- data.display_name = (char *) display_name;
- groups[0] = (char*) "Totem";
- data.app_name = (char *) g_get_application_name ();
- data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
- data.groups = groups;
-
- if (gtk_recent_manager_add_full (totem->recent_manager,
- uri, &data) == FALSE) {
- g_warning ("Couldn't add recent file for '%s'", uri);
- }
- g_free (data.app_exec);
-
- return;
- }
-
- file = g_file_new_for_uri (uri);
- g_object_set_data_full (G_OBJECT (file), "uri", g_strdup (uri), g_free);
- g_object_set_data_full (G_OBJECT (file), "display_name", g_strdup (display_name), g_free);
- g_file_query_info_async (file,
- G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
- G_FILE_QUERY_INFO_NONE, 0, NULL, (GAsyncReadyCallback) recent_info_cb, totem);
-}
-
void
eject_action_callback (GtkAction *action, Totem *totem)
{
diff --git a/src/totem-menu.h b/src/totem-menu.h
index 32df81199..da40fd731 100644
--- a/src/totem-menu.h
+++ b/src/totem-menu.h
@@ -35,10 +35,6 @@ void totem_sublang_update (Totem *totem);
void totem_sublang_exit (Totem *totem);
void totem_setup_recent (Totem *totem);
-void totem_action_add_recent (Totem *totem,
- const char *uri,
- const char *display_name,
- const char *content_type);
G_END_DECLS
diff --git a/src/totem-object.c b/src/totem-object.c
index f0076c3f3..cabfecb46 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -611,7 +611,6 @@ typedef struct {
TotemObject *totem;
gchar *uri;
gchar *display_name;
- gboolean add_to_recent;
} AddToPlaylistData;
static void
@@ -622,8 +621,6 @@ add_to_playlist_and_play_cb (TotemPlaylist *playlist, GAsyncResult *async_result
playlist_changed = totem_playlist_add_mrl_finish (playlist, async_result);
- if (data->add_to_recent != FALSE)
- totem_action_add_recent (data->totem, data->uri, data->display_name, NULL);
end = totem_playlist_get_last (playlist);
totem_signal_unblock_by_data (playlist, data->totem);
@@ -672,7 +669,6 @@ totem_object_add_to_playlist_and_play (TotemObject *totem,
data->totem = g_object_ref (totem);
data->uri = g_strdup (uri);
data->display_name = g_strdup (display_name);
- data->add_to_recent = add_to_recent;
totem_playlist_add_mrl (totem->playlist, uri, display_name, TRUE,
NULL, (GAsyncReadyCallback) add_to_playlist_and_play_cb, data);
@@ -1808,7 +1804,6 @@ totem_action_set_mrl_with_warning (TotemObject *totem,
totem->mrl = NULL;
bacon_video_widget_set_logo_mode (totem->bvw, TRUE);
} else {
- char *display_name, *content_type;
/* cast is to shut gcc up */
const GtkTargetEntry source_table[] = {
{ (gchar*) "text/uri-list", 0, 0 }
@@ -1821,12 +1816,6 @@ totem_action_set_mrl_with_warning (TotemObject *totem,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
source_table, G_N_ELEMENTS (source_table),
GDK_ACTION_COPY);
-
- display_name = totem_playlist_get_current_title (totem->playlist);
- content_type = totem_playlist_get_current_content_type (totem->playlist);
- totem_action_add_recent (totem, totem->mrl, display_name, content_type);
- g_free (display_name);
- g_free (content_type);
}
}
update_buttons (totem);