From aa3f57c0236c77f2fd90415fc1f3062a93b25b93 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 24 Nov 2010 18:17:51 +0000 Subject: 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 --- .../Input/modplug/decodermodplugfactory.cpp | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/plugins/Input/modplug/decodermodplugfactory.cpp') 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 #include - +#include #include #include #include - #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; } -- cgit v1.2.3-13-gbd6f