[vlc-devel] commit: Skins2: enable playlist saving Is available on qt4, so i don' t see why it's not on skins2 (Fabio Ritrovato )
git version control
git at videolan.org
Mon Aug 11 17:39:11 CEST 2008
vlc | branch: master | Fabio Ritrovato <exsephiroth87 at gmail.com> | Thu Aug 7 21:01:35 2008 +0200| [1807734a8a8403f9bb968fb925cd19b54f716d5b] | committer: Jean-Baptiste Kempf
Skins2: enable playlist saving Is available on qt4, so i don't see why it's not on skins2
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1807734a8a8403f9bb968fb925cd19b54f716d5b
---
modules/gui/skins2/commands/cmd_playlist.cpp | 17 ++++++++++++-----
modules/gui/skins2/src/dialogs.cpp | 2 +-
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp
index be36a5c..ec2118a 100644
--- a/modules/gui/skins2/commands/cmd_playlist.cpp
+++ b/modules/gui/skins2/commands/cmd_playlist.cpp
@@ -101,10 +101,17 @@ void CmdPlaylistSave::execute()
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
{
- // FIXME: when the PLS export will be working, we'll need to remove
- // this hardcoding...
- msg_Err( getIntf(), "need to fix playlist save" );
-// playlist_Export( pPlaylist, m_file.c_str(), "export-m3u" );
+ static const char psz_xspf[] = "export-xspf",
+ psz_m3u[] = "export-m3u";
+ const char *psz_module;
+ if( m_file.find( ".xsp", 0 ) != string::npos )
+ psz_module = psz_xspf;
+ else
+ {
+ psz_module = psz_m3u;
+ if( m_file.find( ".m3u", 0 ) == string::npos )
+ m_file.append( ".m3u" );
+ }
+ playlist_Export( pPlaylist, m_file.c_str(), pPlaylist->p_local_category, psz_module );
}
}
-
diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp
index a367f9d..60d961c 100644
--- a/modules/gui/skins2/src/dialogs.cpp
+++ b/modules/gui/skins2/src/dialogs.cpp
@@ -237,7 +237,7 @@ void Dialogs::showPlaylistLoad()
void Dialogs::showPlaylistSave()
{
- showFileGeneric( _("Save playlist"), _("M3U file|*.m3u|XSPF playlist|*.xspf"),
+ showFileGeneric( _("Save playlist"), _("XSPF playlist|*.xspf|M3U file|*.m3u"),
showPlaylistSaveCB, kSAVE );
}
More information about the vlc-devel
mailing list