00001 #ifndef __KMTRACE_LEAKSVIEW__H__ 00002 #define __KMTRACE_LEAKSVIEW__H__ 00003 00004 // Qt includes 00005 #include <qwidget.h> 00006 00007 // KDE include 00008 #include <klistview.h> 00009 #include <kpopupmenu.h> 00010 00011 // KMtraceViewer includes 00012 #include "KMtraceModel.hh" 00013 #include "KMtraceLeaksViewItem.hh" 00014 #include "KMtraceLeaksFindDialog.hh" 00015 #include "KMtraceSuppressDialog.hh" 00016 00027 class KMtraceLeaksView : public KListView 00028 { 00029 Q_OBJECT 00030 00031 public: 00038 KMtraceLeaksView( QWidget *parent, KMtraceModel *model ); 00039 00048 void setModel( KMtraceModel *model ); 00049 00057 void setShowSuppressed( bool show ); 00058 00059 signals: 00071 void moduleChanged( QString module, int line ); 00072 00081 void moduleUnselect( ); 00082 00083 public slots: 00087 void slotExpandAll( ); 00088 00092 void slotCollapseAll( ); 00093 00097 void slotFind( ); 00098 00099 private slots: 00100 void slotContextLeak( QListViewItem *item, const QPoint &point, int column ); 00101 void slotSelectionChanged( QListViewItem *item ); 00102 void slotExecuted( QListViewItem *item ); 00103 void slotSearch( ); 00104 void slotSearchDone( ); 00105 void slotSuppress( KMtraceLeak *leak, QString string ); 00106 void slotSuppressionChanged( KMtraceLeak *leak ); 00107 00108 private: 00109 // expand all call stacks of all memory leaks 00110 void doExpandAll( ); 00111 00112 // collapse all call stacks of all memory leaks 00113 void doCollapseAll( ); 00114 00115 // called if a memory leak gets selected by the user. Depending 00116 // whether the user sets the focus on an item of the call stack 00117 // with source code or not the signal moduleChanged respectively 00118 // moduleUnselect is emitted. 00119 void doSelectItem( QListViewItem *item ); 00120 00121 // starts or continues the search of a KMtraceLeakFindDialog and 00122 // select the item if a matching one is found. 00123 void doSearch( int where, QString what, 00124 bool caseSensitive ); 00125 00126 // contains the model of the view (list of leaks with callstacks) 00127 KMtraceModel *m_model; 00128 00129 // the popup menu for leaks 00130 KPopupMenu *m_menu; 00131 00132 // itentifier for the "Suppress" context menu operation 00133 int m_menuItemIdSuppress; 00134 00135 // the leak find dialog (keep it non-modal) 00136 KMtraceLeaksFindDialog *m_findDialog; 00137 00138 // the suppress dialog (simple version to add a suppression) 00139 KMtraceSuppressDialog *m_suppressDialog; 00140 00141 // the current search position in the find dialog (an iterator, 00142 // the currently found item and a Y coordinate which indicates 00143 // where the found item is positioned from the origin of the 00144 // KListView (easier way possible?). This is needed to set the 00145 // focus onto the found memory leak. 00146 QListViewItemIterator *m_findIterator; 00147 QListViewItem *m_findItem; 00148 int m_posY; 00149 00150 bool m_showSuppressed; 00151 }; 00152 00153 #endif