diff options
| author | 2010-03-25 16:04:33 +0000 | |
|---|---|---|
| committer | 2010-03-25 16:04:33 +0000 | |
| commit | 2d86fcb132fa88c926fed40bb17ced8ddc420379 (patch) | |
| tree | a651e6cccb3933d35dd956aa8024bb2de249108c | |
| parent | fix for #751 (diff) | |
| download | KVIrc-2d86fcb132fa88c926fed40bb17ced8ddc420379.tar.gz KVIrc-2d86fcb132fa88c926fed40bb17ced8ddc420379.tar.bz2 KVIrc-2d86fcb132fa88c926fed40bb17ced8ddc420379.zip | |
Code cleaning in classeditor
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4215 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | src/modules/classeditor/classeditor.cpp | 40 | ||||
| -rw-r--r-- | src/modules/classeditor/classeditor.h | 6 |
2 files changed, 12 insertions, 34 deletions
diff --git a/src/modules/classeditor/classeditor.cpp b/src/modules/classeditor/classeditor.cpp index c6b5eaa2b..88dbbc810 100644 --- a/src/modules/classeditor/classeditor.cpp +++ b/src/modules/classeditor/classeditor.cpp @@ -796,37 +796,13 @@ void KviClassEditor::customContextMenuRequested(QPoint pnt) m_pContextPopup->insertItem( *(g_pIconManager->getSmallIcon(KVI_SMALLICON_NAMESPACE)), - __tr2qs_ctx("Collapse All Namespaces","editor"), - this,SLOT(slotCollapseNamespaces())); + __tr2qs_ctx("Collapse All Items","editor"), + this,SLOT(slotCollapseItems())); m_pContextPopup->setItemEnabled(id,bHasItems); m_pContextPopup->popup( m_pTreeWidget->mapToGlobal(pnt)); } -/* -void KviClassEditor::recursiveSearchReplace(const QString &szSearch,KviClassEditorTreeWidgetItem * it,bool bReplace,const QString &szReplace) -{ - - if(!it)return; - for(int i=0;i< it->childCount();i++) - { - if(((KviClassEditorTreeWidgetItem *)it->child(i))->isClass()) - { - if(((KviClassEditorTreeWidgetItem *)it->child(i))->buffer().indexOf(szSearch,0,Qt::CaseInsensitive) != -1) - { - it->child(i)->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIASHIGHLIGHTED)))); - if (bReplace) ((QString &)((KviClassEditorTreeWidgetItem *)it->child(i))->buffer()).replace(szSearch,szReplace,Qt::CaseInsensitive); - it->setExpanded(true); - } - else - it->child(i)->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIAS)))); - } - else { - recursiveSearchReplace(szSearch,(KviClassEditorTreeWidgetItem *)(it->child(i)),bReplace,szReplace); - } - } -} -*/ void KviClassEditor::searchReplace(const QString &szSearch,bool bReplace,const QString &szReplace) { KviPointerHashTableIterator<QString,KviClassEditorTreeWidgetItem> it (*m_pClasses); @@ -878,8 +854,8 @@ void KviClassEditor::slotFindWord(const QString &szSearch) { m_pEditor->setFindText(szSearch); } -/* -void KviClassEditor::recursiveCollapseNamespaces(KviClassEditorTreeWidgetItem * it) + +void KviClassEditor::recursiveCollapseItems(KviClassEditorTreeWidgetItem * it) { if(!it)return; for (int i=0;i<it->childCount();i++) @@ -887,22 +863,22 @@ void KviClassEditor::recursiveCollapseNamespaces(KviClassEditorTreeWidgetItem * if(it->child(i)->childCount()) { it->child(i)->setExpanded(false); - recursiveCollapseNamespaces((KviClassEditorTreeWidgetItem *)it->child(i)); + recursiveCollapseItems((KviClassEditorTreeWidgetItem *)it->child(i)); } } } -void KviClassEditor::slotCollapseNamespaces() +void KviClassEditor::slotCollapseItems() { for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++) { if (m_pTreeWidget->topLevelItem(i)->childCount()){ m_pTreeWidget->topLevelItem(i)->setExpanded(false); - recursiveCollapseNamespaces((KviClassEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); + recursiveCollapseItems((KviClassEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); } } } - +/* void KviClassEditor::slotReplaceAll(const QString &szFind,const QString &szReplace) { m_pEditor->setFindText(szReplace); diff --git a/src/modules/classeditor/classeditor.h b/src/modules/classeditor/classeditor.h index 579d116bf..b3cdce3ff 100644 --- a/src/modules/classeditor/classeditor.h +++ b/src/modules/classeditor/classeditor.h @@ -165,13 +165,15 @@ protected slots: void slotFind(); void slotFindWord(const QString &); void searchReplace(const QString &szSearch,bool bReplace=false,const QString &szReplace="n"); + void slotCollapseItems(); + void recursiveCollapseItems(KviClassEditorTreeWidgetItem * it); /* void slotFind(); - void slotCollapseNamespaces(); + void slotReplaceAll(const QString &before,const QString &after); void classRefresh(const QString &szName); @@ -180,7 +182,7 @@ protected slots: protected: KviPointerHashTable<QString,KviClassEditorTreeWidgetItem> *m_pClasses; // KviClassEditorTreeWidgetItemDelegate *m_pItemDelegate; - /* void recursiveCollapseNamespaces(KviClassEditorTreeWidgetItem * it); + /* void recursiveSearchReplace(const QString &szSearch,KviClassEditorTreeWidgetItem * it,bool bReplace=false,const QString &szReplace="n"); */ |
