Don't try and clear file if it\'s unexistent

This commit is contained in:
ArsenArsen 2017-12-21 20:08:56 +01:00
parent 24952bba05
commit 00cbbd4938
No known key found for this signature in database
GPG Key ID: 683D2F43B0CA4BD2

View File

@ -146,7 +146,7 @@ void utils::externalScreenshot(std::function<void(QPixmap)> callback) {
pixmap.loadFromData(process->readAllStandardOutput());
callback(pixmap);
}
QFile(tempPath).remove();
if (!tempPath.isEmpty()) QFile(tempPath).remove();
});
QObject::connect(process, &QProcess::errorOccurred, [](QProcess::ProcessError err) {
if (err == QProcess::FailedToStart) settings::settings().remove("command/fullscreenCommand");
@ -178,7 +178,7 @@ void utils::externalScreenshotActive(std::function<void(QPixmap)> callback) {
pixmap.loadFromData(process->readAllStandardOutput());
callback(pixmap);
}
QFile(tempPath).remove();
if (!tempPath.isEmpty()) QFile(tempPath).remove();
});
QObject::connect(process, &QProcess::errorOccurred, [](QProcess::ProcessError err) {
if (err == QProcess::FailedToStart) settings::settings().remove("command/activeCommand");