summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/om3u.cpp11
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp21
2 files changed, 23 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp
index 039f3b1..3541e5f 100644
--- a/core/multimedia/opieplayer/om3u.cpp
+++ b/core/multimedia/opieplayer/om3u.cpp
@@ -48,2 +48,9 @@
+static inline QString fullBaseName ( const QFileInfo &fi )
+{
+ QString str = fi. fileName ( );
+ return str. left ( str. findRev ( '.' ));
+}
+
+
//extern PlayListWidget *playList;
@@ -70,3 +77,3 @@ void Om3u::readM3u() {
QFileInfo f( s );
- QString name = f.baseName();
+ QString name = fullBaseName ( f );
name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
@@ -107,3 +114,3 @@ void Om3u::readPls() { //it's a pls file
QFileInfo f( s );
- QString name = f.baseName();
+ QString name = fullBaseName ( f );
if( name.left( 4 ) == "http" ) {
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index c28548c..8b25a4c 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -85,2 +85,9 @@ extern MediaPlayerState *mediaPlayerState;
+static inline QString fullBaseName ( const QFileInfo &fi )
+{
+ QString str = fi. fileName ( );
+ return str. left ( str. findRev ( '.' ));
+}
+
+
QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg";
@@ -326,3 +333,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
loadList(DocLnk( currentPlaylist));
- setCaption(tr("OpiePlayer: ")+ QFileInfo(currentPlaylist).baseName());
+ setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlaylist)));
@@ -683,3 +690,3 @@ void PlayListWidget::addSelected() {
};
- lnk.setName( QFileInfo(filename).baseName() ); //sets name
+ lnk.setName( fullBaseName ( QFileInfo(filename))); //sets name
lnk.setFile( filename ); //sets file name
@@ -718,3 +725,3 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
filename=it->text(3);
- lnk.setName( QFileInfo(filename).baseName() ); //sets name
+ lnk.setName( fullBaseName ( QFileInfo(filename)) ); //sets name
lnk.setFile( filename ); //sets file name
@@ -1040,3 +1047,3 @@ void PlayListWidget::openFile() {
} else {
- lnk.setName( QFileInfo(filename).baseName() ); //sets name
+ lnk.setName( fullBaseName ( QFileInfo(filename)) ); //sets name
lnk.setFile( filename ); //sets file name
@@ -1076,3 +1083,3 @@ void PlayListWidget::readm3u( const QString &filename ) {
// if( QFileInfo( s ).exists() ) {
- lnk.setName( QFileInfo(s).baseName());
+ lnk.setName( fullBaseName ( QFileInfo(s)));
// if(s.right(4) == '.') {//if regular file
@@ -1102,3 +1109,3 @@ void PlayListWidget::readm3u( const QString &filename ) {
d->selectedFiles->setSelectedItem( s);
- setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName());
+ setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(filename)));
@@ -1121,3 +1128,3 @@ void PlayListWidget::readPls( const QString &filename ) {
QFileInfo f( s );
- QString name = f.baseName();
+ QString name = fullBaseName ( f);