]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.h
Ported KIcon to QIcon
[dolphin.git] / src / kitemviews / kfileitemmodel.h
index 0224290238b6a2d77741b625c0d7212ba080baa9..62a283d33539f17afb053a641a1521bd606642d0 100644 (file)
@@ -130,14 +130,14 @@ public:
 
     /**
      * @return The index for the file-item \a item. -1 is returned if no file-item
-     *         is found or if the file-item is null. The runtime
+     *         is found or if the file-item is null. The amortized runtime
      *         complexity of this call is O(1).
      */
     int index(const KFileItem& item) const;
 
     /**
      * @return The index for the URL \a url. -1 is returned if no file-item
-     *         is found. The runtime complexity of this call is O(1).
+     *         is found. The amortized runtime complexity of this call is O(1).
      */
     int index(const KUrl& url) const;
 
@@ -187,14 +187,14 @@ public:
     {   QByteArray role;
         QString translation;
         QString group;
-        bool requiresNepomuk;
+        bool requiresBaloo;
         bool requiresIndexer;
     };
 
     /**
      * @return Provides static information for all available roles that
      *         are supported by KFileItemModel. Some roles can only be
-     *         determined if Nepomuk is enabled and/or the Nepomuk
+     *         determined if Baloo is enabled and/or the Baloo
      *         indexing is enabled.
      */
     static QList<RoleInfo> rolesInformation();
@@ -277,7 +277,6 @@ private slots:
     void slotItemsDeleted(const KFileItemList& items);
     void slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >& items);
     void slotClear();
-    void slotClear(const KUrl& url);
     void slotNaturalSortingChanged();
 
     void dispatchPendingItemsToInsert();
@@ -287,7 +286,7 @@ private:
         // User visible roles:
         NoRole, NameRole, SizeRole, DateRole, PermissionsRole, OwnerRole,
         GroupRole, TypeRole, DestinationRole, PathRole,
-        // User visible roles available with Nepomuk:
+        // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
         WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
         CopiedFromRole,
@@ -432,7 +431,7 @@ private:
         const char* const roleTranslation;
         const char* const groupTranslationContext;
         const char* const groupTranslation;
-        const bool requiresNepomuk;
+        const bool requiresBaloo;
         const bool requiresIndexer;
     };
 
@@ -470,7 +469,12 @@ private:
     Qt::CaseSensitivity m_caseSensitivity;
 
     QList<ItemData*> m_itemData;
-    QHash<KUrl, int> m_items; // Allows O(1) access for KFileItemModel::index(const KFileItem& item)
+
+    // m_items is a cache for the method index(const KUrl&). If it contains N
+    // entries, it is guaranteed that these correspond to the first N items in
+    // the model, i.e., that (for every i between 0 and N - 1)
+    // m_items.value(fileItem(i).url()) == i
+    mutable QHash<KUrl, int> m_items;
 
     KFileItemModelFilter m_filter;
     QHash<KFileItem, ItemData*> m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter()