From bcefb62a725be166d401331343c342241e57b559 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 16 Jun 2009 15:56:01 +0200 Subject: [PATCH] (un)install -> (un)register, add nogui mode for use in installer The nogui mode is required for the installer, to keep the noise low. Also, get rid of QApplication passing, as all methods we call are static anyway, which made the compiler complain about unreferenced formal parameters. Revieved-by: Friedemann Kleint --- src/tools/qtcdebugger/main.cpp | 82 ++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/src/tools/qtcdebugger/main.cpp b/src/tools/qtcdebugger/main.cpp index 80c39de8edf..0e65e6fdc3d 100644 --- a/src/tools/qtcdebugger/main.cpp +++ b/src/tools/qtcdebugger/main.cpp @@ -68,10 +68,11 @@ static inline QString wCharToQString(const WCHAR *w) { return QString::fromUtf16 #endif -enum Mode { HelpMode, InstallMode, UninstallMode, PromptMode, ForceCreatorMode, ForceDefaultMode }; +enum Mode { HelpMode, RegisterMode, UnregisterMode, PromptMode, ForceCreatorMode, ForceDefaultMode }; Mode optMode = PromptMode; bool optIsWow = false; +bool noguiMode = false; unsigned long argProcessId = 0; quint64 argWinCrashEvent = 0; @@ -113,12 +114,14 @@ static bool parseArguments(const QStringList &args, QString *errorMessage) optMode = ForceCreatorMode; } else if (arg == QLatin1String("default")) { optMode = ForceDefaultMode; - } else if (arg == QLatin1String("install")) { - optMode = InstallMode; - } else if (arg == QLatin1String("uninstall")) { - optMode = UninstallMode; + } else if (arg == QLatin1String("register")) { + optMode = RegisterMode; + } else if (arg == QLatin1String("unregister")) { + optMode = UnregisterMode; } else if (arg == QLatin1String("wow")) { optIsWow = true; + } else if (arg == QLatin1String("nogui")) { + noguiMode = true; } else { *errorMessage = QString::fromLatin1("Unexpected option: %1").arg(arg); return false; @@ -141,8 +144,8 @@ static bool parseArguments(const QStringList &args, QString *errorMessage) } switch (optMode) { case HelpMode: - case InstallMode: - case UninstallMode: + case RegisterMode: + case UnregisterMode: break; default: if (argProcessId == 0) { @@ -166,13 +169,14 @@ static void usage(const QString &binary, const QString &message = QString()) str << "" << message << ""; } str << "
"
-        << "Usage: " << QFileInfo(binary).baseName() << "[-wow] [-help|-?|qtcreator|default|install|uninstall] <process-id> <event-id>\n"
+        << "Usage: " << QFileInfo(binary).baseName() << "[-wow] [-help|-?|qtcreator|default|register|unregister] <process-id> <event-id>\n"
         << "Options: -help, -?   Display this help\n"
         << "         -qtcreator  Launch Qt Creator without prompting\n"
         << "         -default    Launch Default handler without prompting\n"
-        << "         -install    Install itself (requires administrative privileges)\n"
-        << "         -uninstall  Uninstall itself (requires administrative privileges)\n"
+        << "         -register   Register as post mortem debugger (requires administrative privileges)\n"
+        << "         -unregister Unregister as post mortem debugger (requires administrative privileges)\n"
         << "         -wow        Indicates Wow32 call\n"
+        << "         -nogui      Do not show error messages in popup windows\n"
         << "
" << "

To install, modify the registry key HKEY_LOCAL_MACHINE\\" << wCharToQString(debuggerRegistryKeyC) << ":