]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Two small optimizations in KFileItemModel::removeItems()
authorFrank Reininghaus <frank78ac@googlemail.com>
Sun, 3 Feb 2013 22:28:57 +0000 (23:28 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sun, 3 Feb 2013 22:28:57 +0000 (23:28 +0100)
1. It seems that it really can happen that KFileItems that we get from
   the dir lister's itemsDeleted signal are not in the model any more,
   e.g., if a folder where hidden files are shown is left and a folder
   where hidden files are not shown is entered. There is no need to
   output warnings then.
2. Remove the emptiness-check for the KFileItemList at the beginning.
   Even in the unlikely event that we do get an empty list, we return
   just a few lines later in the code.

src/kitemviews/kfileitemmodel.cpp

index a30e30e0f59497b1f5503ab0bdec9f5963b8ff19..e315eee505236e9778c75327d154afe330eaacf4 100644 (file)
@@ -1031,10 +1031,6 @@ static KItemRangeList sortedIndexesToKItemRangeList(const QList<int>& sortedNumb
 
 void KFileItemModel::removeItems(const KFileItemList& items)
 {
-    if (items.isEmpty()) {
-        return;
-    }
-
 #ifdef KFILEITEMMODEL_DEBUG
     kDebug() << "Removing " << items.count() << "items";
 #endif
@@ -1059,8 +1055,6 @@ void KFileItemModel::removeItems(const KFileItemList& items)
             ItemData* data = m_itemData.at(index);
             delete data;
             m_itemData[index] = 0;
-        } else {
-            kWarning() << "Item that should be deleted has not been found!";
         }
     }