From 033a3aba9bd3a6d30cb0a826039104d4fa749b17 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Nov 2010 16:29:00 +0100 Subject: [PATCH] debugger: simplify remoteCommand logic --- src/plugins/debugger/debuggerplugin.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 024a07eedbf..96715d2e655 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1539,7 +1539,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er m_uiSwitcher->createDockWidget(QmlLanguage, m_scriptConsoleWindow); m_scriptConsoleDock->setObjectName(QString(DOCKWIDGET_QML_SCRIPTCONSOLE)); - // Do not fail the whole plugin if something goes wrong here. + // Do not fail to load the whole plugin if something goes wrong here. uint cmdLineEnabledEngines = AllEngineTypes; if (!parseArguments(arguments, &m_attachRemoteParameters, &cmdLineEnabledEngines, errorMessage)) { @@ -3148,21 +3148,17 @@ void DebuggerPlugin::remoteCommand(const QStringList &options, const QStringList unsigned enabledEngines = 0; QString errorMessage; - bool success = false; - do { - if (!parseArguments(options, &d->m_attachRemoteParameters, &enabledEngines, &errorMessage)) - break; - - if (!d->attachCmdLine()) { - errorMessage = QString::fromLatin1("Incomplete remote attach command received: %1"). - arg(options.join(QString(QLatin1Char(' ')))); - break; - } - success = true; - } while (false); - if (!success) + if (!parseArguments(options, + &d->m_attachRemoteParameters, &enabledEngines, &errorMessage)) { qWarning("%s", qPrintable(errorMessage)); + return; + } + + if (!d->attachCmdLine()) + qWarning("%s", qPrintable( + _("Incomplete remote attach command received: %1"). + arg(options.join(QString(QLatin1Char(' ')))))); } void DebuggerPlugin::showQtDumperLibraryWarning(const QString &details) -- GitLab