summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-03 12:31:10 (UTC)
committer harlekin <harlekin>2002-08-03 12:31:10 (UTC)
commited2394a99f071d4779498325476094255607d019 (patch) (side-by-side diff)
tree62e0a648e7045e2102d22da5872496e76b5d2cf6
parent3b1ab71b7bfe42310661764e1089200290c7b817 (diff)
downloadopie-ed2394a99f071d4779498325476094255607d019.zip
opie-ed2394a99f071d4779498325476094255607d019.tar.gz
opie-ed2394a99f071d4779498325476094255607d019.tar.bz2
better file detection
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediadetect.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/mediadetect.cpp b/noncore/multimedia/opieplayer2/mediadetect.cpp
index 7deeb2f..5e0da88 100644
--- a/noncore/multimedia/opieplayer2/mediadetect.cpp
+++ b/noncore/multimedia/opieplayer2/mediadetect.cpp
@@ -1,38 +1,40 @@
#include <qstring.h>
#include "mediadetect.h"
MediaDetect::MediaDetect() {
}
MediaDetect::~MediaDetect() {
}
char MediaDetect::videoOrAudio( const QString& fileName ) {
- if( fileName.right(4) == ".avi" ||
- fileName.right(4) == ".mpg" ||
- fileName.right(4) == ".asf" ||
- fileName.right(4) == ".mov" ||
- fileName.right(5) == ".mpeg" ) {
+ if( (fileName.lower()).right(4) == ".avi" ||
+ (fileName.lower()).right(4) == ".mpg" ||
+ (fileName.lower()).right(4) == ".asf" ||
+ (fileName.lower()).right(4) == ".mov" ||
+ (fileName.lower()).right(5) == ".mpeg" ) {
+ qDebug("Video out taken");
return 'v';
- } else if ( fileName.right(4) == ".avi" ||
- fileName.right(4) == ".mp3" ||
- fileName.right(4) == ".ogg" ||
- fileName.right(4) == ".wav" ) {
+ } else if ( (fileName.lower()).right(4) == "·mp1" ||
+ (fileName.lower()).right(4) == ".mp3" ||
+ (fileName.lower()).right(4) == ".ogg" ||
+ (fileName.lower()).right(4) == ".wav" ) {
+ qDebug("AUDIO out taken");
return 'a';
} else {
return 'f';
}
}
bool MediaDetect::isStreaming( const QString& fileName ) {
// ugly
- if( fileName.left(4) == "http" ) {
+ if( (fileName.lower()).left(4) == "http" ) {
return true;
- } else if (fileName.left(3) == "ftp" ) {
+ } else if ( (fileName.lower()).left(3) == "ftp" ) {
return true;
} else {
return false;
}
}