Utilities::StringSet MainWindow::ExternalPopup::mimeTypes( const DB::FileNameList& files ) { StringSet res; StringSet extensions; for( DB::FileNameList::ConstIterator fileIt = files.begin(); fileIt != files.end(); ++fileIt ) { const DB::FileName baseFileName = *fileIt; const int extStart = baseFileName.relative().lastIndexOf(QChar::fromLatin1('.')); const QString ext = baseFileName.relative().mid(extStart); if (! extensions.contains(ext)) { res.insert( mimeType( *fileIt ) ); extensions.insert( ext ); } } return res; }
bool RAWImageDecoder::_fileEndsWithExtensions( const DB::FileName& fileName, const QStringList& extensionList) { for ( QStringList::ConstIterator it = extensionList.begin(); it != extensionList.end(); ++it ) { if( fileName.relative().endsWith( *it, Qt::CaseInsensitive ) ) return true; } return false; }