diff options
| author | Méven Car <[email protected]> | 2023-08-28 14:39:00 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-08-29 07:18:51 +0000 |
| commit | 079f903bc8691866b4aa3c3e41204a47e735c062 (patch) | |
| tree | 7d61e0e86d2a4e91e64f360efd01424fab8f3e8b /src/views | |
| parent | a55bba67bc47cc0a51ce2c5b160a69166459355a (diff) | |
Fix a bunch of clazy warnings
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinitemlistview.cpp | 2 | ||||
| -rw-r--r-- | src/views/dolphinview.cpp | 24 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 2 |
3 files changed, 12 insertions, 16 deletions
diff --git a/src/views/dolphinitemlistview.cpp b/src/views/dolphinitemlistview.cpp index 0efea844c..418c9bfe8 100644 --- a/src/views/dolphinitemlistview.cpp +++ b/src/views/dolphinitemlistview.cpp @@ -22,7 +22,7 @@ DolphinItemListView::DolphinItemListView(QGraphicsWidget *parent) : KFileItemListView(parent) , m_zoomLevel(0) { - updateFont(); + DolphinItemListView::updateFont(); updateGridSize(); } 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(); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index f851724c2..05b9e009c 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -824,6 +824,8 @@ private Q_SLOTS: void slotTwoClicksRenamingTimerTimeout(); + void onDirectoryLoadingCompleted(); + private: void loadDirectory(const QUrl &url, bool reload = false); |
