┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-04-15 18:40:08 +0000
committerPeter Penz <[email protected]>2009-04-15 18:40:08 +0000
commit0a133e9ef83a48eb305f6af4d2141ffc9bc987b6 (patch)
tree62f366986c7506dc2f768ff28eaf310426d03cb1 /src/dolphinview.cpp
parentb2c1a2a03c9a99794a8308e2b194442d6c2c8578 (diff)
After restoring the current item when going back to a folder, the current-item URL must be cleared to prevent moving the focus when the directory content will be changed later.
BUG: 189522 svn path=/trunk/KDE/kdebase/apps/; revision=954402
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 57a2551ad..ed17c94ab 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -1156,15 +1156,18 @@ void DolphinView::slotRequestUrlChange(const KUrl& url)
void DolphinView::restoreCurrentItem()
{
- const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_currentItemUrl);
- if (dirIndex.isValid()) {
- const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
- QAbstractItemView* view = itemView();
- const bool clearSelection = !hasSelection();
- view->setCurrentIndex(proxyIndex);
- if (clearSelection) {
- view->clearSelection();
+ if (!m_currentItemUrl.isEmpty()) {
+ const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_currentItemUrl);
+ if (dirIndex.isValid()) {
+ const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+ QAbstractItemView* view = itemView();
+ const bool clearSelection = !hasSelection();
+ view->setCurrentIndex(proxyIndex);
+ if (clearSelection) {
+ view->clearSelection();
+ }
}
+ m_currentItemUrl.clear();
}
}