]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Simplify the DolphinController: The "show hidden files" state can be retrieved by...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 26 Oct 2007 18:34:45 +0000 (18:34 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 26 Oct 2007 18:34:45 +0000 (18:34 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=729721

src/dolphincolumnview.cpp
src/dolphincolumnview.h
src/dolphincolumnwidget.cpp
src/dolphincontroller.cpp
src/dolphincontroller.h
src/dolphinview.cpp

index d806ad8b2b3e80190a55ba16d5ebfcf917041d6c..7f6b37830ade1f8a3a1de3b58ede98b222b5f8cf 100644 (file)
@@ -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);
     }
index f7107265aa7880c85f2606de9954766d12a6d955..1c972ad39f1e26b764db43f1d79fea3099e64fe2 100644 (file)
@@ -128,7 +128,7 @@ private slots:
      */
     void updateColumnsBackground(bool active);
 
-    void slotShowHiddenFilesChanged(bool show);
+    void slotShowHiddenFilesChanged();
     void slotShowPreviewChanged(bool show);
 
 private:
index 62e79537e53226d544445ed96e68dc3eb03b3d58..c24ae50c20f65404505ca14b634d244d24f97575 100644 (file)
@@ -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&)));
 
index ebd85e021922c32d6af2be9e66cf178863dd5811..bdb97170b4e2c1c3567369f26131b1f181e5290a 100644 (file)
 
 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);
index 6425816a8b2e8e6fdada4597d3072b6e26716275..d1b0799bfdaa1961fcae986542723fef18ba2053 100644 (file)
@@ -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;
index 085c791fdad4d124fdda4c75592163439ca3627b..c44afb21999613181b5668e6279fb828dc6150b3 100644 (file)
@@ -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();
     }