From 6da5653e017ed66ccf00b561a13cabf086d68ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 26 Feb 2013 19:59:47 +0100 Subject: Fix unintended rename of stackselection --- tdecachegrind/tdecachegrind/CMakeLists.txt | 4 +- tdecachegrind/tdecachegrind/Makefile.am | 4 +- tdecachegrind/tdecachegrind/stackitem.cpp | 2 +- tdecachegrind/tdecachegrind/stackselection.cpp | 230 +++++++++++++++++++++ tdecachegrind/tdecachegrind/stackselection.h | 81 ++++++++ tdecachegrind/tdecachegrind/stackselectionbase.ui | 80 +++++++ tdecachegrind/tdecachegrind/stactdeselection.cpp | 230 --------------------- tdecachegrind/tdecachegrind/stactdeselection.h | 81 -------- .../tdecachegrind/stactdeselectionbase.ui | 80 ------- tdecachegrind/tdecachegrind/toplevel.cpp | 2 +- 10 files changed, 397 insertions(+), 397 deletions(-) create mode 100644 tdecachegrind/tdecachegrind/stackselection.cpp create mode 100644 tdecachegrind/tdecachegrind/stackselection.h create mode 100644 tdecachegrind/tdecachegrind/stackselectionbase.ui delete mode 100644 tdecachegrind/tdecachegrind/stactdeselection.cpp delete mode 100644 tdecachegrind/tdecachegrind/stactdeselection.h delete mode 100644 tdecachegrind/tdecachegrind/stactdeselectionbase.ui diff --git a/tdecachegrind/tdecachegrind/CMakeLists.txt b/tdecachegrind/tdecachegrind/CMakeLists.txt index 10d9b1ae..3906452e 100644 --- a/tdecachegrind/tdecachegrind/CMakeLists.txt +++ b/tdecachegrind/tdecachegrind/CMakeLists.txt @@ -34,10 +34,10 @@ install( FILES x-tdecachegrind.desktop DESTINATION ${MIME_INSTALL_DIR}/applicati tde_add_executable( tdecachegrind AUTOMOC SOURCES - functionselectionbase.ui stactdeselectionbase.ui partselectionbase.ui + functionselectionbase.ui stackselectionbase.ui partselectionbase.ui configdlgbase.ui loader.cpp cachegrindloader.cpp treemap.cpp pool.cpp main.cpp configuration.cpp functionselection.cpp coverage.cpp - partgraph.cpp toplevel.cpp stactdeselection.cpp stackbrowser.cpp + partgraph.cpp toplevel.cpp stackselection.cpp stackbrowser.cpp subcost.cpp tracedata.cpp partselection.cpp configdlg.cpp utils.cpp fixcost.cpp traceitemview.cpp instrview.cpp tabview.cpp sourceview.cpp callmapview.cpp callview.cpp coverageview.cpp diff --git a/tdecachegrind/tdecachegrind/Makefile.am b/tdecachegrind/tdecachegrind/Makefile.am index a09f8ce9..f7c1bf8c 100644 --- a/tdecachegrind/tdecachegrind/Makefile.am +++ b/tdecachegrind/tdecachegrind/Makefile.am @@ -2,13 +2,13 @@ bin_PROGRAMS = tdecachegrind tdecachegrind_SOURCES = \ functionselectionbase.ui \ - stactdeselectionbase.ui \ + stackselectionbase.ui \ partselectionbase.ui \ configdlgbase.ui \ loader.cpp cachegrindloader.cpp treemap.cpp pool.cpp \ main.cpp configuration.cpp \ functionselection.cpp coverage.cpp partgraph.cpp \ - toplevel.cpp stactdeselection.cpp stackbrowser.cpp \ + toplevel.cpp stackselection.cpp stackbrowser.cpp \ subcost.cpp tracedata.cpp partselection.cpp configdlg.cpp \ utils.cpp fixcost.cpp \ traceitemview.cpp instrview.cpp tabview.cpp \ diff --git a/tdecachegrind/tdecachegrind/stackitem.cpp b/tdecachegrind/tdecachegrind/stackitem.cpp index 69494f3b..ef504557 100644 --- a/tdecachegrind/tdecachegrind/stackitem.cpp +++ b/tdecachegrind/tdecachegrind/stackitem.cpp @@ -26,7 +26,7 @@ #include "configuration.h" #include "listutils.h" #include "stackitem.h" -#include "stactdeselection.h" +#include "stackselection.h" // StackItem diff --git a/tdecachegrind/tdecachegrind/stackselection.cpp b/tdecachegrind/tdecachegrind/stackselection.cpp new file mode 100644 index 00000000..59094754 --- /dev/null +++ b/tdecachegrind/tdecachegrind/stackselection.cpp @@ -0,0 +1,230 @@ +/* This file is part of KCachegrind. + Copyright (C) 2003 Josef Weidendorfer + + KCachegrind is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +/* + * StackSelection for KCachegrind + * For function selection of a most expected stack, + * to be put into a TQDockWindow + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "stackbrowser.h" +#include "stackselection.h" +#include "stackitem.h" + +StackSelection::StackSelection( TQWidget* parent, const char* name) + : StackSelectionBase(parent, name) +{ + _data = 0; + _browser = new StackBrowser(); + _item = 0; + _function = 0; + _costType = 0; + _costType2 = 0; + _groupType = TraceItem::Function; + + stackList->setSorting(-1); + stackList->setAllColumnsShowFocus(true); + stackList->setResizeMode(TQListView::LastColumn); + stackList->setColumnAlignment(0, TQt::AlignRight); + stackList->setColumnAlignment(1, TQt::AlignRight); + stackList->setColumnAlignment(2, TQt::AlignRight); + stackList->setColumnWidth(0, 50); + // 2nd cost column hidden at first (_costType2 == 0) + stackList->setColumnWidth(1, 0); + stackList->setColumnWidth(2, 50); + + connect(stackList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(stackSelected(TQListViewItem*))); +} + +StackSelection::~StackSelection() +{ + delete _browser; +} + +void StackSelection::setData(TraceData* data) +{ + if (_data == data) return; + + _data = data; + + stackList->clear(); + delete _browser; + _browser = new StackBrowser(); + _function = 0; +} + + +void StackSelection::setFunction(TraceFunction* f) +{ + if (_function == f) return; + _function = f; + + if (!_data || !_function) return; + + //kdDebug() << "StackSelection::setFunction " << f->name() << endl; + + HistoryItem* item = _browser->current(); + if (!item || item->function() != f) { + _browser->select(f); + rebuildStackList(); + } +} + + +void StackSelection::rebuildStackList() +{ + HistoryItem* item = _browser->current(); + stackList->clear(); + stackList->setColumnWidth(0, 50); + stackList->setColumnWidth(1, _costType2 ? 50:0); + stackList->setColumnWidth(2, 50); + if (!item || !item->stack()) return; + + TraceFunction* top = item->stack()->top(); + if (!top) return; + + stackList->setColumnWidthMode(1, TQListView::Maximum); + + TraceCallList l = item->stack()->calls(); + TraceCall* call; + for (call=l.last();call;call=l.prev()) + new StackItem(this, stackList, call); + + new StackItem(this, stackList, top); + + // select current function + TQListViewItem* i = stackList->firstChild(); + for (;i;i=i->nextSibling()) + if (((StackItem*)i)->function() == item->function()) + break; + + if (i) { + // this calls stackFunctionSelected() + stackList->setCurrentItem(i); + stackList->ensureItemVisible(i); + } + + if (!_costType2) { + stackList->setColumnWidthMode(1, TQListView::Manual); + stackList->setColumnWidth(1, 0); + } +} + +void StackSelection::stackSelected(TQListViewItem* i) +{ + if (!i) return; + + TraceFunction* f = ((StackItem*)i)->function(); + emit functionSelected(f); +} + + +void StackSelection::browserBack() +{ + if (_browser && _browser->canGoBack()) { + _browser->goBack(); + rebuildStackList(); + } +} + +void StackSelection::browserForward() +{ + if (_browser && _browser->canGoForward()) { + _browser->goForward(); + rebuildStackList(); + } +} + +void StackSelection::browserUp() +{ + if (_browser) { + _browser->goUp(); + rebuildStackList(); + } +} + +void StackSelection::browserDown() +{ + if (_browser) { + _browser->goDown(); + rebuildStackList(); + } +} + +void StackSelection::refresh() +{ + TQListViewItem* item = stackList->firstChild(); + for(;item;item = item->nextSibling()) + ((StackItem*)item)->updateCost(); +} + +void StackSelection::setCostType(TraceCostType* ct) +{ + if (ct == _costType) return; + _costType = ct; + + stackList->setColumnWidth(0, 50); + if (_costType) + stackList->setColumnText(0, _costType->name()); + + TQListViewItem* item = stackList->firstChild(); + for(;item;item = item->nextSibling()) + ((StackItem*)item)->updateCost(); +} + +void StackSelection::setCostType2(TraceCostType* ct) +{ + if (ct == _costType2) return; + _costType2 = ct; + + stackList->setColumnWidth(1, 50); + stackList->setColumnWidthMode(1, TQListView::Maximum); + if (_costType2) + stackList->setColumnText(1, _costType2->name()); + + TQListViewItem* item = stackList->firstChild(); + for(;item;item = item->nextSibling()) + ((StackItem*)item)->updateCost(); + + if (!_costType2) { + stackList->setColumnWidthMode(1, TQListView::Manual); + stackList->setColumnWidth(1, 0); + } +} + +void StackSelection::setGroupType(TraceItem::CostType gt) +{ + if (_groupType == gt) return; + _groupType = gt; + + TQListViewItem* item = stackList->firstChild(); + for(;item;item = item->nextSibling()) + ((StackItem*)item)->updateGroup(); +} + +#include "stackselection.moc" diff --git a/tdecachegrind/tdecachegrind/stackselection.h b/tdecachegrind/tdecachegrind/stackselection.h new file mode 100644 index 00000000..8a826495 --- /dev/null +++ b/tdecachegrind/tdecachegrind/stackselection.h @@ -0,0 +1,81 @@ +/* This file is part of KCachegrind. + Copyright (C) 2003 Josef Weidendorfer + + KCachegrind is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +/* + * StackSelection for KCachegrind + * For function selection of a most expected stack, + * to be put into a TQDockWindow + */ + +#ifndef STACKSELECTION_H +#define STACKSELECTION_H + +#include "stackselectionbase.h" +#include "tracedata.h" + +class TraceFunction; +class TraceData; +class StackBrowser; +class NestedAreaItem; + +class StackSelection : public StackSelectionBase +{ + Q_OBJECT + + +public: + StackSelection( TQWidget* parent = 0, const char* name = 0); + ~StackSelection(); + + TraceData* data() const { return _data; } + void setData(TraceData*); + StackBrowser* browser() const { return _browser; } + TraceCostType* costType() { return _costType; } + TraceCostType* costType2() { return _costType2; } + TraceItem::CostType groupType() { return _groupType; } + +signals: + void functionSelected(TraceItem*); + +public slots: + void setFunction(TraceFunction*); + void setCostType(TraceCostType*); + void setCostType2(TraceCostType*); + void setGroupType(TraceItem::CostType); + + void stackSelected( TQListViewItem* ); + void browserBack(); + void browserForward(); + void browserUp(); + void browserDown(); + void refresh(); + void rebuildStackList(); + +private: + void selectFunction(); + + TraceData* _data; + StackBrowser* _browser; + TQListViewItem* _item; + TraceFunction* _function; + TraceCostType* _costType; + TraceCostType* _costType2; + TraceItem::CostType _groupType; +}; + +#endif diff --git a/tdecachegrind/tdecachegrind/stackselectionbase.ui b/tdecachegrind/tdecachegrind/stackselectionbase.ui new file mode 100644 index 00000000..c61010f9 --- /dev/null +++ b/tdecachegrind/tdecachegrind/stackselectionbase.ui @@ -0,0 +1,80 @@ + +StackSelectionBase + + + StackSelectionBase + + + + 0 + 0 + 168 + 108 + + + + Stack Selection + + + + unnamed + + + 3 + + + 6 + + + + + Cost + + + true + + + true + + + + + Cost2 + + + true + + + true + + + + + Calls + + + true + + + true + + + + + Function + + + true + + + true + + + + stackList + + + + + + diff --git a/tdecachegrind/tdecachegrind/stactdeselection.cpp b/tdecachegrind/tdecachegrind/stactdeselection.cpp deleted file mode 100644 index 29c45d2b..00000000 --- a/tdecachegrind/tdecachegrind/stactdeselection.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* This file is part of KCachegrind. - Copyright (C) 2003 Josef Weidendorfer - - KCachegrind is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation, version 2. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -/* - * StackSelection for KCachegrind - * For function selection of a most expected stack, - * to be put into a TQDockWindow - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "stackbrowser.h" -#include "stactdeselection.h" -#include "stackitem.h" - -StackSelection::StackSelection( TQWidget* parent, const char* name) - : StackSelectionBase(parent, name) -{ - _data = 0; - _browser = new StackBrowser(); - _item = 0; - _function = 0; - _costType = 0; - _costType2 = 0; - _groupType = TraceItem::Function; - - stackList->setSorting(-1); - stackList->setAllColumnsShowFocus(true); - stackList->setResizeMode(TQListView::LastColumn); - stackList->setColumnAlignment(0, TQt::AlignRight); - stackList->setColumnAlignment(1, TQt::AlignRight); - stackList->setColumnAlignment(2, TQt::AlignRight); - stackList->setColumnWidth(0, 50); - // 2nd cost column hidden at first (_costType2 == 0) - stackList->setColumnWidth(1, 0); - stackList->setColumnWidth(2, 50); - - connect(stackList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), - this, TQT_SLOT(stackSelected(TQListViewItem*))); -} - -StackSelection::~StackSelection() -{ - delete _browser; -} - -void StackSelection::setData(TraceData* data) -{ - if (_data == data) return; - - _data = data; - - stackList->clear(); - delete _browser; - _browser = new StackBrowser(); - _function = 0; -} - - -void StackSelection::setFunction(TraceFunction* f) -{ - if (_function == f) return; - _function = f; - - if (!_data || !_function) return; - - //kdDebug() << "StackSelection::setFunction " << f->name() << endl; - - HistoryItem* item = _browser->current(); - if (!item || item->function() != f) { - _browser->select(f); - rebuildStackList(); - } -} - - -void StackSelection::rebuildStackList() -{ - HistoryItem* item = _browser->current(); - stackList->clear(); - stackList->setColumnWidth(0, 50); - stackList->setColumnWidth(1, _costType2 ? 50:0); - stackList->setColumnWidth(2, 50); - if (!item || !item->stack()) return; - - TraceFunction* top = item->stack()->top(); - if (!top) return; - - stackList->setColumnWidthMode(1, TQListView::Maximum); - - TraceCallList l = item->stack()->calls(); - TraceCall* call; - for (call=l.last();call;call=l.prev()) - new StackItem(this, stackList, call); - - new StackItem(this, stackList, top); - - // select current function - TQListViewItem* i = stackList->firstChild(); - for (;i;i=i->nextSibling()) - if (((StackItem*)i)->function() == item->function()) - break; - - if (i) { - // this calls stackFunctionSelected() - stackList->setCurrentItem(i); - stackList->ensureItemVisible(i); - } - - if (!_costType2) { - stackList->setColumnWidthMode(1, TQListView::Manual); - stackList->setColumnWidth(1, 0); - } -} - -void StackSelection::stackSelected(TQListViewItem* i) -{ - if (!i) return; - - TraceFunction* f = ((StackItem*)i)->function(); - emit functionSelected(f); -} - - -void StackSelection::browserBack() -{ - if (_browser && _browser->canGoBack()) { - _browser->goBack(); - rebuildStackList(); - } -} - -void StackSelection::browserForward() -{ - if (_browser && _browser->canGoForward()) { - _browser->goForward(); - rebuildStackList(); - } -} - -void StackSelection::browserUp() -{ - if (_browser) { - _browser->goUp(); - rebuildStackList(); - } -} - -void StackSelection::browserDown() -{ - if (_browser) { - _browser->goDown(); - rebuildStackList(); - } -} - -void StackSelection::refresh() -{ - TQListViewItem* item = stackList->firstChild(); - for(;item;item = item->nextSibling()) - ((StackItem*)item)->updateCost(); -} - -void StackSelection::setCostType(TraceCostType* ct) -{ - if (ct == _costType) return; - _costType = ct; - - stackList->setColumnWidth(0, 50); - if (_costType) - stackList->setColumnText(0, _costType->name()); - - TQListViewItem* item = stackList->firstChild(); - for(;item;item = item->nextSibling()) - ((StackItem*)item)->updateCost(); -} - -void StackSelection::setCostType2(TraceCostType* ct) -{ - if (ct == _costType2) return; - _costType2 = ct; - - stackList->setColumnWidth(1, 50); - stackList->setColumnWidthMode(1, TQListView::Maximum); - if (_costType2) - stackList->setColumnText(1, _costType2->name()); - - TQListViewItem* item = stackList->firstChild(); - for(;item;item = item->nextSibling()) - ((StackItem*)item)->updateCost(); - - if (!_costType2) { - stackList->setColumnWidthMode(1, TQListView::Manual); - stackList->setColumnWidth(1, 0); - } -} - -void StackSelection::setGroupType(TraceItem::CostType gt) -{ - if (_groupType == gt) return; - _groupType = gt; - - TQListViewItem* item = stackList->firstChild(); - for(;item;item = item->nextSibling()) - ((StackItem*)item)->updateGroup(); -} - -#include "stactdeselection.moc" diff --git a/tdecachegrind/tdecachegrind/stactdeselection.h b/tdecachegrind/tdecachegrind/stactdeselection.h deleted file mode 100644 index 5e25a5d8..00000000 --- a/tdecachegrind/tdecachegrind/stactdeselection.h +++ /dev/null @@ -1,81 +0,0 @@ -/* This file is part of KCachegrind. - Copyright (C) 2003 Josef Weidendorfer - - KCachegrind is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation, version 2. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -/* - * StackSelection for KCachegrind - * For function selection of a most expected stack, - * to be put into a TQDockWindow - */ - -#ifndef STACKSELECTION_H -#define STACKSELECTION_H - -#include "stactdeselectionbase.h" -#include "tracedata.h" - -class TraceFunction; -class TraceData; -class StackBrowser; -class NestedAreaItem; - -class StackSelection : public StackSelectionBase -{ - Q_OBJECT - - -public: - StackSelection( TQWidget* parent = 0, const char* name = 0); - ~StackSelection(); - - TraceData* data() const { return _data; } - void setData(TraceData*); - StackBrowser* browser() const { return _browser; } - TraceCostType* costType() { return _costType; } - TraceCostType* costType2() { return _costType2; } - TraceItem::CostType groupType() { return _groupType; } - -signals: - void functionSelected(TraceItem*); - -public slots: - void setFunction(TraceFunction*); - void setCostType(TraceCostType*); - void setCostType2(TraceCostType*); - void setGroupType(TraceItem::CostType); - - void stackSelected( TQListViewItem* ); - void browserBack(); - void browserForward(); - void browserUp(); - void browserDown(); - void refresh(); - void rebuildStackList(); - -private: - void selectFunction(); - - TraceData* _data; - StackBrowser* _browser; - TQListViewItem* _item; - TraceFunction* _function; - TraceCostType* _costType; - TraceCostType* _costType2; - TraceItem::CostType _groupType; -}; - -#endif diff --git a/tdecachegrind/tdecachegrind/stactdeselectionbase.ui b/tdecachegrind/tdecachegrind/stactdeselectionbase.ui deleted file mode 100644 index c61010f9..00000000 --- a/tdecachegrind/tdecachegrind/stactdeselectionbase.ui +++ /dev/null @@ -1,80 +0,0 @@ - -StackSelectionBase - - - StackSelectionBase - - - - 0 - 0 - 168 - 108 - - - - Stack Selection - - - - unnamed - - - 3 - - - 6 - - - - - Cost - - - true - - - true - - - - - Cost2 - - - true - - - true - - - - - Calls - - - true - - - true - - - - - Function - - - true - - - true - - - - stackList - - - - - - diff --git a/tdecachegrind/tdecachegrind/toplevel.cpp b/tdecachegrind/tdecachegrind/toplevel.cpp index 8bb8d45d..4a30f965 100644 --- a/tdecachegrind/tdecachegrind/toplevel.cpp +++ b/tdecachegrind/tdecachegrind/toplevel.cpp @@ -57,7 +57,7 @@ #include "toplevel.h" #include "partselection.h" #include "functionselection.h" -#include "stactdeselection.h" +#include "stackselection.h" #include "stackbrowser.h" #include "tracedata.h" #include "configuration.h" -- cgit v1.2.3