From eca160ae5a2dbd5590e4bae22cddde488dbacf74 Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Thu, 19 Dec 2024 10:04:16 +0000 Subject: dolphinview: Update thumbnail on filename change If filename of an item was updated previously, it would modify the model before the file was actually changed. This led to the model calling a signal that would try to run a previewjob, but since the filename is not actually changed yet on disk, it would fail. This patch moves the model updating after copyjob. Copyjob will take care of the file renaming if there is already existing file. We just need to update the model correctly after the job has succeeded. BUG:497555 --- src/kitemviews/kfileitemmodelrolesupdater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.cpp') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index ac14ed795..8811401b0 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -575,6 +575,7 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem &item, const QPi disconnect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged); m_model->setData(index, data); connect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged); + Q_EMIT previewJobFinished(); // For unit testing m_finishedItems.insert(item); } -- cgit v1.3