forked from qt-creator/qt-creator
QmlProfiler: qmlproject support
Reviewed-by: Kai Koehne
This commit is contained in:
@@ -255,9 +255,8 @@ AnalyzerManager::AnalyzerManagerPrivate::AnalyzerManagerPrivate(AnalyzerManager
|
|||||||
{
|
{
|
||||||
m_toolBox->setObjectName(QLatin1String("AnalyzerManagerToolBox"));
|
m_toolBox->setObjectName(QLatin1String("AnalyzerManagerToolBox"));
|
||||||
m_runControlFactory = new AnalyzerRunControlFactory();
|
m_runControlFactory = new AnalyzerRunControlFactory();
|
||||||
AnalyzerPlugin::instance()->addAutoReleasedObject(m_runControlFactory);
|
|
||||||
connect(m_runControlFactory, SIGNAL(runControlCreated(Analyzer::AnalyzerRunControl *)),
|
q->registerRunControlFactory(m_runControlFactory);
|
||||||
q, SLOT(runControlCreated(Analyzer::AnalyzerRunControl *)));
|
|
||||||
|
|
||||||
connect(m_toolBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_toolBox, SIGNAL(currentIndexChanged(int)),
|
||||||
q, SLOT(toolSelected(int)));
|
q, SLOT(toolSelected(int)));
|
||||||
@@ -275,6 +274,13 @@ AnalyzerManager::AnalyzerManagerPrivate::~AnalyzerManagerPrivate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnalyzerManager::registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory)
|
||||||
|
{
|
||||||
|
AnalyzerPlugin::instance()->addAutoReleasedObject(factory);
|
||||||
|
connect(factory, SIGNAL(runControlCreated(Analyzer::AnalyzerRunControl *)),
|
||||||
|
this, SLOT(runControlCreated(Analyzer::AnalyzerRunControl *)));
|
||||||
|
}
|
||||||
|
|
||||||
void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#define ANALYZERMANAGER_H
|
#define ANALYZERMANAGER_H
|
||||||
|
|
||||||
#include "analyzerbase_global.h"
|
#include "analyzerbase_global.h"
|
||||||
|
#include "projectexplorer/runconfiguration.h"
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ public:
|
|||||||
~AnalyzerManager();
|
~AnalyzerManager();
|
||||||
|
|
||||||
static AnalyzerManager *instance();
|
static AnalyzerManager *instance();
|
||||||
|
void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||||
|
|
||||||
bool isInitialized() const;
|
bool isInitialized() const;
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
@@ -45,7 +45,6 @@
|
|||||||
#include <QtGui/QVBoxLayout>
|
#include <QtGui/QVBoxLayout>
|
||||||
|
|
||||||
using namespace Analyzer;
|
using namespace Analyzer;
|
||||||
using namespace Analyzer::Internal;
|
|
||||||
|
|
||||||
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
|
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
|
||||||
: m_detailsWidget(new Utils::DetailsWidget(this))
|
: m_detailsWidget(new Utils::DetailsWidget(this))
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#define ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
#define ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
#include <analyzerbase/analyzerbase_global.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
@@ -51,9 +52,7 @@ namespace Analyzer {
|
|||||||
|
|
||||||
class AnalyzerSettings;
|
class AnalyzerSettings;
|
||||||
|
|
||||||
namespace Internal {
|
class ANALYZER_EXPORT AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||||
|
|
||||||
class AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -68,7 +67,6 @@ private:
|
|||||||
Utils::DetailsWidget *m_detailsWidget;
|
Utils::DetailsWidget *m_detailsWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
#endif // ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||||
|
@@ -272,7 +272,8 @@ plugin_analyzerbase.depends += plugin_projectexplorer
|
|||||||
|
|
||||||
plugin_qmlprofiler.subdir = qmlprofiler
|
plugin_qmlprofiler.subdir = qmlprofiler
|
||||||
plugin_qmlprofiler.depends = plugin_coreplugin
|
plugin_qmlprofiler.depends = plugin_coreplugin
|
||||||
plugin_qmlprofiler.depends = plugin_analyzerbase
|
plugin_qmlprofiler.depends += plugin_analyzerbase
|
||||||
|
plugin_qmlprofiler.depends += plugin_qmlprojectmanager
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin_qmljstools.subdir = qmljstools
|
plugin_qmljstools.subdir = qmljstools
|
||||||
|
@@ -6,6 +6,7 @@ DEFINES += PROFILER_LIBRARY
|
|||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(../../plugins/coreplugin/coreplugin.pri)
|
include(../../plugins/coreplugin/coreplugin.pri)
|
||||||
include(../../plugins/analyzerbase/analyzerbase.pri)
|
include(../../plugins/analyzerbase/analyzerbase.pri)
|
||||||
|
include(../../plugins/qmlprojectmanager/qmlprojectmanager.pri)
|
||||||
|
|
||||||
|
|
||||||
QT += network script declarative
|
QT += network script declarative
|
||||||
@@ -20,7 +21,8 @@ SOURCES += \
|
|||||||
tracewindow.cpp \
|
tracewindow.cpp \
|
||||||
timelineview.cpp \
|
timelineview.cpp \
|
||||||
qmlprofilerattachdialog.cpp \
|
qmlprofilerattachdialog.cpp \
|
||||||
qmlprofilersummaryview.cpp
|
qmlprofilersummaryview.cpp \
|
||||||
|
qmlprojectanalyzerruncontrolfactory.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
qmlprofilerconstants.h \
|
qmlprofilerconstants.h \
|
||||||
@@ -31,7 +33,8 @@ HEADERS += \
|
|||||||
tracewindow.h \
|
tracewindow.h \
|
||||||
timelineview.h \
|
timelineview.h \
|
||||||
qmlprofilerattachdialog.h \
|
qmlprofilerattachdialog.h \
|
||||||
qmlprofilersummaryview.h
|
qmlprofilersummaryview.h \
|
||||||
|
qmlprojectanalyzerruncontrolfactory.h
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
qml/qml.qrc
|
qml/qml.qrc
|
||||||
|
@@ -39,8 +39,6 @@
|
|||||||
#include <analyzerbase/analyzermanager.h>
|
#include <analyzerbase/analyzermanager.h>
|
||||||
#include <analyzerbase/analyzerconstants.h>
|
#include <analyzerbase/analyzerconstants.h>
|
||||||
|
|
||||||
#include <projectexplorer/applicationrunconfiguration.h>
|
|
||||||
|
|
||||||
#include <private/qdeclarativedebugclient_p.h>
|
#include <private/qdeclarativedebugclient_p.h>
|
||||||
|
|
||||||
#include "timelineview.h"
|
#include "timelineview.h"
|
||||||
@@ -52,9 +50,7 @@
|
|||||||
#include "canvas/qdeclarativecontext2d_p.h"
|
#include "canvas/qdeclarativecontext2d_p.h"
|
||||||
#include "canvas/qdeclarativetiledcanvas_p.h"
|
#include "canvas/qdeclarativetiledcanvas_p.h"
|
||||||
|
|
||||||
#include <utils/environment.h>
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include "tracewindow.h"
|
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
#include <unistd.h> // sleep
|
#include <unistd.h> // sleep
|
||||||
@@ -73,11 +69,7 @@ public:
|
|||||||
|
|
||||||
QmlProfilerEngine *q;
|
QmlProfilerEngine *q;
|
||||||
|
|
||||||
QString m_workingDirectory;
|
Analyzer::AnalyzerStartParameters m_params;
|
||||||
QString m_executable;
|
|
||||||
QString m_commandLineArguments;
|
|
||||||
Utils::Environment m_environment;
|
|
||||||
|
|
||||||
QProcess *m_process;
|
QProcess *m_process;
|
||||||
bool m_running;
|
bool m_running;
|
||||||
bool m_fetchingData;
|
bool m_fetchingData;
|
||||||
@@ -87,16 +79,7 @@ QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp
|
|||||||
: IAnalyzerEngine(sp, runConfiguration)
|
: IAnalyzerEngine(sp, runConfiguration)
|
||||||
, d(new QmlProfilerEnginePrivate(this))
|
, d(new QmlProfilerEnginePrivate(this))
|
||||||
{
|
{
|
||||||
ProjectExplorer::LocalApplicationRunConfiguration *localAppConfig =
|
d->m_params = sp;
|
||||||
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration);
|
|
||||||
|
|
||||||
if (!localAppConfig)
|
|
||||||
return;
|
|
||||||
|
|
||||||
d->m_workingDirectory = localAppConfig->workingDirectory();
|
|
||||||
d->m_executable = localAppConfig->executable();
|
|
||||||
d->m_commandLineArguments = localAppConfig->commandLineArguments();
|
|
||||||
d->m_environment = localAppConfig->environment();
|
|
||||||
d->m_process = 0;
|
d->m_process = 0;
|
||||||
d->m_running = false;
|
d->m_running = false;
|
||||||
d->m_fetchingData = false;
|
d->m_fetchingData = false;
|
||||||
@@ -165,8 +148,10 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor()
|
|||||||
m_process = new QProcess();
|
m_process = new QProcess();
|
||||||
|
|
||||||
QStringList arguments("-qmljsdebugger=port:" + QString::number(QmlProfilerTool::port) + ",block");
|
QStringList arguments("-qmljsdebugger=port:" + QString::number(QmlProfilerTool::port) + ",block");
|
||||||
|
arguments.append(m_params.debuggeeArgs.split(" "));
|
||||||
|
|
||||||
if (QmlProfilerPlugin::debugOutput)
|
if (QmlProfilerPlugin::debugOutput)
|
||||||
qWarning("QmlProfiler: Launching %s", qPrintable(m_executable));
|
qWarning("QmlProfiler: Launching %s", qPrintable(m_params.displayName));
|
||||||
|
|
||||||
if (qtquick1) {
|
if (qtquick1) {
|
||||||
QProcessEnvironment env;
|
QProcessEnvironment env;
|
||||||
@@ -175,16 +160,16 @@ bool QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_process->setProcessChannelMode(QProcess::ForwardedChannels);
|
m_process->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||||
m_process->setWorkingDirectory(m_workingDirectory);
|
m_process->setWorkingDirectory(m_params.workingDirectory);
|
||||||
connect(m_process,SIGNAL(finished(int)),q,SLOT(spontaneousStop()));
|
connect(m_process,SIGNAL(finished(int)),q,SLOT(spontaneousStop()));
|
||||||
m_process->start(m_executable, arguments);
|
m_process->start(m_params.debuggee, arguments);
|
||||||
|
|
||||||
// give the process time to start
|
// give the process time to start
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
if (!m_process->waitForStarted()) {
|
if (!m_process->waitForStarted()) {
|
||||||
if (QmlProfilerPlugin::debugOutput)
|
if (QmlProfilerPlugin::debugOutput)
|
||||||
qWarning("QmlProfiler: %s failed to start", qPrintable(m_executable));
|
qWarning("QmlProfiler: %s failed to start", qPrintable(m_params.displayName));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "qmlprofilerplugin.h"
|
#include "qmlprofilerplugin.h"
|
||||||
#include "qmlprofilerconstants.h"
|
#include "qmlprofilerconstants.h"
|
||||||
|
#include "qmlprojectanalyzerruncontrolfactory.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
@@ -68,6 +69,7 @@ public:
|
|||||||
|
|
||||||
void initialize(const QStringList &arguments, QString *errorString);
|
void initialize(const QStringList &arguments, QString *errorString);
|
||||||
|
|
||||||
|
QmlProjectAnalyzerRunControlFactory *m_runControlFactory;
|
||||||
QmlProfilerPlugin *q;
|
QmlProfilerPlugin *q;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -76,7 +78,8 @@ void QmlProfilerPlugin::QmlProfilerPluginPrivate::initialize(const QStringList &
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorString)
|
Q_UNUSED(errorString)
|
||||||
|
|
||||||
// AnalyzerManager::instance()->addTool(new MemcheckTool(this));
|
m_runControlFactory = new QmlProjectAnalyzerRunControlFactory();
|
||||||
|
Analyzer::AnalyzerManager::instance()->registerRunControlFactory(m_runControlFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
123
src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp
Normal file
123
src/plugins/qmlprofiler/qmlprojectanalyzerruncontrolfactory.cpp
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** No Commercial Usage
|
||||||
|
**
|
||||||
|
** This file contains pre-release code and may not be distributed.
|
||||||
|
** You may use this file in accordance with the terms and conditions
|
||||||
|
** contained in the Technology Preview License Agreement accompanying
|
||||||
|
** this package.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#include "qmlprojectanalyzerruncontrolfactory.h"
|
||||||
|
#include "qmlprojectmanager/qmlprojectrunconfiguration.h"
|
||||||
|
#include <analyzerbase/analyzerstartparameters.h>
|
||||||
|
#include <analyzerbase/analyzersettings.h>
|
||||||
|
#include <analyzerbase/analyzerrunconfigwidget.h>
|
||||||
|
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
using namespace Analyzer;
|
||||||
|
using namespace ProjectExplorer;
|
||||||
|
using namespace QmlProfiler::Internal;
|
||||||
|
|
||||||
|
AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
|
{
|
||||||
|
AnalyzerStartParameters sp;
|
||||||
|
QTC_ASSERT(runConfiguration, return sp);
|
||||||
|
QmlProjectManager::QmlProjectRunConfiguration *rc =
|
||||||
|
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
|
||||||
|
QTC_ASSERT(rc, return sp);
|
||||||
|
|
||||||
|
sp.startMode = StartLocal;
|
||||||
|
sp.environment = rc->environment();
|
||||||
|
sp.workingDirectory = rc->workingDirectory();
|
||||||
|
sp.debuggee = rc->observerPath();
|
||||||
|
sp.debuggeeArgs = rc->viewerArguments();
|
||||||
|
sp.displayName = rc->displayName();
|
||||||
|
return sp;
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlProjectAnalyzerRunControlFactory::QmlProjectAnalyzerRunControlFactory(QObject *parent)
|
||||||
|
: IRunControlFactory(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlProjectAnalyzerRunControlFactory::~QmlProjectAnalyzerRunControlFactory()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QmlProjectAnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
|
||||||
|
{
|
||||||
|
if (!qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration))
|
||||||
|
return false;
|
||||||
|
return mode == Constants::MODE_ANALYZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RunControl *QmlProjectAnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
|
||||||
|
{
|
||||||
|
if (!qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration) ||
|
||||||
|
mode != Constants::MODE_ANALYZE) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const AnalyzerStartParameters sp = localStartParameters(runConfiguration);
|
||||||
|
return create(sp, runConfiguration);
|
||||||
|
}
|
||||||
|
|
||||||
|
AnalyzerRunControl *QmlProjectAnalyzerRunControlFactory::create(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||||
|
{
|
||||||
|
AnalyzerRunControl *rc = new AnalyzerRunControl(sp, runConfiguration);
|
||||||
|
emit runControlCreated(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QmlProjectAnalyzerRunControlFactory::displayName() const
|
||||||
|
{
|
||||||
|
return tr("QmlAnalyzer");
|
||||||
|
}
|
||||||
|
|
||||||
|
IRunConfigurationAspect *QmlProjectAnalyzerRunControlFactory::createRunConfigurationAspect()
|
||||||
|
{
|
||||||
|
return new AnalyzerProjectSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
RunConfigWidget *QmlProjectAnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||||
|
{
|
||||||
|
QmlProjectManager::QmlProjectRunConfiguration *localRc =
|
||||||
|
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
|
||||||
|
if (!localRc)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
AnalyzerProjectSettings *settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||||
|
if (!settings)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
Analyzer::AnalyzerRunConfigWidget *ret = new Analyzer::AnalyzerRunConfigWidget;
|
||||||
|
ret->setRunConfiguration(runConfiguration);
|
||||||
|
return ret;
|
||||||
|
// return 0;
|
||||||
|
}
|
@@ -0,0 +1,69 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** No Commercial Usage
|
||||||
|
**
|
||||||
|
** This file contains pre-release code and may not be distributed.
|
||||||
|
** You may use this file in accordance with the terms and conditions
|
||||||
|
** contained in the Technology Preview License Agreement accompanying
|
||||||
|
** this package.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QMLPROJECTANALYZERRUNCONTROLFACTORY_H
|
||||||
|
#define QMLPROJECTANALYZERRUNCONTROLFACTORY_H
|
||||||
|
|
||||||
|
#include <analyzerbase/analyzerruncontrol.h>
|
||||||
|
//#include <analyzerbase/analyzerruncontrolfactory.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
|
namespace QmlProfiler {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class QmlProjectAnalyzerRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
||||||
|
|
||||||
|
QmlProjectAnalyzerRunControlFactory(QObject *parent = 0);
|
||||||
|
~QmlProjectAnalyzerRunControlFactory();
|
||||||
|
|
||||||
|
// virtuals from IRunControlFactory
|
||||||
|
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
|
||||||
|
ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
|
||||||
|
Analyzer::AnalyzerRunControl *create(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration = 0);
|
||||||
|
QString displayName() const;
|
||||||
|
|
||||||
|
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||||
|
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void runControlCreated(Analyzer::AnalyzerRunControl *);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QMLPROJECTANALYZERRUNCONTROLFACTORY_H
|
@@ -152,6 +152,8 @@ bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
|||||||
qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
|
qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
|
||||||
if (mode == ProjectExplorer::Constants::RUNMODE)
|
if (mode == ProjectExplorer::Constants::RUNMODE)
|
||||||
return config != 0 && !config->viewerPath().isEmpty();
|
return config != 0 && !config->viewerPath().isEmpty();
|
||||||
|
else if (mode != Debugger::Constants::DEBUGMODE)
|
||||||
|
return false;
|
||||||
|
|
||||||
bool qmlDebugSupportInstalled =
|
bool qmlDebugSupportInstalled =
|
||||||
Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage);
|
Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage);
|
||||||
|
Reference in New Issue
Block a user