Commit 108899ef authored by Kai Koehne's avatar Kai Koehne Committed by Tobias Hunger
Browse files

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: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 486b5c47
......@@ -83,10 +83,10 @@ int AddKeysOperation::execute() const
QVariantMap result = addKeys(map, m_data);
if (result.isEmpty() || map == result)
return -4;
return 4;
// Write data again:
return save(result, m_file) ? 0 : -5;
return save(result, m_file) ? 0 : 5;
}
#ifdef WITH_TESTS
......
......@@ -219,9 +219,9 @@ int AddKitOperation::execute() const
m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra);
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
......
......@@ -155,9 +155,9 @@ int AddQtOperation::execute() const
QVariantMap result = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra);
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
......
......@@ -151,9 +151,9 @@ int AddToolChainOperation::execute() const
QVariantMap result = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra);
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
......
......@@ -70,7 +70,7 @@ int GetOperation::execute() const
foreach (const QString &key, m_keys) {
const QVariant result = get(map, key);
if (result.isValid())
return -2;
return 2;
std::cout << qPrintable(result.toString()) << std::endl;
}
......
......@@ -111,7 +111,7 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
if (next.isNull()) {
std::cerr << "Missing argument to '-s'." << std::endl << std::endl;
printHelp(operations);
return -1;
return 1;
}
s->sdkPath = Utils::FileName::fromString(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;
printHelp(operations);
return -1;
return 1;
}
if (!s->operation) {
std::cerr << "No operation requested." << std::endl << std::endl;
printHelp(operations);
return -1;
return 1;
}
if (!s->operation->setArguments(opArgs)) {
std::cerr << "Argument parsing failed." << std::endl << std::endl;
printHelp(s->operation);
s->operation = 0;
return -1;
return 1;
}
return 0;
......
......@@ -90,9 +90,9 @@ int RmKitOperation::execute() const
QVariantMap result = rmKit(map, m_id);
if (result == map)
return -2;
return 2;
return save(result, QLatin1String("profiles")) ? 0 : -3;
return save(result, QLatin1String("profiles")) ? 0 : 3;
}
#ifdef WITH_TESTS
......
......@@ -90,9 +90,9 @@ int RmQtOperation::execute() const
QVariantMap result = rmQt(map, m_id);
if (result == map)
return -2;
return 2;
return save(result, QLatin1String("qtversion")) ? 0 : -3;
return save(result, QLatin1String("qtversion")) ? 0 : 3;
}
#ifdef WITH_TESTS
......
......@@ -91,9 +91,9 @@ int RmToolChainOperation::execute() const
QVariantMap result = rmToolChain(map, m_id);
if (result == map)
return -2;
return 2;
return save(result, QLatin1String("toolchains")) ? 0 : -3;
return save(result, QLatin1String("toolchains")) ? 0 : 3;
}
#ifdef WITH_TESTS
......
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