diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 508f010ce..d6a326345 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -325,6 +325,10 @@ void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::AdditionalI if (action != 0) { KToggleAction* toggleAction = static_cast(action); toggleAction->setChecked(true); + + QActionGroup* group = toggleAction->actionGroup(); + Q_ASSERT(group != 0); + group->setEnabled(m_activeView->mode() == DolphinView::IconsView); } } diff --git a/src/dolphinview.h b/src/dolphinview.h index 8a7637656..218411208 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -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(); diff --git a/src/viewpropertiesdialog.cpp b/src/viewpropertiesdialog.cpp index 76a45061e..4c87397e8 100644 --- a/src/viewpropertiesdialog.cpp +++ b/src/viewpropertiesdialog.cpp @@ -26,8 +26,6 @@ #include "dolphin_generalsettings.h" #include "viewproperties.h" -#include - #include #include #include @@ -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(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());