mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 00:11:21 +00:00
Simplify the DolphinController: The "show hidden files" state can be retrieved by the DolphinView, there is no need introducing additional signals + states. Further cleanups will follow...
svn path=/trunk/KDE/kdebase/apps/; revision=729721
This commit is contained in:
parent
1f331872b2
commit
c1f27bb620
|
@ -66,8 +66,8 @@ DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* control
|
|||
this, SLOT(zoomIn()));
|
||||
connect(controller, SIGNAL(zoomOut()),
|
||||
this, SLOT(zoomOut()));
|
||||
connect(controller, SIGNAL(showHiddenFilesChanged(bool)),
|
||||
this, SLOT(slotShowHiddenFilesChanged(bool)));
|
||||
connect(controller->dolphinView(), SIGNAL(showHiddenFilesChanged()),
|
||||
this, SLOT(slotShowHiddenFilesChanged()));
|
||||
connect(controller, SIGNAL(showPreviewChanged(bool)),
|
||||
this, SLOT(slotShowPreviewChanged(bool)));
|
||||
connect(controller, SIGNAL(activationChanged(bool)),
|
||||
|
@ -409,8 +409,9 @@ void DolphinColumnView::updateColumnsBackground(bool active)
|
|||
}
|
||||
}
|
||||
|
||||
void DolphinColumnView::slotShowHiddenFilesChanged(bool show)
|
||||
void DolphinColumnView::slotShowHiddenFilesChanged()
|
||||
{
|
||||
const bool show = m_controller->dolphinView()->showHiddenFiles();
|
||||
foreach (DolphinColumnWidget* column, m_columns) {
|
||||
column->setShowHiddenFiles(show);
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ private slots:
|
|||
*/
|
||||
void updateColumnsBackground(bool active);
|
||||
|
||||
void slotShowHiddenFilesChanged(bool show);
|
||||
void slotShowHiddenFilesChanged();
|
||||
void slotShowPreviewChanged(bool show);
|
||||
|
||||
private:
|
||||
|
|
|
@ -111,7 +111,8 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
|
|||
m_dirLister->setAutoUpdate(true);
|
||||
m_dirLister->setMainWindow(this);
|
||||
m_dirLister->setDelayedMimeTypes(true);
|
||||
m_dirLister->setShowingDotFiles(m_view->m_controller->showHiddenFiles());
|
||||
const bool showHiddenFiles = m_view->m_controller->dolphinView()->showHiddenFiles();
|
||||
m_dirLister->setShowingDotFiles(showHiddenFiles);
|
||||
connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
|
||||
this, SLOT(generatePreviews(const KFileItemList&)));
|
||||
|
||||
|
|
|
@ -23,11 +23,9 @@
|
|||
|
||||
DolphinController::DolphinController(DolphinView* dolphinView) :
|
||||
QObject(dolphinView),
|
||||
m_showHiddenFiles(false),
|
||||
m_showPreview(false),
|
||||
m_zoomInPossible(false),
|
||||
m_zoomOutPossible(false),
|
||||
//m_additionalInfoCount(0),
|
||||
m_url(),
|
||||
m_dolphinView(dolphinView)
|
||||
{
|
||||
|
@ -87,14 +85,6 @@ void DolphinController::indicateAdditionalInfoChange(const KFileItemDelegate::In
|
|||
emit additionalInfoChanged(info);
|
||||
}
|
||||
|
||||
void DolphinController::setShowHiddenFiles(bool show)
|
||||
{
|
||||
if (m_showHiddenFiles != show) {
|
||||
m_showHiddenFiles = show;
|
||||
emit showHiddenFilesChanged(show);
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinController::setShowPreview(bool show)
|
||||
{
|
||||
if (m_showPreview != show) {
|
||||
|
@ -103,14 +93,6 @@ void DolphinController::setShowPreview(bool show)
|
|||
}
|
||||
}
|
||||
|
||||
/*void DolphinController::setAdditionalInfoCount(int count)
|
||||
{
|
||||
if (m_additionalInfoCount != count) {
|
||||
m_additionalInfoCount = count;
|
||||
emit additionalInfoCountChanged(count);
|
||||
}
|
||||
}*/
|
||||
|
||||
void DolphinController::indicateActivationChange(bool active)
|
||||
{
|
||||
emit activationChanged(active);
|
||||
|
|
|
@ -66,7 +66,6 @@ class QWidget;
|
|||
* - setUrl()
|
||||
* - setShowHiddenFiles()
|
||||
* - setShowPreview()
|
||||
* - setAdditionalInfoCount()
|
||||
* - indicateActivationChange()
|
||||
* - triggerZoomIn()
|
||||
* - triggerZoomOut()
|
||||
|
@ -160,14 +159,6 @@ public:
|
|||
*/
|
||||
void indicateAdditionalInfoChange(const KFileItemDelegate::InformationList& info);
|
||||
|
||||
/**
|
||||
* Informs the view implementation about a change of the show hidden files
|
||||
* state and is invoked by the abstract Dolphin view.
|
||||
* The signal showHiddenFilesChanged() is emitted.
|
||||
*/
|
||||
void setShowHiddenFiles(bool show);
|
||||
bool showHiddenFiles() const;
|
||||
|
||||
/**
|
||||
* Informs the view implementation about a change of the show preview
|
||||
* state and is invoked by the abstract Dolphin view.
|
||||
|
@ -176,14 +167,6 @@ public:
|
|||
void setShowPreview(bool show);
|
||||
bool showPreview() const;
|
||||
|
||||
/**
|
||||
* Informs the view implementation about a change of the number of
|
||||
* additional informations and is invoked by the abstract Dolphin view.
|
||||
* The signal additionalInfoCountChanged() is emitted.
|
||||
*/
|
||||
//void setAdditionalInfoCount(int count);
|
||||
//bool additionalInfoCount() const;
|
||||
|
||||
/**
|
||||
* Informs the view implementation about a change of the activation
|
||||
* state and is invoked by the abstract Dolphin view. The signal
|
||||
|
@ -307,14 +290,6 @@ signals:
|
|||
*/
|
||||
void additionalInfoChanged(const KFileItemDelegate::InformationList& info);
|
||||
|
||||
/**
|
||||
* Is emitted if the state for showing hidden files has been
|
||||
* changed to \a show by the abstract Dolphin view. The view
|
||||
* implementation might connect to this signal if custom
|
||||
* updates are required in this case.
|
||||
*/
|
||||
void showHiddenFilesChanged(bool show);
|
||||
|
||||
/**
|
||||
* Is emitted if the state for showing previews has been
|
||||
* changed to \a show by the abstract Dolphin view.
|
||||
|
@ -323,14 +298,6 @@ signals:
|
|||
*/
|
||||
void showPreviewChanged(bool show);
|
||||
|
||||
/**
|
||||
* Is emitted if the number of additional informations has been
|
||||
* changed to \a count by the abstract Dolphin view.
|
||||
* The view implementation might connect to this signal if custom
|
||||
* updates are required in this case.
|
||||
*/
|
||||
//void additionalInfoCountChanged(int count);
|
||||
|
||||
/**
|
||||
* Is emitted if the activation state has been changed to \a active
|
||||
* by the abstract Dolphin view.
|
||||
|
@ -374,11 +341,9 @@ signals:
|
|||
void zoomOut();
|
||||
|
||||
private:
|
||||
bool m_showHiddenFiles;
|
||||
bool m_showPreview;
|
||||
bool m_zoomInPossible;
|
||||
bool m_zoomOutPossible;
|
||||
//int m_additionalInfoCount;
|
||||
KUrl m_url;
|
||||
DolphinView* m_dolphinView;
|
||||
};
|
||||
|
@ -393,21 +358,11 @@ inline const KUrl& DolphinController::url() const
|
|||
return m_url;
|
||||
}
|
||||
|
||||
inline bool DolphinController::showHiddenFiles() const
|
||||
{
|
||||
return m_showHiddenFiles;
|
||||
}
|
||||
|
||||
inline bool DolphinController::showPreview() const
|
||||
{
|
||||
return m_showPreview;
|
||||
}
|
||||
|
||||
/*inline bool DolphinController::additionalInfoCount() const
|
||||
{
|
||||
return m_additionalInfoCount;
|
||||
}*/
|
||||
|
||||
inline void DolphinController::setZoomInPossible(bool possible)
|
||||
{
|
||||
m_zoomInPossible = possible;
|
||||
|
|
|
@ -253,7 +253,6 @@ void DolphinView::setShowHiddenFiles(bool show)
|
|||
props.setShowHiddenFiles(show);
|
||||
|
||||
m_dirLister->setShowingDotFiles(show);
|
||||
m_controller->setShowHiddenFiles(show);
|
||||
emit showHiddenFilesChanged();
|
||||
|
||||
loadDirectory(viewPropsUrl, true);
|
||||
|
@ -655,7 +654,6 @@ void DolphinView::applyViewProperties(const KUrl& url)
|
|||
const bool showHiddenFiles = props.showHiddenFiles();
|
||||
if (showHiddenFiles != m_dirLister->showingDotFiles()) {
|
||||
m_dirLister->setShowingDotFiles(showHiddenFiles);
|
||||
m_controller->setShowHiddenFiles(showHiddenFiles);
|
||||
emit showHiddenFilesChanged();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue