┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2023-08-28 14:39:00 +0200
committerMéven Car <[email protected]>2023-08-29 07:18:51 +0000
commit079f903bc8691866b4aa3c3e41204a47e735c062 (patch)
tree7d61e0e86d2a4e91e64f360efd01424fab8f3e8b /src/views/dolphinview.cpp
parenta55bba67bc47cc0a51ce2c5b160a69166459355a (diff)
Fix a bunch of clazy warnings
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index d0d524196..a91d76358 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1419,6 +1419,14 @@ void DolphinView::slotItemCreated(const QUrl &url)
}
}
+void DolphinView::onDirectoryLoadingCompleted()
+{
+ // the model should now contain all the items created by the job
+ updateSelectionState();
+ m_selectJobCreatedItems = false;
+ m_selectedUrls.clear();
+}
+
void DolphinView::slotJobResult(KJob *job)
{
if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
@@ -1434,21 +1442,7 @@ void DolphinView::slotJobResult(KJob *job)
updateSelectionState();
if (!m_selectedUrls.isEmpty()) {
// not all urls were found, the model may not be up to date
- // TODO KF6 replace with Qt::singleShotConnection
- QMetaObject::Connection *const connection = new QMetaObject::Connection;
- *connection = connect(
- m_model,
- &KFileItemModel::directoryLoadingCompleted,
- this,
- [this, connection]() {
- // the model should now contain all the items created by the job
- updateSelectionState();
- m_selectJobCreatedItems = false;
- m_selectedUrls.clear();
- QObject::disconnect(*connection);
- delete connection;
- },
- Qt::UniqueConnection);
+ connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::onDirectoryLoadingCompleted, Qt::UniqueConnection);
} else {
m_selectJobCreatedItems = false;
m_selectedUrls.clear();