Commit 7f88fcb4 authored by Nazar Kalinowski's avatar Nazar Kalinowski Committed by Méven Car

Fix wrong file name when --output option is used

BUG: 424380
parent 3cf5d95d
......@@ -118,7 +118,6 @@ void SpectacleCore::onActivateRequested(QStringList arguments, const QString& /*
mNotify = true;
mCopyToClipboard = Settings::copyImageToClipboard();
qint64 lDelayMsec = 0;
QString lFileName = QString();
// are we ask to run in background or dbus mode?
if (parser->isSet(QStringLiteral("background"))) {
......@@ -135,13 +134,6 @@ void SpectacleCore::onActivateRequested(QStringList arguments, const QString& /*
lDelayMsec = 0;
}
if (!(lFileName.isEmpty() || lFileName.isNull())) {
if (QDir::isRelativePath(lFileName)) {
lFileName = QDir::current().absoluteFilePath(lFileName);
}
setFilename(lFileName);
}
// reset last region if it should not be remembered across restarts
if(!Settings::alwaysRememberRegion()) {
Settings::setCropRegion({0, 0, 0, 0});
......@@ -159,7 +151,13 @@ void SpectacleCore::onActivateRequested(QStringList arguments, const QString& /*
}
if (parser->isSet(QStringLiteral("output"))) {
lFileName = parser->value(QStringLiteral("output"));
QString lFileName = parser->value(QStringLiteral("output"));
if (!(lFileName.isEmpty() || lFileName.isNull())) {
if (QDir::isRelativePath(lFileName)) {
lFileName = QDir::current().absoluteFilePath(lFileName);
}
setFilename(lFileName);
}
}
if (parser->isSet(QStringLiteral("delay"))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment