[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/konq-plugins/domtreeviewer
From:       Maks Orlovich <maksim () kde ! org>
Date:       2011-01-19 2:48:40
Message-ID: 20110119024840.82207AC8B7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1215557 by orlovich:

Fix bogus assert in search and expand tree when there is more than one "root"
node due to e.g. comments, and make it do the right thing instead.



 M  +6 -6      domtreeview.cpp  


--- trunk/KDE/kdebase/apps/konq-plugins/domtreeviewer/domtreeview.cpp \
#1215556:1215557 @@ -544,12 +544,11 @@
   const QString searchText = m_findDialog->pattern();
   Qt::CaseSensitivity caseSensitivity = (m_findDialog->options() & \
KFind::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive;  
-  kDebug() << "ITEMCOUNT:" << m_listView->topLevelItemCount();
-
-  assert(m_listView->topLevelItemCount() == 1);
-  QTreeWidgetItem *topLevelItem = m_listView->topLevelItem(0);
+  for (int i = 0; i < m_listView->topLevelItemCount(); ++i) {
+    QTreeWidgetItem *topLevelItem = m_listView->topLevelItem(i);
   searchRecursive(static_cast<DOMListViewItem*>(topLevelItem),
 		  searchText, caseSensitivity);
+  }
 
   m_findDialog->hide();
 }
@@ -740,9 +739,10 @@
   if (!cur_node_item)
     cur_node_item = static_cast<DOMListViewItem *>(m_listView->currentItem());
 
-  assert(m_listView->topLevelItemCount() == 1);
-  QTreeWidgetItem *topLevelItem = m_listView->topLevelItem(0);
+  for (int i = 0; i < m_listView->topLevelItemCount(); ++i) {
+    QTreeWidgetItem *topLevelItem = m_listView->topLevelItem(i);
   adjustDepthRecursively(topLevelItem, 0);
+  }
 
   // make current item visible again if possible
   if (cur_node_item)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic