Paste P170

Remove mDirListerFinished from ContextManager
ActivePublic

Authored by rkflx on Feb 24 2018, 5:52 PM.
diff --git a/lib/contextmanager.cpp b/lib/contextmanager.cpp
index 0b1275b2..78bac4ce 100644
--- a/lib/contextmanager.cpp
+++ b/lib/contextmanager.cpp
@@ -54,7 +54,6 @@ struct ContextManagerPrivate
QSet<QByteArray> mQueuedSignals;
KFileItemList mSelectedFileItemList;
- bool mDirListerFinished = false;
QTimer* mQueuedSignalsTimer;
void queueSignal(const QByteArray& signal)
@@ -120,8 +119,6 @@ ContextManager::ContextManager(SortedDirModel* dirModel, QObject* parent)
connect(d->mDirModel->dirLister(), SIGNAL(redirection(QUrl)),
SLOT(slotDirListerRedirection(QUrl)));
- connect(d->mDirModel->dirLister(), static_cast<void (KDirLister::*)()>(&KDirLister::completed), this, &ContextManager::slotDirListerCompleted);
-
d->mSelectionModel = new QItemSelectionModel(d->mDirModel);
connect(d->mSelectionModel, &QItemSelectionModel::selectionChanged, this, &ContextManager::slotSelectionChanged);
@@ -184,7 +181,6 @@ void ContextManager::setCurrentDirUrl(const QUrl &_url)
if (url.isValid() && KProtocolManager::supportsListing(url)) {
d->mCurrentDirUrl = url;
d->mDirModel->dirLister()->openUrl(url);
- d->mDirListerFinished = false;
} else {
d->mCurrentDirUrl.clear();
d->mDirModel->dirLister()->clear();
@@ -341,13 +337,6 @@ void ContextManager::selectUrlToSelect()
if (index.isValid()) {
d->mSelectionModel->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
d->mUrlToSelect = QUrl();
- } else if (d->mDirListerFinished) {
- // Desired URL cannot be found in the directory
- // Clear the selection to avoid dragging any local files into context
- // and manually set current URL
- d->mSelectionModel->clearSelection();
- setCurrentUrl(d->mUrlToSelect);
- d->mUrlToSelect.clear();
}
}
@@ -356,10 +345,5 @@ void ContextManager::slotDirListerRedirection(const QUrl &newUrl)
setCurrentDirUrl(newUrl);
}
-void ContextManager::slotDirListerCompleted()
-{
- d->mDirListerFinished = true;
-}
-
} // namespace
diff --git a/lib/contextmanager.h b/lib/contextmanager.h
index 8d6aae1f..67b7750c 100644
--- a/lib/contextmanager.h
+++ b/lib/contextmanager.h
@@ -95,7 +95,6 @@ private Q_SLOTS:
void slotRowsInserted();
void selectUrlToSelect();
void slotDirListerRedirection(const QUrl&);
- void slotDirListerCompleted();
private:
ContextManagerPrivate* const d;
rkflx edited the content of this paste. (Show Details)Feb 24 2018, 5:52 PM
rkflx changed the title of this paste from untitled to Masterwork From Distant Lands.
rkflx updated the paste's language from autodetect to autodetect.
rkflx changed the title of this paste from Masterwork From Distant Lands to Remove mDirListerFinished from ContextManager.
rkflx added a project: Gwenview.
rkflx added a comment.Feb 24 2018, 5:59 PM

See D9342#187442 for reference. Still needs thinking about consequences.