]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Check if the item supports sequencing before looking for sequence pixmaps
authorAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 14 May 2025 11:31:36 +0000 (14:31 +0300)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 14 May 2025 11:31:36 +0000 (14:31 +0300)
This patch checks the item first if the plugin it's using for it's previews even supports sequences. If not, we can then safely ignore the hover action for polling more sequences and avoid unnecessary work.

The sequencing support is false by default, so we set it true only when we know it's possible.

src/kitemviews/kfileitemlistwidget.cpp
src/kitemviews/kfileitemmodelrolesupdater.cpp

index e1da7192a20fc9b3fe7526c9dcc4c1c56f6c55c2..37b115cc3a7ca9972306be7b8118461bbfad988b 100644 (file)
@@ -219,7 +219,7 @@ void KFileItemListWidget::hoverSequenceIndexChanged(int sequenceIndex)
 {
     KFileItemListView *view = listView();
 
-    if (!view) {
+    if (!view || !data().value("supportsSequencing").toBool()) {
         return;
     }
 
index f9a50b9de67b9bf318c38d06e8b60d582a6bee87..497c13b525c6da3708d597057ea792585fdcec37 100644 (file)
@@ -570,6 +570,7 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem &item, const QPi
 
     QHash<QByteArray, QVariant> data = rolesData(item, index);
     data.insert("iconPixmap", transformPreviewPixmap(pixmap));
+    data.insert("supportsSequencing", m_previewJob->handlesSequences());
 
     disconnect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged);
     m_model->setData(index, data);