* get rid of redundant parameter in constructors of DolphinView and DolphinViewContainer
svn path=/trunk/KDE/kdebase/apps/; revision=677654
const DolphinView* view = m_viewContainer[PrimaryView]->view();
m_viewContainer[SecondaryView] = new DolphinViewContainer(this,
0,
- view->rootUrl(),
- view->mode(),
- view->showHiddenFiles());
+ view->rootUrl());
connectViewSignals(SecondaryView);
m_splitter->addWidget(m_viewContainer[SecondaryView]);
m_splitter->setSizes(QList<int>() << newWidth << newWidth);
setCaption(homeUrl.fileName());
ViewProperties props(homeUrl);
m_viewContainer[PrimaryView] = new DolphinViewContainer(this,
- m_splitter,
- homeUrl,
- props.viewMode(),
- props.showHiddenFiles());
+ m_splitter,
+ homeUrl);
m_activeViewContainer = m_viewContainer[PrimaryView];
connectViewSignals(PrimaryView);
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),
connect(m_controller, SIGNAL(viewportEntered()),
this, SLOT(clearHoverInformation()));
- createView();
+ applyViewProperties(url);
m_topLayout->addWidget(itemView());
}
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);
}
}
-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();
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()) {
m_controller->setShowPreview(showPreview);
emit showPreviewChanged();
}
-
- startDirLister(url);
- emit urlChanged(url);
}
void DolphinView::changeSelection(const KFileItemList& selection)
* @param proxyModel Used proxy model which specifies the sorting. The
* model is not owned by the view and won't get
* deleted.
- * @param mode Used display mode (IconsView, DetailsView or ColumnsView).
- * @param showHiddenFiles If true, hidden files will be shown in the view.
*/
DolphinView(QWidget* parent,
const KUrl& url,
KDirLister* dirLister,
KDirModel* dirModel,
- DolphinSortFilterProxyModel* proxyModel,
- Mode mode);
+ DolphinSortFilterProxyModel* proxyModel);
virtual ~DolphinView();
private:
void startDirLister(const KUrl& url, bool reload = false);
+ /**
+ * Applies the view properties which are defined by the current URL
+ * m_url to the DolphinView properties.
+ */
+ void applyViewProperties(const KUrl& url);
+
/**
* Creates a new view representing the given view mode (DolphinView::mode()).
* The current view will get deleted.
DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
QWidget* parent,
- const KUrl& url,
- DolphinView::Mode mode,
- bool showHiddenFiles) :
+ const KUrl& url) :
QWidget(parent),
m_showProgress(false),
m_folderCount(0),
m_dirLister = new DolphinDirLister();
m_dirLister->setAutoUpdate(true);
m_dirLister->setMainWindow(this);
- m_dirLister->setShowingDotFiles(showHiddenFiles);
m_dirLister->setDelayedMimeTypes(true);
m_dirModel = new KDirModel();
url,
m_dirLister,
m_dirModel,
- m_proxyModel,
- mode);
+ m_proxyModel);
connect(m_view, SIGNAL(urlChanged(const KUrl&)),
m_urlNavigator, SLOT(setUrl(const KUrl&)));
connect(m_view, SIGNAL(requestContextMenu(KFileItem*, const KUrl&)),
public:
DolphinViewContainer(DolphinMainWindow* mainwindow,
QWidget *parent,
- const KUrl& url,
- DolphinView::Mode mode = DolphinView::IconsView,
- bool showHiddenFiles = false);
+ const KUrl& url);
virtual ~DolphinViewContainer();