summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/om3u.cpp
authorsandman <sandman>2002-12-11 00:17:09 (UTC)
committer sandman <sandman>2002-12-11 00:17:09 (UTC)
commit6c71f5ccd9506234a317d9ff3d119613c457e769 (patch) (side-by-side diff)
treef78a9d2a0981dbb446096bf072ca5decaa5e1d59 /core/multimedia/opieplayer/om3u.cpp
parente9d1213578b83f8380c4681186246a2b32ae6375 (diff)
downloadopie-6c71f5ccd9506234a317d9ff3d119613c457e769.zip
opie-6c71f5ccd9506234a317d9ff3d119613c457e769.tar.gz
opie-6c71f5ccd9506234a317d9ff3d119613c457e769.tar.bz2
fix for a stupid bug .. op1 wants to strip the extension, but instead
stripps everything after the first '.'. So filenames like "02. foobar.mp3" become "02"
Diffstat (limited to 'core/multimedia/opieplayer/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/om3u.cpp11
1 files changed, 9 insertions, 2 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
@@ -46,6 +46,13 @@
#include <qstringlist.h>
#include <qcstring.h>
+static inline QString fullBaseName ( const QFileInfo &fi )
+{
+ QString str = fi. fileName ( );
+ return str. left ( str. findRev ( '.' ));
+}
+
+
//extern PlayListWidget *playList;
Om3u::Om3u( const QString &filePath, int mode)
@@ -68,7 +75,7 @@ void Om3u::readM3u() {
if( s.left(2) == "E:" || s.left(2) == "P:" ) {
s = s.right( s.length() -2 );
QFileInfo f( s );
- QString name = f.baseName();
+ QString name = fullBaseName ( f );
name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
s=s.replace( QRegExp( "\\" ), "/" );
append(s);
@@ -105,7 +112,7 @@ void Om3u::readPls() { //it's a pls file
// File2=http
s = s.replace( QRegExp( "\\" ), "/" );
QFileInfo f( s );
- QString name = f.baseName();
+ QString name = fullBaseName ( f );
if( name.left( 4 ) == "http" ) {
name = s.right( s.length() - 7);
} else {