Merge remote-tracking branch 'origin/4.7' into 4.8

Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ia1d6035a335fd56069ec8d6d106d58124ee8798d
This commit is contained in:
Eike Ziller
2018-09-21 09:26:38 +02:00
3 changed files with 35 additions and 20 deletions

View File

@@ -924,6 +924,9 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
// TODO: Fix more lambda cases. // TODO: Fix more lambda cases.
LambdaIntroducerAST *lambdaIntroducerAST = lambdaExpressionAST->lambda_introducer; LambdaIntroducerAST *lambdaIntroducerAST = lambdaExpressionAST->lambda_introducer;
LambdaDeclaratorAST *lambdaDeclaratorAST = lambdaExpressionAST->lambda_declarator; LambdaDeclaratorAST *lambdaDeclaratorAST = lambdaExpressionAST->lambda_declarator;
if (!lambdaDeclaratorAST)
return;
TrailingReturnTypeAST *trailingReturnTypeAST = lambdaDeclaratorAST->trailing_return_type; TrailingReturnTypeAST *trailingReturnTypeAST = lambdaDeclaratorAST->trailing_return_type;
unsigned firstSquareBracketTokenIndex = lambdaIntroducerAST->lbracket_token; unsigned firstSquareBracketTokenIndex = lambdaIntroducerAST->lbracket_token;
unsigned lastParenTokenIndex = lambdaDeclaratorAST->rparen_token; unsigned lastParenTokenIndex = lambdaDeclaratorAST->rparen_token;

View File

@@ -1610,12 +1610,12 @@ void SimpleTargetRunner::start()
connect(&m_launcher, &ApplicationLauncher::remoteStderr, connect(&m_launcher, &ApplicationLauncher::remoteStderr,
this, [this](const QString &output) { this, [this](const QString &output) {
appendMessage(output, Utils::StdErrFormatSameLine); appendMessage(output, Utils::StdErrFormatSameLine, false);
}); });
connect(&m_launcher, &ApplicationLauncher::remoteStdout, connect(&m_launcher, &ApplicationLauncher::remoteStdout,
this, [this](const QString &output) { this, [this](const QString &output) {
appendMessage(output, Utils::StdOutFormatSameLine); appendMessage(output, Utils::StdOutFormatSameLine, false);
}); });
connect(&m_launcher, &ApplicationLauncher::finished, connect(&m_launcher, &ApplicationLauncher::finished,

View File

@@ -35,6 +35,7 @@
#include <QTextStream> #include <QTextStream>
#include <QFileInfo> #include <QFileInfo>
#include <QByteArray> #include <QByteArray>
#include <QSysInfo>
#include <QString> #include <QString>
#include <QDir> #include <QDir>
#include <QTime> #include <QTime>
@@ -138,6 +139,26 @@ static bool parseArguments(const QStringList &args, QString *errorMessage)
return true; return true;
} }
static bool readDebugger(const wchar_t *key, QString *debugger,
QString *errorMessage)
{
bool success = false;
HKEY handle;
const RegistryAccess::AccessMode accessMode = optIsWow
#ifdef Q_OS_WIN64
? RegistryAccess::Registry32Mode
#else
? RegistryAccess::Registry64Mode
#endif
: RegistryAccess::DefaultAccessMode;
if (openRegistryKey(HKEY_LOCAL_MACHINE, debuggerRegistryKeyC, false, &handle, accessMode, errorMessage)) {
success = registryReadStringKey(handle, key, debugger, errorMessage);
RegCloseKey(handle);
}
return success;
}
static void usage(const QString &binary, const QString &message = QString()) static void usage(const QString &binary, const QString &message = QString())
{ {
QString msg; QString msg;
@@ -170,10 +191,16 @@ static void usage(const QString &binary, const QString &message = QString())
<< "<p>On 64-bit systems, do the same for the key <i>HKEY_LOCAL_MACHINE\\" << wCharToQString(debuggerWow32RegistryKeyC) << "</i>, " << "<p>On 64-bit systems, do the same for the key <i>HKEY_LOCAL_MACHINE\\" << wCharToQString(debuggerWow32RegistryKeyC) << "</i>, "
<< "setting the new value to <pre>\"" << QDir::toNativeSeparators(binary) << "\" -wow %ld %ld</pre></p>" << "setting the new value to <pre>\"" << QDir::toNativeSeparators(binary) << "\" -wow %ld %ld</pre></p>"
<< "<p>How to run a command with administrative privileges:</p>" << "<p>How to run a command with administrative privileges:</p>"
<< "<pre>runas /env /noprofile /user:Administrator \"command arguments\"</pre>" << "<pre>runas /env /noprofile /user:Administrator \"command arguments\"</pre>";
<< "</body></html>"; QString currentDebugger;
QString errorMessage;
if (readDebugger(debuggerRegistryValueNameC, &currentDebugger, &errorMessage))
str << "<p>Currently registered debugger:</p><pre>" << currentDebugger << "</pre>";
str << "<p>Qt " << QT_VERSION_STR << ", " << QSysInfo::WordSize
<< "bit</p></body></html>";
QMessageBox msgBox(QMessageBox::Information, QLatin1String(titleC), msg, QMessageBox::Ok); QMessageBox msgBox(QMessageBox::Information, QLatin1String(titleC), msg, QMessageBox::Ok);
msgBox.setTextInteractionFlags(Qt::TextBrowserInteraction);
msgBox.exec(); msgBox.exec();
} }
@@ -321,22 +348,7 @@ bool startCreatorAsDebugger(bool asClient, QString *errorMessage)
bool readDefaultDebugger(QString *defaultDebugger, bool readDefaultDebugger(QString *defaultDebugger,
QString *errorMessage) QString *errorMessage)
{ {
bool success = false; return readDebugger(debuggerRegistryDefaultValueNameC, defaultDebugger, errorMessage);
HKEY handle;
const RegistryAccess::AccessMode accessMode = optIsWow
#ifdef Q_OS_WIN64
? RegistryAccess::Registry32Mode
#else
? RegistryAccess::Registry64Mode
#endif
: RegistryAccess::DefaultAccessMode;
if (openRegistryKey(HKEY_LOCAL_MACHINE, debuggerRegistryKeyC, false, &handle, accessMode, errorMessage)) {
success = registryReadStringKey(handle, debuggerRegistryDefaultValueNameC,
defaultDebugger, errorMessage);
RegCloseKey(handle);
}
return success;
} }
bool startDefaultDebugger(QString *errorMessage) bool startDefaultDebugger(QString *errorMessage)