summaryrefslogtreecommitdiff
path: root/src/tools/qtcdebugger/main.cpp
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2010-01-14 18:45:35 +0100
committercon <qtc-committer@nokia.com>2010-01-14 18:45:35 +0100
commit24d592d8fab6a8e74e77c2e7bb578f023b979066 (patch)
tree87a62712417b3f9e4aabf09aaebabf5dcc98c6a3 /src/tools/qtcdebugger/main.cpp
parent00142e4cf49450723acfdfe4514afb8a3dfb8d0d (diff)
parentcd8bc8a207fce7c019facbd26bbbbb818116b821 (diff)
downloadqt-creator-24d592d8fab6a8e74e77c2e7bb578f023b979066.tar.gz
Merge remote branch 'origin/1.3'
Conflicts: src/plugins/bineditor/bineditorplugin.cpp src/plugins/coreplugin/editormanager/editormanager.cpp src/plugins/debugger/gdb/gdbengine.cpp src/plugins/debugger/watchhandler.cpp
Diffstat (limited to 'src/tools/qtcdebugger/main.cpp')
-rw-r--r--src/tools/qtcdebugger/main.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tools/qtcdebugger/main.cpp b/src/tools/qtcdebugger/main.cpp
index 616fc82727..213b95e6d1 100644
--- a/src/tools/qtcdebugger/main.cpp
+++ b/src/tools/qtcdebugger/main.cpp
@@ -487,11 +487,12 @@ static bool registerDebuggerKey(const WCHAR *key,
// Save old key, which might be missing
QString oldDebugger;
registryReadStringKey(handle, debuggerRegistryValueNameC, &oldDebugger, errorMessage);
- if (oldDebugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive)) {
+ if (!oldDebugger.compare(call, Qt::CaseInsensitive)) {
*errorMessage = QLatin1String("The program is already registered as post mortem debugger.");
break;
}
- if (!registryWriteStringKey(handle, debuggerRegistryDefaultValueNameC, oldDebugger, errorMessage))
+ if (!(oldDebugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive)
+ || registryWriteStringKey(handle, debuggerRegistryDefaultValueNameC, oldDebugger, errorMessage)))
break;
if (debug)
qDebug() << "registering self as " << call;
@@ -516,7 +517,9 @@ bool install(QString *errorMessage)
}
// Unregister helper: Restore the original debugger key
-static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage)
+static bool unregisterDebuggerKey(const WCHAR *key,
+ const QString &call,
+ QString *errorMessage)
{
HKEY handle = 0;
bool success = false;
@@ -525,8 +528,7 @@ static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage)
break;
QString debugger;
registryReadStringKey(handle, debuggerRegistryValueNameC, &debugger, errorMessage);
- if (!(debugger.isEmpty()
- || debugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive))) {
+ if (!debugger.isEmpty() && debugger.compare(call, Qt::CaseInsensitive)) {
*errorMessage = QLatin1String("The program is not registered as post mortem debugger.");
break;
}
@@ -553,10 +555,10 @@ static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage)
bool uninstall(QString *errorMessage)
{
- if (!unregisterDebuggerKey(debuggerRegistryKeyC, errorMessage))
+ if (!unregisterDebuggerKey(debuggerRegistryKeyC, debuggerCall(), errorMessage))
return false;
#ifdef Q_OS_WIN64
- if (!unregisterDebuggerKey(debuggerWow32RegistryKeyC, errorMessage))
+ if (!unregisterDebuggerKey(debuggerWow32RegistryKeyC, debuggerCall(QLatin1String("-wow")), errorMessage))
return false;
#endif
return true;