forked from qt-creator/qt-creator
Add error string to IRunControlFactory::createRunControl
And add a few helpful error messages Task-number: QTCREATORBUG-7826 Change-Id: Ia9f9fa476cecf2cff198bc460408bc062e119338 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
committed by
Friedemann Kleint
parent
c5097ed183
commit
7657dd3a47
@@ -68,11 +68,14 @@ bool AnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode)
|
RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode);
|
IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode);
|
||||||
if (!tool)
|
if (!tool) {
|
||||||
|
if (errorMessage)
|
||||||
|
*errorMessage = tr("No analyzer tool selected"); // never happens
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ public:
|
|||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
||||||
ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode,
|
||||||
|
QString *errorMessage);
|
||||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
|
|||||||
return paths.toList();
|
return paths.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig)
|
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Target *target = runConfig->target();
|
Target *target = runConfig->target();
|
||||||
Qt4Project *project = static_cast<Qt4Project *>(target->project());
|
Qt4Project *project = static_cast<Qt4Project *>(target->project());
|
||||||
@@ -119,7 +119,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
|||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunControl * const debuggerRunControl
|
DebuggerRunControl * const debuggerRunControl
|
||||||
= DebuggerPlugin::createDebugger(params, runConfig);
|
= DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
|
||||||
new AndroidDebugSupport(runConfig, debuggerRunControl);
|
new AndroidDebugSupport(runConfig, debuggerRunControl);
|
||||||
return debuggerRunControl;
|
return debuggerRunControl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ class AndroidDebugSupport : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig);
|
static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig,
|
||||||
|
QString *errorMessage);
|
||||||
|
|
||||||
AndroidDebugSupport(AndroidRunConfiguration *runConfig,
|
AndroidDebugSupport(AndroidRunConfiguration *runConfig,
|
||||||
Debugger::DebuggerRunControl *runControl);
|
Debugger::DebuggerRunControl *runControl);
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
|||||||
}
|
}
|
||||||
|
|
||||||
RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
|
RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
|
||||||
ProjectExplorer::RunMode mode)
|
ProjectExplorer::RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRun(runConfig, mode));
|
Q_ASSERT(canRun(runConfig, mode));
|
||||||
AndroidRunConfiguration *rc = qobject_cast<AndroidRunConfiguration *>(runConfig);
|
AndroidRunConfiguration *rc = qobject_cast<AndroidRunConfiguration *>(runConfig);
|
||||||
@@ -179,7 +179,7 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
|
|||||||
if (mode == NormalRunMode)
|
if (mode == NormalRunMode)
|
||||||
return new AndroidRunControl(rc);
|
return new AndroidRunControl(rc);
|
||||||
else
|
else
|
||||||
return AndroidDebugSupport::createDebugRunControl(rc);
|
return AndroidDebugSupport::createDebugRunControl(rc, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidRunControlFactory::displayName() const
|
QString AndroidRunControlFactory::displayName() const
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ public:
|
|||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode,
|
||||||
|
QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -3387,9 +3387,9 @@ void DebuggerPlugin::remoteCommand(const QStringList &options,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunControl *DebuggerPlugin::createDebugger
|
DebuggerRunControl *DebuggerPlugin::createDebugger
|
||||||
(const DebuggerStartParameters &sp, RunConfiguration *rc)
|
(const DebuggerStartParameters &sp, RunConfiguration *rc, QString *errorMessage)
|
||||||
{
|
{
|
||||||
return DebuggerRunControlFactory::doCreate(sp, rc);
|
return DebuggerRunControlFactory::doCreate(sp, rc, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::extensionsInitialized()
|
void DebuggerPlugin::extensionsInitialized()
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ public:
|
|||||||
static QAction *visibleDebugAction();
|
static QAction *visibleDebugAction();
|
||||||
|
|
||||||
static DebuggerRunControl *createDebugger(const DebuggerStartParameters &sp,
|
static DebuggerRunControl *createDebugger(const DebuggerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *rc);
|
ProjectExplorer::RunConfiguration *rc,
|
||||||
|
QString *errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// IPlugin implementation.
|
// IPlugin implementation.
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ public:
|
|||||||
// FIXME: Used by qmljsinspector.cpp:469
|
// FIXME: Used by qmljsinspector.cpp:469
|
||||||
ProjectExplorer::RunControl *create(
|
ProjectExplorer::RunControl *create(
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode,
|
||||||
|
QString *errorMessage);
|
||||||
|
|
||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
@@ -64,7 +65,7 @@ public:
|
|||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||||
|
|
||||||
static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
|
static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *rc);
|
ProjectExplorer::RunConfiguration *rc, QString *errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|||||||
@@ -543,8 +543,9 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
|||||||
}
|
}
|
||||||
|
|
||||||
RunControl *DebuggerRunControlFactory::create
|
RunControl *DebuggerRunControlFactory::create
|
||||||
(RunConfiguration *runConfiguration, RunMode mode)
|
(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(errorMessage)
|
||||||
QTC_ASSERT(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain, return 0);
|
QTC_ASSERT(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain, return 0);
|
||||||
DebuggerStartParameters sp = localStartParameters(runConfiguration);
|
DebuggerStartParameters sp = localStartParameters(runConfiguration);
|
||||||
if (sp.startMode == NoStartMode)
|
if (sp.startMode == NoStartMode)
|
||||||
@@ -552,7 +553,7 @@ RunControl *DebuggerRunControlFactory::create
|
|||||||
if (mode == DebugRunModeWithBreakOnMain)
|
if (mode == DebugRunModeWithBreakOnMain)
|
||||||
sp.breakOnMain = true;
|
sp.breakOnMain = true;
|
||||||
|
|
||||||
return doCreate(sp, runConfiguration);
|
return doCreate(sp, runConfiguration, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DebuggerEngineType guessUnixCppEngineType(const DebuggerStartParameters &sp)
|
static DebuggerEngineType guessUnixCppEngineType(const DebuggerStartParameters &sp)
|
||||||
@@ -644,8 +645,9 @@ static void fixupEngineTypes(DebuggerStartParameters &sp, RunConfiguration *rc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunControl *DebuggerRunControlFactory::doCreate
|
DebuggerRunControl *DebuggerRunControlFactory::doCreate
|
||||||
(const DebuggerStartParameters &sp0, RunConfiguration *rc)
|
(const DebuggerStartParameters &sp0, RunConfiguration *rc, QString *errorMessage)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(errorMessage);
|
||||||
DebuggerStartParameters sp = sp0;
|
DebuggerStartParameters sp = sp0;
|
||||||
if (!debuggerCore()->boolSetting(AutoEnrichParameters)) {
|
if (!debuggerCore()->boolSetting(AutoEnrichParameters)) {
|
||||||
const QString sysroot = sp.sysRoot;
|
const QString sysroot = sp.sysRoot;
|
||||||
@@ -663,8 +665,9 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
|
|||||||
}
|
}
|
||||||
|
|
||||||
fixupEngineTypes(sp, rc);
|
fixupEngineTypes(sp, rc);
|
||||||
if (!sp.masterEngineType)
|
if (!sp.masterEngineType) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return new DebuggerRunControl(rc, sp);
|
return new DebuggerRunControl(rc, sp);
|
||||||
}
|
}
|
||||||
@@ -672,9 +675,12 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
|
|||||||
DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
|
DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
|
||||||
(const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
|
(const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
DebuggerRunControl *rc = doCreate(sp, runConfiguration);
|
QString errorMessage;
|
||||||
if (!rc)
|
DebuggerRunControl *rc = doCreate(sp, runConfiguration, &errorMessage);
|
||||||
|
if (!rc) {
|
||||||
|
ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
debuggerCore()->showMessage(sp.startMessage, 0);
|
debuggerCore()->showMessage(sp.startMessage, 0);
|
||||||
ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode);
|
ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode);
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode
|
|||||||
return maemoRunConfig->hasEnoughFreePorts(mode);
|
return maemoRunConfig->hasEnoughFreePorts(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
|
RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRun(runConfig, mode));
|
Q_ASSERT(canRun(runConfig, mode));
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
const DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
|
const DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
|
||||||
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
|
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
|
||||||
if (!runControl)
|
if (!runControl)
|
||||||
return 0;
|
return 0;
|
||||||
LinuxDeviceDebugSupport * const debugSupport
|
LinuxDeviceDebugSupport * const debugSupport
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ public:
|
|||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
||||||
RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode);
|
RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
|
ProjectExplorer::RunMode mode,
|
||||||
|
QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -61,13 +61,16 @@ QString LocalApplicationRunControlFactory::displayName() const
|
|||||||
return tr("Run");
|
return tr("Run");
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode)
|
RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||||
LocalApplicationRunConfiguration *localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
LocalApplicationRunConfiguration *localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||||
// Force the dialog about executables at this point and fail if there is none
|
// Force the dialog about executables at this point and fail if there is none
|
||||||
if (localRunConfiguration->executable().isEmpty())
|
if (localRunConfiguration->executable().isEmpty()) {
|
||||||
|
if (errorMessage)
|
||||||
|
*errorMessage = tr("No executable");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return new LocalApplicationRunControl(localRunConfiguration, mode);
|
return new LocalApplicationRunControl(localRunConfiguration, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
virtual ~LocalApplicationRunControlFactory();
|
virtual ~LocalApplicationRunControlFactory();
|
||||||
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const;
|
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const;
|
||||||
virtual QString displayName() const;
|
virtual QString displayName() const;
|
||||||
virtual RunControl* create(RunConfiguration *runConfiguration, RunMode mode);
|
virtual RunControl* create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
class LocalApplicationRunControl : public RunControl
|
class LocalApplicationRunControl : public RunControl
|
||||||
|
|||||||
@@ -1576,13 +1576,29 @@ void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfigu
|
|||||||
if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) {
|
if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) {
|
||||||
emit aboutToExecuteProject(runConfiguration->target()->project(), runMode);
|
emit aboutToExecuteProject(runConfiguration->target()->project(), runMode);
|
||||||
|
|
||||||
RunControl *control = runControlFactory->create(runConfiguration, runMode);
|
QString errorMessage;
|
||||||
if (!control)
|
RunControl *control = runControlFactory->create(runConfiguration, runMode, &errorMessage);
|
||||||
|
if (!control) {
|
||||||
|
showRunErrorMessage(errorMessage);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
startRunControl(control, runMode);
|
startRunControl(control, runMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProjectExplorerPlugin::showRunErrorMessage(const QString &errorMessage)
|
||||||
|
{
|
||||||
|
if (errorMessage.isNull()) {
|
||||||
|
// a error occured, but message was not set
|
||||||
|
QMessageBox::critical(Core::ICore::mainWindow(), tr("Unknown error"), errorMessage);
|
||||||
|
} else if (errorMessage.isEmpty()) {
|
||||||
|
// a error, but the message was set to empty
|
||||||
|
// hack for qml observer warning, show nothing at all
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(Core::ICore::mainWindow(), tr("Could Not Run"), errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runMode)
|
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runMode)
|
||||||
{
|
{
|
||||||
d->m_outputPane->createNewOutputWindow(runControl);
|
d->m_outputPane->createNewOutputWindow(runControl);
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public:
|
|||||||
Internal::ProjectExplorerSettings projectExplorerSettings() const;
|
Internal::ProjectExplorerSettings projectExplorerSettings() const;
|
||||||
|
|
||||||
void startRunControl(RunControl *runControl, RunMode runMode);
|
void startRunControl(RunControl *runControl, RunMode runMode);
|
||||||
|
static void showRunErrorMessage(const QString &errorMessage);
|
||||||
|
|
||||||
// internal public for FlatModel
|
// internal public for FlatModel
|
||||||
void renameFile(Node *node, const QString &to);
|
void renameFile(Node *node, const QString &to);
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ public:
|
|||||||
virtual ~IRunControlFactory();
|
virtual ~IRunControlFactory();
|
||||||
|
|
||||||
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const = 0;
|
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const = 0;
|
||||||
virtual RunControl *create(RunConfiguration *runConfiguration, RunMode mode) = 0;
|
virtual RunControl *create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) = 0;
|
||||||
|
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
|||||||
}
|
}
|
||||||
|
|
||||||
RunControl *QmlProjectRunControlFactory::create(RunConfiguration *runConfiguration,
|
RunControl *QmlProjectRunControlFactory::create(RunConfiguration *runConfiguration,
|
||||||
RunMode mode)
|
RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||||
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration *>(runConfiguration);
|
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration *>(runConfiguration);
|
||||||
@@ -187,7 +187,7 @@ RunControl *QmlProjectRunControlFactory::create(RunConfiguration *runConfigurati
|
|||||||
if (mode == NormalRunMode)
|
if (mode == NormalRunMode)
|
||||||
runControl = new QmlProjectRunControl(config, mode);
|
runControl = new QmlProjectRunControl(config, mode);
|
||||||
else if (mode == DebugRunMode)
|
else if (mode == DebugRunMode)
|
||||||
runControl = createDebugRunControl(config);
|
runControl = createDebugRunControl(config, errorMessage);
|
||||||
return runControl;
|
return runControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ QString QmlProjectRunControlFactory::displayName() const
|
|||||||
return tr("Run");
|
return tr("Run");
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig)
|
RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Debugger::DebuggerStartParameters params;
|
Debugger::DebuggerStartParameters params;
|
||||||
params.startMode = Debugger::StartInternal;
|
params.startMode = Debugger::StartInternal;
|
||||||
@@ -224,10 +224,11 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
|
|||||||
|
|
||||||
if (params.executable.isEmpty()) {
|
if (params.executable.isEmpty()) {
|
||||||
QmlProjectPlugin::showQmlObserverToolWarning();
|
QmlProjectPlugin::showQmlObserverToolWarning();
|
||||||
|
*errorMessage = QString(""); // hack, we already showed a error message
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Debugger::DebuggerPlugin::createDebugger(params, runConfig);
|
return Debugger::DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -77,11 +77,12 @@ public:
|
|||||||
|
|
||||||
// IRunControlFactory
|
// IRunControlFactory
|
||||||
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
|
||||||
virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode);
|
virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
|
ProjectExplorer::RunMode mode, QString *errorMessage);
|
||||||
virtual QString displayName() const;
|
virtual QString displayName() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig);
|
ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig, QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -82,9 +82,8 @@ bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runC
|
|||||||
return activeDeployConf != 0;
|
return activeDeployConf != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
|
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunMode mode, QString *errorMessage)
|
||||||
ProjectExplorer::RunMode mode)
|
|
||||||
{
|
{
|
||||||
BlackBerryRunConfiguration *rc = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
|
BlackBerryRunConfiguration *rc = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
@@ -92,8 +91,11 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
|
|||||||
|
|
||||||
BlackBerryDeployConfiguration *activeDeployConf = qobject_cast<BlackBerryDeployConfiguration *>(
|
BlackBerryDeployConfiguration *activeDeployConf = qobject_cast<BlackBerryDeployConfiguration *>(
|
||||||
rc->target()->activeDeployConfiguration());
|
rc->target()->activeDeployConfiguration());
|
||||||
if (!activeDeployConf)
|
if (!activeDeployConf) {
|
||||||
|
if (errorMessage)
|
||||||
|
*errorMessage = tr("No active deploy configuration");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (mode == ProjectExplorer::NormalRunMode) {
|
if (mode == ProjectExplorer::NormalRunMode) {
|
||||||
BlackBerryRunControl *runControl = new BlackBerryRunControl(rc);
|
BlackBerryRunControl *runControl = new BlackBerryRunControl(rc);
|
||||||
@@ -102,7 +104,7 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Debugger::DebuggerRunControl * const runControl =
|
Debugger::DebuggerRunControl * const runControl =
|
||||||
Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration);
|
Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage);
|
||||||
if (!runControl)
|
if (!runControl)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ public:
|
|||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode,
|
||||||
|
QString *errorMessage);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mo
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
|
RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRun(runConfig, mode));
|
Q_ASSERT(canRun(runConfig, mode));
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
|
|||||||
return new QnxRunControl(rc);
|
return new QnxRunControl(rc);
|
||||||
|
|
||||||
const DebuggerStartParameters params = createStartParameters(rc);
|
const DebuggerStartParameters params = createStartParameters(rc);
|
||||||
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
|
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
|
||||||
if (!runControl)
|
if (!runControl)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode, QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
|
RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRun(runConfig, mode));
|
Q_ASSERT(canRun(runConfig, mode));
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
|
|||||||
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
|
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
|
||||||
if (mode == ProjectExplorer::DebugRunModeWithBreakOnMain)
|
if (mode == ProjectExplorer::DebugRunModeWithBreakOnMain)
|
||||||
params.breakOnMain = true;
|
params.breakOnMain = true;
|
||||||
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
|
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
|
||||||
if (!runControl)
|
if (!runControl)
|
||||||
return 0;
|
return 0;
|
||||||
LinuxDeviceDebugSupport * const debugSupport =
|
LinuxDeviceDebugSupport * const debugSupport =
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode);
|
ProjectExplorer::RunMode mode, QString *errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user