summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-09-21 09:26:38 +0200
committerEike Ziller <eike.ziller@qt.io>2018-09-21 09:26:38 +0200
commitd3d47dd521253d89419231956a93a0d2b9db1656 (patch)
tree98a426472bc2350b3bcd42429fa67b06e1dd7703 /src/tools
parentb49175c86ac086798105765bcfc5d6b18ff32466 (diff)
parent3c8f8f1ffcc0669b0a31aca0f6fa138606bfa061 (diff)
downloadqt-creator-d3d47dd521253d89419231956a93a0d2b9db1656.tar.gz
Merge remote-tracking branch 'origin/4.7' into 4.8
Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri Change-Id: Ia1d6035a335fd56069ec8d6d106d58124ee8798d
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qtcdebugger/main.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/tools/qtcdebugger/main.cpp b/src/tools/qtcdebugger/main.cpp
index 7453c08afc..38507c8539 100644
--- a/src/tools/qtcdebugger/main.cpp
+++ b/src/tools/qtcdebugger/main.cpp
@@ -35,6 +35,7 @@
#include <QTextStream>
#include <QFileInfo>
#include <QByteArray>
+#include <QSysInfo>
#include <QString>
#include <QDir>
#include <QTime>
@@ -138,6 +139,26 @@ static bool parseArguments(const QStringList &args, QString *errorMessage)
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())
{
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>, "
<< "setting the new value to <pre>\"" << QDir::toNativeSeparators(binary) << "\" -wow %ld %ld</pre></p>"
<< "<p>How to run a command with administrative privileges:</p>"
- << "<pre>runas /env /noprofile /user:Administrator \"command arguments\"</pre>"
- << "</body></html>";
+ << "<pre>runas /env /noprofile /user:Administrator \"command arguments\"</pre>";
+ 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);
+ msgBox.setTextInteractionFlags(Qt::TextBrowserInteraction);
msgBox.exec();
}
@@ -321,22 +348,7 @@ bool startCreatorAsDebugger(bool asClient, QString *errorMessage)
bool readDefaultDebugger(QString *defaultDebugger,
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, debuggerRegistryDefaultValueNameC,
- defaultDebugger, errorMessage);
- RegCloseKey(handle);
- }
- return success;
+ return readDebugger(debuggerRegistryDefaultValueNameC, defaultDebugger, errorMessage);
}
bool startDefaultDebugger(QString *errorMessage)