[totem] main: Add a GMount column to the playlist
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Add a GMount column to the playlist
- Date: Mon, 2 Jul 2012 19:25:01 +0000 (UTC)
commit 749e836002a29444023160a94806529fd2d071aa
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jul 2 20:18:16 2012 +0100
main: Add a GMount column to the playlist
To keep track of it, as by the time the GMount will disappear,
it will be too late to try and look for it, and we'd have nothing to
compare it against.
data/playlist.ui | 2 ++
src/totem-playlist.c | 21 +++++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/data/playlist.ui b/data/playlist.ui
index 7184227..149f057 100644
--- a/data/playlist.ui
+++ b/data/playlist.ui
@@ -56,6 +56,8 @@
<column type="gchararray"/>
<!-- column-name file-monitor -->
<column type="GObject"/>
+ <!-- column-name mount -->
+ <column type="GObject"/>
<!-- column-name mime-type -->
<column type="gchararray"/>
</columns>
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index e133e1c..6bdc3e8 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -146,6 +146,7 @@ enum {
TITLE_CUSTOM_COL,
SUBTITLE_URI_COL,
FILE_MONITOR_COL,
+ MOUNT_COL,
MIME_TYPE_COL,
NUM_COLS
};
@@ -1745,6 +1746,7 @@ totem_playlist_add_one_mrl (TotemPlaylist *playlist,
char *filename_for_display, *uri, *escaped_filename;
GtkTreeRowReference *ref;
GFileMonitor *monitor;
+ GMount *mount;
GFile *file;
int pos;
@@ -1783,20 +1785,23 @@ totem_playlist_add_one_mrl (TotemPlaylist *playlist,
"changed",
G_CALLBACK (totem_playlist_file_changed),
playlist);
+ mount = NULL;
} else {
+ mount = totem_get_mount_for_media (uri ? uri : mrl);
monitor = NULL;
}
escaped_filename = g_markup_escape_text (filename_for_display, -1);
gtk_list_store_insert_with_values (store, &iter, pos,
- PLAYING_COL, TOTEM_PLAYLIST_STATUS_NONE,
- FILENAME_COL, filename_for_display,
- FILENAME_ESCAPED_COL, escaped_filename,
- URI_COL, uri ? uri : mrl,
- TITLE_CUSTOM_COL, display_name ? TRUE : FALSE,
- FILE_MONITOR_COL, monitor,
- MIME_TYPE_COL, content_type,
- -1);
+ PLAYING_COL, TOTEM_PLAYLIST_STATUS_NONE,
+ FILENAME_COL, filename_for_display,
+ FILENAME_ESCAPED_COL, escaped_filename,
+ URI_COL, uri ? uri : mrl,
+ TITLE_CUSTOM_COL, display_name ? TRUE : FALSE,
+ FILE_MONITOR_COL, monitor,
+ MOUNT_COL, mount,
+ MIME_TYPE_COL, content_type,
+ -1);
g_free (escaped_filename);
g_signal_emit (playlist,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]