Skip to content

Commit

Permalink
remove broken views
Browse files Browse the repository at this point in the history
  • Loading branch information
lievenhey committed Nov 16, 2022
1 parent e18ee7d commit edc13e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 63 deletions.
57 changes: 5 additions & 52 deletions src/resultspagediff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ ResultsPageDiff::ResultsPageDiff(QWidget* parent)
, m_resultsBottomUpPage(
new ResultsBottomUpPage(m_filterAndZoomStack, nullptr, m_costContextMenu, m_exportMenu, this))
, m_resultsTopDownPage(new ResultsTopDownPage(m_filterAndZoomStack, nullptr, m_costContextMenu, this))
, m_resultsFlameGraphPage(new ResultsFlameGraphPage(m_filterAndZoomStack, m_fileA, m_exportMenu, this))
, m_resultsCallerCalleePage(new ResultsCallerCalleePage(m_filterAndZoomStack, m_fileA, m_costContextMenu, this))
, m_timelineVisible(true)
{
m_exportMenu->setIcon(QIcon::fromTheme(QStringLiteral("document-export")));
Expand Down Expand Up @@ -82,33 +80,12 @@ ResultsPageDiff::ResultsPageDiff(QWidget* parent)
m_contents->addDockWidget(m_bottomUpDock, KDDockWidgets::Location_OnTop);
m_topDownDock = dockify(m_resultsTopDownPage, QStringLiteral("dtopDown"), tr("Top &Down"), tr("Ctrl+D"));
m_bottomUpDock->addDockWidgetAsTab(m_topDownDock);
m_flameGraphDock =
dockify(m_resultsFlameGraphPage, QStringLiteral("dflameGraph"), tr("Flame &Graph"), tr("Ctrl+G"));
m_bottomUpDock->addDockWidgetAsTab(m_flameGraphDock);
m_callerCalleeDock =
dockify(m_resultsCallerCalleePage, QStringLiteral("dcallerCallee"), tr("Ca&ller / Callee"), tr("Ctrl+L"));
m_bottomUpDock->addDockWidgetAsTab(m_callerCalleeDock);
m_bottomUpDock->setAsCurrentTab();

connect(m_filterAndZoomStack, &FilterAndZoomStack::filterChanged, m_fileA, &PerfParser::filterResults);

connect(m_fileA, &PerfParser::parserWarning, this, &ResultsPageDiff::showError);

connect(m_resultsCallerCalleePage, &ResultsCallerCalleePage::navigateToCode, this,
&ResultsPageDiff::navigateToCode);
connect(m_resultsCallerCalleePage, &ResultsCallerCalleePage::navigateToCodeFailed, this,
&ResultsPageDiff::showError);

connect(m_resultsBottomUpPage, &ResultsBottomUpPage::jumpToCallerCallee, this,
&ResultsPageDiff::onJumpToCallerCallee);
connect(m_resultsBottomUpPage, &ResultsBottomUpPage::openEditor, this, &ResultsPageDiff::onOpenEditor);
connect(m_resultsTopDownPage, &ResultsTopDownPage::jumpToCallerCallee, this,
&ResultsPageDiff::onJumpToCallerCallee);
connect(m_resultsTopDownPage, &ResultsTopDownPage::openEditor, this, &ResultsPageDiff::onOpenEditor);
connect(m_resultsFlameGraphPage, &ResultsFlameGraphPage::jumpToCallerCallee, this,
&ResultsPageDiff::onJumpToCallerCallee);
connect(m_resultsFlameGraphPage, &ResultsFlameGraphPage::openEditor, this, &ResultsPageDiff::onOpenEditor);

connect(m_fileA, &PerfParser::parsingStarted, this, [this]() {
// disable when we apply a filter
m_contents->setEnabled(false);
Expand Down Expand Up @@ -138,9 +115,9 @@ ResultsPageDiff::ResultsPageDiff(QWidget* parent)
Data::BottomUpResults::diffBottomUpResults(m_fileA->bottomUpResults(), m_fileB->bottomUpResults());
m_resultsBottomUpPage->setBottomUpResults(bottomUpData);

auto topDownData =
Data::TopDownResults::diffTopDownResults(Data::TopDownResults::fromBottomUp(m_fileA->bottomUpResults()),
Data::TopDownResults::fromBottomUp(m_fileB->bottomUpResults()));
auto topDownData = Data::TopDownResults::diffTopDownResults(
Data::TopDownResults::fromBottomUp(m_fileA->bottomUpResults(), false),
Data::TopDownResults::fromBottomUp(m_fileB->bottomUpResults(), false));
m_resultsTopDownPage->setTopDownResults(topDownData);
});

Expand All @@ -163,40 +140,17 @@ ResultsPageDiff::ResultsPageDiff(QWidget* parent)

ResultsPageDiff::~ResultsPageDiff() = default;

void ResultsPageDiff::setSysroot(const QString& path)
{
m_resultsCallerCalleePage->setSysroot(path);
}

void ResultsPageDiff::setAppPath(const QString& path)
{
m_resultsCallerCalleePage->setAppPath(path);
}

static void showDock(KDDockWidgets::DockWidget* dock)
{
dock->show();
dock->setFocus();
dock->setAsCurrentTab();
}

void ResultsPageDiff::onJumpToCallerCallee(const Data::Symbol& symbol)
{
m_resultsCallerCalleePage->jumpToCallerCallee(symbol);
showDock(m_callerCalleeDock);
}

void ResultsPageDiff::onOpenEditor(const Data::Symbol& symbol)
{
m_resultsCallerCalleePage->openEditor(symbol);
}

void ResultsPageDiff::clear()
{
m_resultsBottomUpPage->clear();
m_resultsTopDownPage->clear();
m_resultsCallerCalleePage->clear();
m_resultsFlameGraphPage->clear();
m_exportMenu->clear();

m_filterAndZoomStack->clear();
Expand All @@ -214,8 +168,7 @@ QMenu* ResultsPageDiff::exportMenu() const

QList<QAction*> ResultsPageDiff::windowActions() const
{
auto ret = QList<QAction*> {m_bottomUpDock->toggleAction(), m_topDownDock->toggleAction(),
m_flameGraphDock->toggleAction(), m_callerCalleeDock->toggleAction()};
auto ret = QList<QAction*> {m_bottomUpDock->toggleAction(), m_topDownDock->toggleAction()};
return ret;
}

Expand Down Expand Up @@ -244,7 +197,7 @@ void ResultsPageDiff::initDockWidgets(const QVector<KDDockWidgets::DockWidgetBas
{
Q_ASSERT(restored.contains(m_bottomUpDock));

const auto docks = {m_bottomUpDock, m_topDownDock, m_flameGraphDock, m_callerCalleeDock};
const auto docks = {m_bottomUpDock, m_topDownDock};
for (auto dock : docks) {
if (!dock || restored.contains(dock))
continue;
Expand Down
11 changes: 0 additions & 11 deletions src/resultspagediff.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class DockWidgetBase;
class PerfParser;
class ResultsBottomUpPage;
class ResultsTopDownPage;
class ResultsFlameGraphPage;
class ResultsCallerCalleePage;
class FilterAndZoomStack;
class CostContextMenu;

Expand All @@ -49,11 +47,6 @@ class ResultsPageDiff : public QWidget
void initDockWidgets(const QVector<KDDockWidgets::DockWidgetBase*>& restored);

public slots:
void setSysroot(const QString& path);
void setAppPath(const QString& path);

void onJumpToCallerCallee(const Data::Symbol& symbol);
void onOpenEditor(const Data::Symbol& symbol);
void showError(const QString& message);
void createDiffReport(const QString& fileA, const QString& fileB);

Expand All @@ -78,10 +71,6 @@ public slots:
ResultsBottomUpPage* m_resultsBottomUpPage;
KDDockWidgets::DockWidget* m_topDownDock;
ResultsTopDownPage* m_resultsTopDownPage;
KDDockWidgets::DockWidget* m_flameGraphDock;
ResultsFlameGraphPage* m_resultsFlameGraphPage;
KDDockWidgets::DockWidget* m_callerCalleeDock;
ResultsCallerCalleePage* m_resultsCallerCalleePage;
QWidget* m_filterBusyIndicator = nullptr;

int m_runningParsersCounter = 0;
Expand Down

0 comments on commit edc13e6

Please sign in to comment.