]> cloud.milkyroute.net Git - dolphin.git/commitdiff
disable the 'Additional information' menu for other views then the 'Icons View'
authorPeter Penz <peter.penz19@gmail.com>
Sun, 11 Mar 2007 17:51:37 +0000 (17:51 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 11 Mar 2007 17:51:37 +0000 (17:51 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=641532

src/dolphinmainwindow.cpp
src/dolphinview.h
src/viewpropertiesdialog.cpp

index 508f010ce890b2a1b65cb896ec7a4b6d2328785d..d6a3263451cae8110a3662d26eea4941f19c6c3b 100644 (file)
@@ -325,6 +325,10 @@ void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::AdditionalI
     if (action != 0) {\r
         KToggleAction* toggleAction = static_cast<KToggleAction*>(action);\r
         toggleAction->setChecked(true);\r
+\r
+        QActionGroup* group = toggleAction->actionGroup();\r
+        Q_ASSERT(group != 0);\r
+        group->setEnabled(m_activeView->mode() == DolphinView::IconsView);\r
     }\r
 }\r
 \r
index 8a7637656684e6f7099586f135ebe74f27295d28..218411208f4731960375ecb467341b82de41c81a 100644 (file)
@@ -513,7 +513,7 @@ private:
     QString selectionStatusBarText() const;
 
     /**
-     * Creates a new view representing the given view mode (DolphinView::viewMode()).
+     * Creates a new view representing the given view mode (DolphinView::mode()).
      * The current view will get deleted.
      */
     void createView();
index 76a45061e543d3526c2e791adad57456c0c17407..4c87397e869733ce08b5428502d073f71049e627 100644 (file)
@@ -26,8 +26,6 @@
 #include "dolphin_generalsettings.h"
 #include "viewproperties.h"
 
-#include <assert.h>
-
 #include <kcomponentdata.h>
 #include <klocale.h>
 #include <kiconloader.h>
@@ -60,7 +58,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_applyToSubFolders(0),
     m_useAsDefault(0)
 {
-    assert(dolphinView != 0);
+    Q_ASSERT(dolphinView != 0);
     const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
 
     setCaption(i18n("View Properties"));
@@ -111,6 +109,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_additionalInfo->addItem(i18n("Date"), KFileItemDelegate::ModificationTime);
     const int addInfoIndex = m_additionalInfo->findData(m_viewProps->additionalInfo());
     m_additionalInfo->setCurrentIndex(addInfoIndex);
+    m_additionalInfo->setEnabled(m_viewProps->viewMode() == DolphinView::IconsView);
 
     m_showPreview = new QCheckBox(i18n("Show preview"), propsBox);
     m_showPreview->setChecked(m_viewProps->showPreview());
@@ -209,9 +208,11 @@ void ViewPropertiesDialog::slotApply()
 
 void ViewPropertiesDialog::slotViewModeChanged(int index)
 {
-    assert((index >= 0) && (index <= 2));
+    Q_ASSERT((index >= 0) && (index <= 1));
     m_viewProps->setViewMode(static_cast<DolphinView::Mode>(index));
     m_isDirty = true;
+
+    m_additionalInfo->setEnabled(m_viewProps->viewMode() == DolphinView::IconsView);
 }
 
 void ViewPropertiesDialog::slotSortingChanged(int index)
@@ -312,7 +313,7 @@ void ViewPropertiesDialog::applyViewProperties()
         // file stored for the global view properties is used as fallback. To update
         // this file we temporary turn on the global view properties mode.
         GeneralSettings* settings = DolphinSettings::instance().generalSettings();
-        assert(!settings->globalViewProps());
+        Q_ASSERT(!settings->globalViewProps());
 
         settings->setGlobalViewProps(true);
         ViewProperties defaultProps(m_dolphinView->url());