Paste P285

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Dec 22 2018, 6:47 PM.
diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp
index a5c4b47c..98d2a0f3 100644
--- a/src/filewidgets/kfilewidget.cpp
+++ b/src/filewidgets/kfilewidget.cpp
@@ -2207,7 +2207,9 @@ static QString getExtensionFromPatternList(const QStringList &patternList)
// *.JP?
if ((*it).startsWith(QLatin1String("*.")) &&
(*it).length() > 2 &&
- (*it).indexOf(QLatin1Char('*'), 2) < 0 && (*it).indexOf(QLatin1Char('?'), 2) < 0) {
+ (*it).indexOf(QLatin1Char('*'), 2) < 0 &&
+ (*it).indexOf(QLatin1Char('?'), 2) < 0 &&
+ (*it).indexOf(QLatin1Char('['), 2) < 0) {
ret = (*it).mid(1);
break;
}
diff --git a/tests/kfilewidgettest_gui.cpp b/tests/kfilewidgettest_gui.cpp
index c7d2c95b..0120e7c2 100644
--- a/tests/kfilewidgettest_gui.cpp
+++ b/tests/kfilewidgettest_gui.cpp
@@ -27,7 +27,9 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
KFileWidget* fileWidget = new KFileWidget(QUrl(QStringLiteral("kfiledialog:///OpenDialog")), nullptr);
- fileWidget->setMode(KFile::Files | KFile::ExistingOnly);
+ fileWidget->setOperationMode(KFileWidget::Saving);
+ fileWidget->setMode(KFile::File);
+ fileWidget->setFilter("*.[Pp][Nn][Gg]");
fileWidget->setAttribute(Qt::WA_DeleteOnClose);
fileWidget->show();
davidedmundson edited the content of this paste. (Show Details)Dec 22 2018, 6:47 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.