┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-03-08 22:25:53 +0100
committerPeter Penz <[email protected]>2011-03-08 22:32:49 +0100
commit39911cad181a168b917b67fb2963e8ebb942210c (patch)
tree8273260cbb08f9e24cb9a283d63c847e8acfaedf /src/views/dolphinview.cpp
parent8d3b22169056d7774089c44dd7682ce7165b4fd5 (diff)
Prevent unnecessary reloading of KDirLister on startup
When Dolphin is started with a directory as argument unnecessary reload operations of KDirListers are done. The patch improves this by just letting the DolphinView internally do a loading as soon as it gets visible (and without reloading). Also in case if only one directory is passed as argument the current tab gets reused instead of creating new tabs and removing the current tab. Thanks a lot to David Faure for pointing out this unefficient handling.
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 4ab16e052..6108c9d4a 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -768,6 +768,14 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
return QWidget::eventFilter(watched, event);
}
+void DolphinView::showEvent(QShowEvent* event)
+{
+ QWidget::showEvent(event);
+ if (!event->spontaneous()) {
+ loadDirectory(url());
+ }
+}
+
void DolphinView::activate()
{
setActive(true);