- std::string anArg = *it;
- int aSepPos = anArg.find(":");
- if (aSepPos == std::string::npos) {
- continue;
+ QString aFormat = QString::fromStdString(*it);
+ if (!aFormat.isEmpty())
+ aResult << aFormat;
+ }
+ return aResult;
+}
+
+QString ModuleBase_WidgetFileSelector::filterString() const
+{
+ QStringList aResult;
+ QStringList aValidatorFormats = getValidatorFormats();
+
+ foreach(const QString & eachFormat, aValidatorFormats) {
+ aResult << formatToFilter(eachFormat);
+ }
+ if (myType == WFS_OPEN)
+ aResult << QString("All files (*.*)");
+ return aResult.join(";;");
+}
+
+QString ModuleBase_WidgetFileSelector::applyExtension(const QString& theFileName,
+ const QString& theFilter)
+{
+ QString aResult = theFileName;
+ bool hasExtension = false;
+ QStringList anExtensions = filterToExtensions(theFilter);
+ foreach(const QString& anExtension, anExtensions) {
+ if (theFileName.endsWith(anExtension.section(".", 1, 1), Qt::CaseInsensitive)) {
+ hasExtension = true;
+ break;