┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorRahman Duran <[email protected]>2009-03-30 07:18:32 +0000
committerRahman Duran <[email protected]>2009-03-30 07:18:32 +0000
commit91a6bbf95a603965a4afea666ed0392fb5aa0fbb (patch)
treefa01b31968e58db83f59d8747f7b5202d9f4e55d /src/dolphinview.cpp
parent164706fdb45f81a5e5835f15c108ade6c669208b (diff)
BUG: 187732
Make Dolphin to remember selected files after view refresh. svn path=/trunk/KDE/kdebase/apps/; revision=946726
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp13
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"