diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index 5ac5badd..11c66d05 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -60,15 +60,19 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap &capture) { QString savePath = QFileDialog::getSaveFileName( nullptr, QString(), - FileNameHandler().absoluteSavePath() + ".png"); + FileNameHandler().absoluteSavePath() + ".png", + QLatin1String("Portable Network Graphic file (PNG) (*.png);;BMP file (*.bmp);;JPEG file (*.jpg)")); if (savePath.isNull()) { break; } - if (!savePath.endsWith(QLatin1String(".png"))) { - savePath += QLatin1String(".png"); - } + if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) { + + savePath += QLatin1String(".png"); + } ok = capture.save(savePath);