diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-11-24 18:17:51 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-11-24 18:17:51 +0000 |
| commit | aa3f57c0236c77f2fd90415fc1f3062a93b25b93 (patch) | |
| tree | d9ab905b952cf9289239b95db99f39321a54e65b /src/plugins/Input/modplug/decodermodplugfactory.cpp | |
| parent | 5c2f5798c6222d35e08fa0853812e2390181e735 (diff) | |
| download | qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.tar.gz qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.tar.bz2 qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.zip | |
some api changes, partial mpris 2.0 implementation
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1991 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/modplug/decodermodplugfactory.cpp')
| -rw-r--r-- | src/plugins/Input/modplug/decodermodplugfactory.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/plugins/Input/modplug/decodermodplugfactory.cpp b/src/plugins/Input/modplug/decodermodplugfactory.cpp index bc80f549d..d5ed95e4b 100644 --- a/src/plugins/Input/modplug/decodermodplugfactory.cpp +++ b/src/plugins/Input/modplug/decodermodplugfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -20,11 +20,10 @@ #include <QtGui> #include <QStringList> - +#include <QRegExp> #include <libmodplug/stdafx.h> #include <libmodplug/it_defs.h> #include <libmodplug/sndfile.h> - #include "settingsdialog.h" #include "modplugmetadatamodel.h" #include "decoder_modplug.h" @@ -36,16 +35,12 @@ bool DecoderModPlugFactory::supports(const QString &source) const { - QString lExt = source.section(".",-1).toLower(); - lExt.prepend("."); - QStringList lExtList; - lExtList << ".amf" << ".ams" << ".dbm" << ".dbf" << ".dsm" << ".far" << ".mdl" - << ".stm" << ".ult" << ".ult" << ".j2b" << ".mt2" << ".mdz" /*<< ".mdr"*/ << ".mdgz" - << ".mdbz" << ".mod" << ".s3z" << /*".s3r" <<*/ ".s3gz" << ".s3m" << ".xmz" /*<< ".xmr"*/ - << ".xmgz" << ".itz" << /*".itr" <<*/ ".itgz" << ".dmf" << ".umx" << ".it" << ".669" - << ".xm" << ".mtm" << ".psm" << ".ft2"; - if (lExtList.contains(lExt)) - return true; + foreach(QString filter, properties().filters) + { + QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); + if (regexp.exactMatch(source)) + return true; + } return false; } @@ -58,16 +53,18 @@ const DecoderProperties DecoderModPlugFactory::properties() const { DecoderProperties properties; properties.name = tr("ModPlug Plugin"); - properties.filter = (QString) "*.amf *.ams *.dbm *.dbf *.dsm *.far *.mdl *.stm *.ult" + - "*.j2b *.mt2 *.mdz *.mdr *.mdgz *.mdbz *.mod *.s3z *.s3r *.s3gz *.s3m *.xmz"+ - "*.xmr *.xmgz *.itz *.itr *.itgz *.dmf *.umx *.it *.669 *.xm *.mtm *.psm *.ft2"; + properties.filters << "*.amf" << "*.ams" << "*.dbm" << "*.dbf" << "*.dsm" << "*.far" << "*.mdl"; + properties.filters << "*.stm" << "*.ult" << "*.j2b" << "*.mt2" << "*.mdz" << "*.mdr" << "*.mdgz"; + properties.filters << "*.mdbz" << "*.mod" << "*.s3z" << "*.s3r" << "*.s3gz" << "*.s3m" << "*.xmz"; + properties.filters << "*.xmr" << "*.xmgz" << "*.itz" << "*.itr" << "*.itgz" << "*.dmf" "*.umx"; + properties.filters << "*.it" << "*.669" << "*.xm" << "*.mtm" << "*.psm" << "*.ft2"; properties.description = tr("ModPlug Files"); //properties.contentType = ; properties.shortName = "modplug"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = true; - properties.protocols = "file"; + properties.protocols << "file"; return properties; } |
