Don't return negative numbers in sdktool

Negative return values are interpreted as 'process crashed' on
Windows: QTBUG-28735 . This in turn means the installer framework
always shows an error dialog.

By using positive numbers even for error conditions the installer
can decide to ignore certain errors instead.

Change-Id: Ib5cdd461372ac13fe417feb6ff43a7424c159f68
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Kai Koehne
2013-07-08 08:35:18 +02:00
committed by Tobias Hunger
parent 486b5c4739
commit 108899ef8f
9 changed files with 19 additions and 19 deletions

View File

@@ -83,10 +83,10 @@ int AddKeysOperation::execute() const
QVariantMap result = addKeys(map, m_data); QVariantMap result = addKeys(map, m_data);
if (result.isEmpty() || map == result) if (result.isEmpty() || map == result)
return -4; return 4;
// Write data again: // Write data again:
return save(result, m_file) ? 0 : -5; return save(result, m_file) ? 0 : 5;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -219,9 +219,9 @@ int AddKitOperation::execute() const
m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra); m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra);
if (result.isEmpty() || map == result) if (result.isEmpty() || map == result)
return -2; return 2;
return save(result, QLatin1String("profiles")) ? 0 : -3; return save(result, QLatin1String("profiles")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -155,9 +155,9 @@ int AddQtOperation::execute() const
QVariantMap result = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra); QVariantMap result = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra);
if (result.isEmpty() || result == map) if (result.isEmpty() || result == map)
return -2; return 2;
return save(result, QLatin1String("qtversions")) ? 0 : -3; return save(result, QLatin1String("qtversions")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -151,9 +151,9 @@ int AddToolChainOperation::execute() const
QVariantMap result = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra); QVariantMap result = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra);
if (result.isEmpty() || map == result) if (result.isEmpty() || map == result)
return -2; return 2;
return save(result, QLatin1String("toolchains")) ? 0 : -3; return save(result, QLatin1String("toolchains")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -70,7 +70,7 @@ int GetOperation::execute() const
foreach (const QString &key, m_keys) { foreach (const QString &key, m_keys) {
const QVariant result = get(map, key); const QVariant result = get(map, key);
if (result.isValid()) if (result.isValid())
return -2; return 2;
std::cout << qPrintable(result.toString()) << std::endl; std::cout << qPrintable(result.toString()) << std::endl;
} }

View File

@@ -111,7 +111,7 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
if (next.isNull()) { if (next.isNull()) {
std::cerr << "Missing argument to '-s'." << std::endl << std::endl; std::cerr << "Missing argument to '-s'." << std::endl << std::endl;
printHelp(operations); printHelp(operations);
return -1; return 1;
} }
s->sdkPath = Utils::FileName::fromString(next); s->sdkPath = Utils::FileName::fromString(next);
++i; // skip next; ++i; // skip next;
@@ -135,19 +135,19 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
std::cerr << "Unknown parameter given." << std::endl << std::endl; std::cerr << "Unknown parameter given." << std::endl << std::endl;
printHelp(operations); printHelp(operations);
return -1; return 1;
} }
if (!s->operation) { if (!s->operation) {
std::cerr << "No operation requested." << std::endl << std::endl; std::cerr << "No operation requested." << std::endl << std::endl;
printHelp(operations); printHelp(operations);
return -1; return 1;
} }
if (!s->operation->setArguments(opArgs)) { if (!s->operation->setArguments(opArgs)) {
std::cerr << "Argument parsing failed." << std::endl << std::endl; std::cerr << "Argument parsing failed." << std::endl << std::endl;
printHelp(s->operation); printHelp(s->operation);
s->operation = 0; s->operation = 0;
return -1; return 1;
} }
return 0; return 0;

View File

@@ -90,9 +90,9 @@ int RmKitOperation::execute() const
QVariantMap result = rmKit(map, m_id); QVariantMap result = rmKit(map, m_id);
if (result == map) if (result == map)
return -2; return 2;
return save(result, QLatin1String("profiles")) ? 0 : -3; return save(result, QLatin1String("profiles")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -90,9 +90,9 @@ int RmQtOperation::execute() const
QVariantMap result = rmQt(map, m_id); QVariantMap result = rmQt(map, m_id);
if (result == map) if (result == map)
return -2; return 2;
return save(result, QLatin1String("qtversion")) ? 0 : -3; return save(result, QLatin1String("qtversion")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -91,9 +91,9 @@ int RmToolChainOperation::execute() const
QVariantMap result = rmToolChain(map, m_id); QVariantMap result = rmToolChain(map, m_id);
if (result == map) if (result == map)
return -2; return 2;
return save(result, QLatin1String("toolchains")) ? 0 : -3; return save(result, QLatin1String("toolchains")) ? 0 : 3;
} }
#ifdef WITH_TESTS #ifdef WITH_TESTS