Added playlist extensions to combobox in "file open" dialog.

This commit is contained in:
LoRd_MuldeR 2011-01-30 22:19:53 +01:00
parent 571625a032
commit ac53f70488
7 changed files with 26 additions and 1 deletions

View File

@ -217,6 +217,10 @@
<source>All supported types</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Playlists</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All files</source>
<translation type="unfinished"></translation>

View File

@ -221,6 +221,10 @@
<source>All files</source>
<translation>Alle Dateien</translation>
</message>
<message>
<source>Playlists</source>
<translation>Wiedergabelisten</translation>
</message>
</context>
<context>
<name>DropBox</name>

View File

@ -222,6 +222,10 @@
<source>All files</source>
<translation>Todos los archivos</translation>
</message>
<message>
<source>Playlists</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DropBox</name>

View File

@ -222,6 +222,10 @@
<source>All files</source>
<translation>Tous les fichiers</translation>
</message>
<message>
<source>Playlists</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DropBox</name>

View File

@ -221,6 +221,10 @@
<source>All files</source>
<translation>Tutti i files</translation>
</message>
<message>
<source>Playlists</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DropBox</name>

Binary file not shown.

View File

@ -40,6 +40,8 @@
#include <QStringList>
#include <QRegExp>
static const char *g_playlistExt = "*.m3u *.m3u8 *.pls *.asx *.wpl";
#define PROBE_DECODER(DEC) if(DEC::isDecoderAvailable() && DEC::isFormatSupported(containerType, containerProfile, formatType, formatProfile, formatVersion)) { return new DEC(); }
#define GET_FILETYPES(DEC) (DEC::isDecoderAvailable() ? DEC::supportedTypes() : QStringList())
@ -83,6 +85,7 @@ QStringList DecoderRegistry::getSupportedTypes(void)
types << GET_FILETYPES(ADPCMDecoder);
QStringList extensions;
extensions << QString(g_playlistExt).split(" ", QString::SkipEmptyParts);
QRegExp regExp("\\((.+)\\)", Qt::CaseInsensitive);
for(int i = 0; i < types.count(); i++)
@ -92,7 +95,7 @@ QStringList DecoderRegistry::getSupportedTypes(void)
extensions << regExp.cap(1).split(" ", QString::SkipEmptyParts);
}
}
if(!extensions.empty())
{
extensions.removeDuplicates();
@ -100,6 +103,8 @@ QStringList DecoderRegistry::getSupportedTypes(void)
types.prepend(QString("%1 (%2)").arg(tr("All supported types"), extensions.join(" ")));
}
types << QString("%1 (%2)").arg(tr("Playlists"), g_playlistExt);
types << QString("%1 (*.*)").arg(tr("All files"));
return types;
}