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