mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-03-25 01:20:11 +00:00
Add support for more images formats (#436)
* Add support for more images formats * Resolves extension verifying in case of empty save path string * Code formatting
This commit is contained in:
committed by
Dharkael
parent
25246a79f0
commit
8887b4e7ce
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user