- // 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);