X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ba930ddb3635fe2d94d727e72aaf261513b28060..refs/heads/master:/src/kitemviews/kfileitemmodelrolesupdater.h diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index be6f23193..73e42cf17 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -89,6 +89,9 @@ public: void setIconSize(const QSize &size); QSize iconSize() const; + void setDevicePixelRatio(qreal devicePixelRatio); + qreal devicePixelRatio() const; + /** * Sets the range of items that are visible currently. The roles * of visible items are resolved first. @@ -175,6 +178,9 @@ public: */ void setHoverSequenceState(const QUrl &itemUrl, int seqIdx); +Q_SIGNALS: + void previewJobFinished(); // For unit testing + private Q_SLOTS: void slotItemsInserted(const KItemRangeList &itemRanges); void slotItemsRemoved(const KItemRangeList &itemRanges); @@ -260,7 +266,7 @@ private Q_SLOTS: void applyChangedBalooRoles(const QString &file); void applyChangedBalooRolesForItem(const KFileItem &file); - void slotDirectoryContentsCountReceived(const QString &path, int count, long size); + void slotDirectoryContentsCountReceived(const QString &path, int count, long long size); private: /** @@ -290,6 +296,7 @@ private: * Transforms a raw preview image, applying scale and frame. * * @param pixmap A raw preview image from a PreviewJob. + * @param overlays the overlays to add to the pixmap * @return The scaled and decorated preview image. */ QPixmap transformPreviewPixmap(const QPixmap &pixmap); @@ -312,6 +319,8 @@ private: /** * Resolves the sort role of the item and applies it to the model. + * Despite the name, this handles both sorting and grouping, as + * regrouping never happens without resorting at the same time. */ void applySortRole(int index); @@ -333,7 +342,15 @@ private: void trimHoverSequenceLoadedItems(); + void resetSizeData(const int index, const int size = 0); + + void recountDirectoryItems(const QList directories); + private: + QSize cacheSize(); + /** + * enqueue directory size counting for KFileItem item at index + */ void startDirectorySizeCounting(const KFileItem &item, int index); enum State { Idle, Paused, ResolvingSortRole, ResolvingAllRoles, PreviewJobRunning }; @@ -363,6 +380,7 @@ private: KFileItemModel *m_model; QSize m_iconSize; + qreal m_devicePixelRatio; int m_firstVisibleIndex; int m_lastVisibleIndex; int m_maximumVisibleItems; @@ -370,7 +388,6 @@ private: QSet m_resolvableRoles; QStringList m_enabledPlugins; qulonglong m_localFileSizePreviewLimit; - bool m_scanDirectories; // Items for which the sort role still has to be determined. QSet m_pendingSortRoleItems;