forked from qt-creator/qt-creator
Merge branch '2.3'
Conflicts: qtcreator.pri src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp src/plugins/remotelinux/maemodeploystepfactory.cpp src/plugins/remotelinux/maemodirectdeviceuploadstep.cpp Change-Id: I195163713145e72df20aec4ac9058f0c9158083e
This commit is contained in:
@@ -61,6 +61,8 @@ public:
|
||||
virtual void stop();
|
||||
virtual int debugPort() const;
|
||||
|
||||
bool hasExecutable() const { return !m_configuration.executable.isEmpty(); }
|
||||
|
||||
private slots:
|
||||
void spontaneousStop(int exitCode);
|
||||
|
||||
|
||||
@@ -173,6 +173,7 @@ Rectangle {
|
||||
property real elapsedTime;
|
||||
signal updateTimer;
|
||||
Timer {
|
||||
id: elapsedTimer
|
||||
property date startDate
|
||||
property bool reset: true
|
||||
running: connection.recording
|
||||
@@ -303,18 +304,34 @@ Rectangle {
|
||||
rangeDetails.line = line
|
||||
rangeDetails.type = Plotter.names[type]
|
||||
|
||||
var pos = mapToItem(rangeDetails.parent, x, y+height)
|
||||
var preferredX = Math.max(10, pos.x - rangeDetails.width/2)
|
||||
if (preferredX + rangeDetails.width > rangeDetails.parent.width)
|
||||
preferredX = rangeDetails.parent.width - rangeDetails.width
|
||||
var margin = 10;
|
||||
|
||||
var pos = mapToItem(rangeDetails.parent , x, y)
|
||||
var preferredX = pos.x + margin;
|
||||
|
||||
// if over the right side of the window, render it left to the given pos
|
||||
if (preferredX + rangeDetails.width + margin > rangeDetails.parent.width)
|
||||
preferredX = pos.x - rangeDetails.width - margin;
|
||||
|
||||
// if window too narrow, put it at least in "margin" pixels
|
||||
if (preferredX < margin)
|
||||
preferredX = margin;
|
||||
|
||||
rangeDetails.x = preferredX
|
||||
|
||||
var preferredY = pos.y - rangeDetails.height/2;
|
||||
if (preferredY + rangeDetails.height > root.height - 10)
|
||||
preferredY = root.height - 10 - rangeDetails.height;
|
||||
if (preferredY < 10)
|
||||
preferredY=10;
|
||||
// center on current item
|
||||
var preferredY = pos.y + height/2 - rangeDetails.height/2;
|
||||
|
||||
// if too low, put it over the bottom of the window
|
||||
if (preferredY + rangeDetails.height - margin > root.height)
|
||||
preferredY = root.height - rangeDetails.height - margin;
|
||||
|
||||
// but never above the top of the window
|
||||
if (preferredY < margin)
|
||||
preferredY = margin;
|
||||
|
||||
rangeDetails.y = preferredY;
|
||||
|
||||
rangeDetails.visible = true
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ Item {
|
||||
|
||||
property color lighterColor:"#cc80b2f6"
|
||||
property color darkerColor:"#cc6da1e8"
|
||||
property color gapColor: "#666da1e8"
|
||||
property real value: (canvas.canvasWindow.x + x) * Plotter.xScale(canvas)
|
||||
property real zoomWidth: 20
|
||||
onZoomWidthChanged: timeDisplayLabel.hideAll();
|
||||
@@ -62,8 +63,6 @@ Item {
|
||||
Rectangle {
|
||||
id: frame
|
||||
color:"transparent"
|
||||
border.width: 1
|
||||
border.color: darkerColor
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 1
|
||||
anchors.bottomMargin: 1
|
||||
@@ -71,13 +70,18 @@ Item {
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
|
||||
color: lighterColor
|
||||
width: parent.zoomWidth
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: gapRect
|
||||
color: gapColor
|
||||
anchors.left: rect.right
|
||||
anchors.right: rightRange.left
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: leftRange
|
||||
|
||||
@@ -58,7 +58,7 @@ Rectangle {
|
||||
states: [
|
||||
// no data available
|
||||
State {
|
||||
when: (root.eventCount == 0) && !connection.recording;
|
||||
when: (root.eventCount == 0) && !elapsedTimer.running;
|
||||
PropertyChanges {
|
||||
target: statusDisplay
|
||||
visible: true
|
||||
@@ -71,7 +71,7 @@ Rectangle {
|
||||
},
|
||||
// running app
|
||||
State {
|
||||
when: connection.recording;
|
||||
when: elapsedTimer.running;
|
||||
PropertyChanges {
|
||||
target: statusDisplay
|
||||
visible: true
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <coreplugin/helpmanager.h>
|
||||
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
|
||||
#include <qmlprojectmanager/qmlprojectplugin.h>
|
||||
#include <projectexplorer/localapplicationruncontrol.h>
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h>
|
||||
@@ -144,8 +145,25 @@ QmlProfilerEngine::~QmlProfilerEngine()
|
||||
void QmlProfilerEngine::start()
|
||||
{
|
||||
QTC_ASSERT(!d->m_runner, return);
|
||||
|
||||
if (QmlProjectManager::QmlProjectRunConfiguration *rc =
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration())) {
|
||||
if (rc->observerPath().isEmpty()) {
|
||||
QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning();
|
||||
AnalyzerManager::stopTool();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
d->m_runner = QmlProfilerEnginePrivate::createRunner(runConfiguration(), this);
|
||||
|
||||
if (LocalQmlProfilerRunner *qmlRunner = qobject_cast<LocalQmlProfilerRunner *>(d->m_runner)) {
|
||||
if (!qmlRunner->hasExecutable()) {
|
||||
showNonmodalWarning(tr("No executable file to launch."));
|
||||
AnalyzerManager::stopTool();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
connect(d->m_runner, SIGNAL(stopped()), this, SLOT(stopped()));
|
||||
connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
||||
@@ -175,15 +193,7 @@ void QmlProfilerEngine::stopped()
|
||||
{
|
||||
// user feedback
|
||||
if (d->m_running && d->m_fetchingData) {
|
||||
Core::ICore * const core = Core::ICore::instance();
|
||||
QMessageBox *killedWarning = new QMessageBox(core->mainWindow());
|
||||
killedWarning->setIcon(QMessageBox::Warning);
|
||||
killedWarning->setWindowTitle(tr("QML Profiler"));
|
||||
killedWarning->setText(tr("Application finished before loading profiled data.\n Please use the stop button instead."));
|
||||
killedWarning->setStandardButtons(QMessageBox::Ok);
|
||||
killedWarning->setDefaultButton(QMessageBox::Ok);
|
||||
killedWarning->setModal(false);
|
||||
killedWarning->show();
|
||||
showNonmodalWarning(tr("Application finished before loading profiled data.\n Please use the stop button instead."));
|
||||
}
|
||||
|
||||
d->m_running = false;
|
||||
@@ -282,5 +292,18 @@ void QmlProfilerEngine::wrongSetupMessageBoxFinished(int button)
|
||||
}
|
||||
}
|
||||
|
||||
void QmlProfilerEngine::showNonmodalWarning(const QString &warningMsg)
|
||||
{
|
||||
Core::ICore * const core = Core::ICore::instance();
|
||||
QMessageBox *noExecWarning = new QMessageBox(core->mainWindow());
|
||||
noExecWarning->setIcon(QMessageBox::Warning);
|
||||
noExecWarning->setWindowTitle(tr("QML Profiler"));
|
||||
noExecWarning->setText(warningMsg);
|
||||
noExecWarning->setStandardButtons(QMessageBox::Ok);
|
||||
noExecWarning->setDefaultButton(QMessageBox::Ok);
|
||||
noExecWarning->setModal(false);
|
||||
noExecWarning->show();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlProfiler
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
~QmlProfilerEngine();
|
||||
|
||||
static void showNonmodalWarning(const QString &warningMsg);
|
||||
signals:
|
||||
void processRunning(int port);
|
||||
void stopRecording();
|
||||
|
||||
@@ -50,9 +50,13 @@ public:
|
||||
{
|
||||
if (data().type() == QVariant::String) {
|
||||
// first column
|
||||
return data(FilenameRole).toString() == other.data(FilenameRole).toString() ?
|
||||
if (column() == 0) {
|
||||
return data(FilenameRole).toString() == other.data(FilenameRole).toString() ?
|
||||
data(LineRole).toInt() < other.data(LineRole).toInt() :
|
||||
data(FilenameRole).toString() < other.data(FilenameRole).toString();
|
||||
} else {
|
||||
return data().toString() < other.data().toString();
|
||||
}
|
||||
}
|
||||
|
||||
return data().toDouble() < other.data().toDouble();
|
||||
@@ -142,7 +146,7 @@ void QmlProfilerEventStatistics::addRangedEvent(int type, int nestingLevel, int
|
||||
Q_UNUSED(nestingInType);
|
||||
|
||||
const QChar colon = QLatin1Char(':');
|
||||
QString localName, displayName, location, details;
|
||||
QString displayName, location, details;
|
||||
|
||||
if (data.isEmpty())
|
||||
details = tr("Source code not available");
|
||||
@@ -161,8 +165,8 @@ void QmlProfilerEventStatistics::addRangedEvent(int type, int nestingLevel, int
|
||||
displayName = tr("<bytecode>");
|
||||
location = QString("--:%1:%2").arg(QString::number(type), details);
|
||||
} else {
|
||||
localName = QUrl(fileName).toLocalFile();
|
||||
displayName = localName.mid(localName.lastIndexOf(QChar('/')) + 1) + colon + QString::number(line);
|
||||
const QString filePath = QUrl(fileName).path();
|
||||
displayName = filePath.mid(filePath.lastIndexOf(QChar('/')) + 1) + colon + QString::number(line);
|
||||
location = fileName+colon+QString::number(line);
|
||||
}
|
||||
|
||||
@@ -229,10 +233,15 @@ void QmlProfilerEventStatistics::QmlProfilerEventStatisticsPrivate::postProcess(
|
||||
{
|
||||
double totalTime = 0;
|
||||
|
||||
foreach (QmlEventData *binding, m_rootHash.values())
|
||||
foreach (QmlEventData *binding, m_rootHash.values()) {
|
||||
if (binding->filename->isEmpty())
|
||||
continue;
|
||||
totalTime += binding->duration;
|
||||
}
|
||||
|
||||
foreach (QmlEventData *binding, m_rootHash.values()) {
|
||||
if (binding->filename->isEmpty())
|
||||
continue;
|
||||
binding->percentOfTime = binding->duration * 100.0 / totalTime;
|
||||
binding->timePerCall = binding->calls > 0 ? double(binding->duration) / binding->calls : 0;
|
||||
}
|
||||
@@ -408,7 +417,7 @@ void QmlProfilerEventsView::buildModel()
|
||||
bool hasBranches = d->m_fieldShown[Parents] || d->m_fieldShown[Children];
|
||||
setRootIsDecorated(hasBranches);
|
||||
|
||||
setSortingEnabled(!hasBranches);
|
||||
setSortingEnabled(true);
|
||||
|
||||
if (!hasBranches)
|
||||
sortByColumn(d->m_firstNumericColumn,Qt::DescendingOrder);
|
||||
@@ -444,7 +453,7 @@ void QmlProfilerEventsView::QmlProfilerEventsViewPrivate::buildModelFromList( co
|
||||
|
||||
if (m_fieldShown[Percent]) {
|
||||
newRow << new EventsViewItem(QString::number(binding->percentOfTime,'f',2)+QLatin1String(" %"));
|
||||
newRow.last()->setData(QVariant(binding->eventType));
|
||||
newRow.last()->setData(QVariant(binding->percentOfTime));
|
||||
}
|
||||
|
||||
if (m_fieldShown[TotalDuration]) {
|
||||
@@ -474,6 +483,7 @@ void QmlProfilerEventsView::QmlProfilerEventsViewPrivate::buildModelFromList( co
|
||||
|
||||
if (m_fieldShown[Details]) {
|
||||
newRow << new EventsViewItem(*binding->details);
|
||||
newRow.last()->setData(QVariant(*binding->details));
|
||||
}
|
||||
|
||||
if (!newRow.isEmpty()) {
|
||||
|
||||
@@ -420,8 +420,7 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber)
|
||||
if (lineNumber < 0 || fileUrl.isEmpty())
|
||||
return;
|
||||
|
||||
const QString fileName = QUrl(fileUrl).toLocalFile();
|
||||
const QString projectFileName = d->m_projectFinder.findFile(fileName);
|
||||
const QString projectFileName = d->m_projectFinder.findFile(fileUrl);
|
||||
|
||||
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||
Core::IEditor *editor = editorManager->openEditor(projectFileName);
|
||||
|
||||
Reference in New Issue
Block a user