┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-06-19 16:35:52 +0000
committerPeter Penz <[email protected]>2007-06-19 16:35:52 +0000
commit5926d0fddd94d25a5546eee82a6dd8f072196b83 (patch)
tree84d7772c5aa8031702c8e69d090e8b74f8a159cb /src/dolphinview.cpp
parentd79282c14cc49fc774dbcccfcb6bdfedcac03870 (diff)
* fixed issue that some view properties like "show in groups" are ignored when a new DolphinViewContainer has been created (happens on startup or when a view is split)
* get rid of redundant parameter in constructors of DolphinView and DolphinViewContainer svn path=/trunk/KDE/kdebase/apps/; revision=677654
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 5d7ab076f..057916906 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -57,13 +57,12 @@ DolphinView::DolphinView(QWidget* parent,
const KUrl& url,
KDirLister* dirLister,
KDirModel* dirModel,
- DolphinSortFilterProxyModel* proxyModel,
- Mode mode) :
+ DolphinSortFilterProxyModel* proxyModel) :
QWidget(parent),
m_active(true),
m_loadingDirectory(false),
m_initializeColumnView(false),
- m_mode(mode),
+ m_mode(DolphinView::IconsView),
m_topLayout(0),
m_controller(0),
m_iconsView(0),
@@ -107,7 +106,7 @@ DolphinView::DolphinView(QWidget* parent,
connect(m_controller, SIGNAL(viewportEntered()),
this, SLOT(clearHoverInformation()));
- createView();
+ applyViewProperties(url);
m_topLayout->addWidget(itemView());
}
@@ -419,6 +418,20 @@ void DolphinView::refresh()
reload();
}
+void DolphinView::setUrl(const KUrl& url)
+{
+ if (m_controller->url() == url) {
+ return;
+ }
+
+ m_controller->setUrl(url);
+
+ applyViewProperties(url);
+
+ startDirLister(url);
+ emit urlChanged(url);
+}
+
void DolphinView::mouseReleaseEvent(QMouseEvent* event)
{
QWidget::mouseReleaseEvent(event);
@@ -582,14 +595,8 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
}
}
-void DolphinView::setUrl(const KUrl& url)
+void DolphinView::applyViewProperties(const KUrl& url)
{
- if (m_controller->url() == url) {
- return;
- }
-
- m_controller->setUrl(url);
-
const ViewProperties props(url);
const Mode mode = props.viewMode();
@@ -615,6 +622,11 @@ void DolphinView::setUrl(const KUrl& url)
m_initializeColumnView = true;
}
}
+ if (itemView() == 0) {
+ createView();
+ }
+ Q_ASSERT(itemView() != 0);
+ Q_ASSERT(m_fileItemDelegate != 0);
const bool showHiddenFiles = props.showHiddenFiles();
if (showHiddenFiles != m_dirLister->showingDotFiles()) {
@@ -662,9 +674,6 @@ void DolphinView::setUrl(const KUrl& url)
m_controller->setShowPreview(showPreview);
emit showPreviewChanged();
}
-
- startDirLister(url);
- emit urlChanged(url);
}
void DolphinView::changeSelection(const KFileItemList& selection)