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

List:       kde-commits
Subject:    KDE/kdepimlibs/akonadi
From:       Stephen Kelly <steveire () gmail ! com>
Date:       2011-01-10 13:43:39
Message-ID: 20110110134339.DD01EAC8B2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1213471 by skelly:

Remove the top-level search collection when there are no more search collections.

I'm still not convinced this is the right way to do this, but it's at least a
partial bug fix.

This reverts commit 1203272

 M  +15 -0     entitytreemodel_p.cpp  


--- trunk/KDE/kdepimlibs/akonadi/entitytreemodel_p.cpp #1213470:1213471
@@ -724,6 +724,21 @@
 
   const QModelIndex parentIndex = indexForCollection( m_collections.value( parentId ) );
 
+  // Top-level search collection
+  if ( parentId == 1 && m_childEntities.value( parentId ).size() == 1 && row == 0 ) {
+    // Special case for removing the last search folder.
+    // We need to remove the top-level search folder in that case.
+    const int searchCollectionRow = parentIndex.row();
+    q->beginRemoveRows( QModelIndex(), searchCollectionRow, searchCollectionRow );
+
+    removeChildEntities( parentId );
+    m_childEntities[ m_rootCollection.id() ].removeAt( searchCollectionRow );
+    m_collections.remove( parentId );
+
+    q->endRemoveRows();
+    return;
+  }
+
   q->beginRemoveRows( parentIndex, row, row );
 
   // Delete all descendant collections and items.
[prev in list] [next in list] [prev in thread] [next in thread] 

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