diff options
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 56fdf4ad1..57a2551ad 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -106,6 +106,7 @@ DolphinView::DolphinView(QWidget* parent, m_rootUrl(), m_currentItemUrl(), m_createdItemUrl(), + m_selectedItems(), m_expandedDragSource(0) { m_topLayout = new QVBoxLayout(this); @@ -1109,6 +1110,12 @@ void DolphinView::selectAndScrollToCreatedItem() m_createdItemUrl = KUrl(); } +void DolphinView::restoreSelection() +{ + disconnect(m_dirLister, SIGNAL(completed()), this, SLOT(restoreSelection())); + changeSelection(m_selectedItems); +} + void DolphinView::emitContentsMoved() { // only emit the contents moved signal if: @@ -1183,6 +1190,11 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload) m_loadingDirectory = true; + if (reload) { + m_selectedItems = selectedItems(); + connect(m_dirLister, SIGNAL(completed()), this, SLOT(restoreSelection())); + } + m_dirLister->stop(); m_dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); @@ -1477,4 +1489,5 @@ QMimeData* DolphinView::selectionMimeData() const return m_dolphinModel->mimeData(selection.indexes()); } + #include "dolphinview.moc" |
