Commit 9d6097e2 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Return booleans, not ints, so the --export option returns 0 on success

BUG:409133
parent 9a929e16
......@@ -534,7 +534,7 @@ bool KisApplication::start(const KisApplicationArguments &args)
QString outputMimetype = KisMimeDatabase::mimeTypeForFile(exportFileName, false);
if (outputMimetype == "application/octetstream") {
dbgKrita << i18n("Mimetype not found, try using the -mimetype option") << endl;
return 1;
return false;
}
KisDocument *doc = kisPart->createDocument();
......@@ -544,13 +544,13 @@ bool KisApplication::start(const KisApplicationArguments &args)
if (!result) {
errKrita << "Could not load " << fileName << ":" << doc->errorMessage();
QTimer::singleShot(0, this, SLOT(quit()));
return 1;
return false;
}
if (exportFileName.isEmpty()) {
errKrita << "Export destination is not specified for" << fileName << "Please specify export destination with --export-filename option";
QTimer::singleShot(0, this, SLOT(quit()));
return 1;
return false;
}
qApp->processEvents(); // For vector layers to be updated
......@@ -560,7 +560,7 @@ bool KisApplication::start(const KisApplicationArguments &args)
errKrita << "Could not export " << fileName << "to" << exportFileName << ":" << doc->errorMessage();
}
QTimer::singleShot(0, this, SLOT(quit()));
return 0;
return true;
}
else if (exportSequence) {
KisDocument *doc = kisPart->createDocument();
......@@ -571,7 +571,7 @@ bool KisApplication::start(const KisApplicationArguments &args)
if (!doc->image()->animationInterface()->hasAnimation()) {
errKrita << "This file has no animation." << endl;
QTimer::singleShot(0, this, SLOT(quit()));
return 1;
return false;
}
doc->setFileBatchMode(true);
......@@ -589,7 +589,7 @@ bool KisApplication::start(const KisApplicationArguments &args)
errKrita << i18n("Failed to render animation frames!") << endl;
}
QTimer::singleShot(0, this, SLOT(quit()));
return 0;
return true;
}
else if (d->mainWindow) {
if (fileName.endsWith(".bundle")) {
......
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