diff options
| author | Méven Car <[email protected]> | 2023-12-16 13:14:17 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-12-18 10:10:11 +0000 |
| commit | 3430ad167355436c81fd1248d106e3f6f61d1594 (patch) | |
| tree | bbf0bbdca5a3abb15b1b6f3ee9f65fcb1def68eb /src | |
| parent | b3fd75e44ff37fb47619cd0a5c16ddcc27edd1f5 (diff) | |
DolphinView: Ensure to update the whole viewState after a job created files
BUG: 476670
Diffstat (limited to 'src')
| -rw-r--r-- | src/views/dolphinview.cpp | 8 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 4e74245c1..8190c1778 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1422,10 +1422,12 @@ void DolphinView::slotItemCreated(const QUrl &url) } } -void DolphinView::onDirectoryLoadingCompleted() +void DolphinView::onDirectoryLoadingCompletedAfterJob() { // the model should now contain all the items created by the job - updateSelectionState(); + m_selectJobCreatedItems = true; // to make sure we overwrite selection + // update the view: scroll into View and selection + updateViewState(); m_selectJobCreatedItems = false; m_selectedUrls.clear(); } @@ -1445,7 +1447,7 @@ void DolphinView::slotJobResult(KJob *job) updateSelectionState(); if (!m_selectedUrls.isEmpty()) { // not all urls were found, the model may not be up to date - connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::onDirectoryLoadingCompleted, Qt::UniqueConnection); + connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::onDirectoryLoadingCompletedAfterJob, Qt::SingleShotConnection); } else { m_selectJobCreatedItems = false; m_selectedUrls.clear(); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 0b0c83487..8b31f2b43 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -829,7 +829,7 @@ private Q_SLOTS: void slotTwoClicksRenamingTimerTimeout(); - void onDirectoryLoadingCompleted(); + void onDirectoryLoadingCompletedAfterJob(); private: void loadDirectory(const QUrl &url, bool reload = false); |
