Join two similar options 'Save path' and 'Save default path for screenshots'

This commit is contained in:
Yuriy Puchkov
2020-10-06 14:08:40 +03:00
parent 79ededbd99
commit 8848b25305
6 changed files with 35 additions and 94 deletions

View File

@@ -79,7 +79,7 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
while (!ok) {
ConfigHandler config;
QString savePath = FileNameHandler().absoluteSavePath();
if (config.savePathFixed().size() == 0) {
if (!config.savePathFixed()) {
savePath = QFileDialog::getSaveFileName(
nullptr,
QObject::tr("Save screenshot"),
@@ -95,7 +95,6 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) &&
!savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) &&
!savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) {
savePath += QLatin1String(".png");
}