Commit 1fd14c4c authored by Ulf Hermann's avatar Ulf Hermann Committed by Kai Koehne

Disable the Javascript profiler while there is no data available.

With V4 the Javascript profiler is unusable. In order not to suggest to
the user that it is actually usable, we disable it if it doesn't show
any data. However, when profiling applications that don't use V4, yet,
the JS profiler actually works and has to be enabled.

Change-Id: Iecb97c0940addd157c5ebe229edb614448cc0554
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 4196e9c2
......@@ -135,6 +135,7 @@ QV8ProfilerEventsWidget::QV8ProfilerEventsWidget(QWidget *parent,
connect(d->m_eventTree, SIGNAL(eventSelected(int)), d->m_eventParents, SLOT(displayEvent(int)));
connect(d->m_eventChildren, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
connect(d->m_eventParents, SIGNAL(eventClicked(int)), d->m_eventTree, SLOT(selectEvent(int)));
connect(d->v8Model, SIGNAL(changed()), this, SLOT(updateEnabledState()));
// widget arrangement
QVBoxLayout *groupLayout = new QVBoxLayout;
......@@ -156,7 +157,7 @@ QV8ProfilerEventsWidget::QV8ProfilerEventsWidget(QWidget *parent,
d->m_profilerTool = profilerTool;
d->m_viewContainer = container;
setEnabled(false);
}
QV8ProfilerEventsWidget::~QV8ProfilerEventsWidget()
......@@ -164,11 +165,17 @@ QV8ProfilerEventsWidget::~QV8ProfilerEventsWidget()
delete d;
}
void QV8ProfilerEventsWidget::updateEnabledState()
{
setEnabled(!d->v8Model->isEmpty());
}
void QV8ProfilerEventsWidget::clear()
{
d->m_eventTree->clear();
d->m_eventChildren->clear();
d->m_eventParents->clear();
setEnabled(false);
}
QModelIndex QV8ProfilerEventsWidget::selectedItem() const
......
......@@ -74,6 +74,7 @@ signals:
public slots:
void updateSelectedEvent(int eventId) const;
void selectBySourceLocation(const QString &filename, int line, int column);
void updateEnabledState();
protected:
void contextMenuEvent(QContextMenuEvent *ev);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment