File dialog filter with an extension separator dot

Included the dot symbol in the "save file as" dialog filter (e.g. for
PDF files the filter now is `(*.pdf)` instead of `(*pdf)`).
This commit is contained in:
Veloman Yunkan 2024-12-10 19:28:49 +04:00 committed by Kelson
parent 76124ddb5f
commit c1d8cdc896

View File

@ -39,7 +39,7 @@ QString askForSaveFilePath(const QString& suggestedName)
const auto app = KiwixApp::instance();
const QString suggestedPath = app->getPrevSaveDir() + "/" + suggestedName;
const QString extension = suggestedName.section(".", -1);
const QString filter = extension.isEmpty() ? "" : "(*" + extension + ")";
const QString filter = extension.isEmpty() ? "" : "(*." + extension + ")";
QString fileName = QFileDialog::getSaveFileName(
app->getMainWindow(), gt("save-file-as-window-title"),
suggestedPath, filter);