mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
removed loop that occured when screenshot failed to save.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
# common
|
||||
|
||||
.idea
|
||||
|
||||
.cache
|
||||
# C++ objects and libs
|
||||
|
||||
*.slo
|
||||
|
||||
@@ -104,14 +104,13 @@ bool ScreenshotSaver::saveToFilesystem(const QPixmap& capture,
|
||||
bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
|
||||
{
|
||||
bool ok = false;
|
||||
while (!ok) {
|
||||
ConfigHandler config;
|
||||
QString savePath = FileNameHandler().absoluteSavePath();
|
||||
#if defined(Q_OS_MACOS)
|
||||
for (QWidget* widget : qApp->topLevelWidgets()) {
|
||||
QString className(widget->metaObject()->className());
|
||||
if (0 == className.compare(
|
||||
CaptureWidget::staticMetaObject.className())) {
|
||||
if (0 ==
|
||||
className.compare(CaptureWidget::staticMetaObject.className())) {
|
||||
widget->showNormal();
|
||||
widget->hide();
|
||||
break;
|
||||
@@ -127,10 +126,6 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
|
||||
"file (*.bmp);;JPEG file (*.jpg)"));
|
||||
}
|
||||
|
||||
if (savePath.isNull()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) &&
|
||||
!savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) &&
|
||||
!savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) {
|
||||
@@ -146,8 +141,8 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
|
||||
QString msg = QObject::tr("Capture saved as ") + savePath;
|
||||
if (config.copyPathAfterSaveEnabled()) {
|
||||
QApplication::clipboard()->setText(savePath);
|
||||
msg = QObject::tr(
|
||||
"Capture is saved and copied to the clipboard as ") +
|
||||
msg =
|
||||
QObject::tr("Capture is saved and copied to the clipboard as ") +
|
||||
savePath;
|
||||
}
|
||||
SystemNotification().sendMessage(msg, savePath);
|
||||
@@ -160,6 +155,6 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture)
|
||||
saveErrBox.setWindowIcon(QIcon(":img/app/flameshot.svg"));
|
||||
saveErrBox.exec();
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user