]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/generalviewsettingspage.cpp
Whenever we are trying to sort, bypass lessThanGeneralPurpose when is not allowed...
[dolphin.git] / src / generalviewsettingspage.cpp
index 48b9b653bea0769578c3f17be6d54d6d76341af8..3d0d416ff74b5bb29c816e629ebec28f1aadc096 100644 (file)
 #include "generalviewsettingspage.h"
 #include "dolphinmainwindow.h"
 #include "dolphinsettings.h"
-#include "dolphin_generalsettings.h"
+#include "dolphinviewcontainer.h"
 #include "viewproperties.h"
 
-#include <QtGui/QLabel>
-#include <QtGui/QGroupBox>
-#include <QtGui/QRadioButton>
-#include <QtGui/QSlider>
-#include <QtGui/QSpinBox>
-#include <QtGui/QBoxLayout>
+#include "dolphin_generalsettings.h"
+
+#include <QLabel>
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QSlider>
+#include <QSpinBox>
+#include <QBoxLayout>
 
 #include <kconfiggroup.h>
 #include <kdialog.h>
@@ -52,19 +54,19 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
     setSpacing(spacing);
     setMargin(margin);
 
-    QGroupBox* propsBox = new QGroupBox(i18n("View Properties"), this);
+    QGroupBox* propsBox = new QGroupBox(i18nc("@title:group", "View Properties"), this);
 
-    m_localProps = new QRadioButton(i18n("Remember view properties for each folder"), propsBox);
-    m_globalProps = new QRadioButton(i18n("Use common view properties for all folders"), propsBox);
+    m_localProps = new QRadioButton(i18nc("@option:radio", "Remember view properties for each folder"), propsBox);
+    m_globalProps = new QRadioButton(i18nc("@option:radio", "Use common view properties for all folders"), propsBox);
 
     QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox);
     propsBoxLayout->addWidget(m_localProps);
     propsBoxLayout->addWidget(m_globalProps);
 
     // create 'File Previews' box
-    QGroupBox* previewBox = new QGroupBox(i18n("File Previews"), this);
+    QGroupBox* previewBox = new QGroupBox(i18nc("@title:group", "File Previews"), this);
 
-    QLabel* maxFileSize = new QLabel(i18n("Maximum file size:"), previewBox);
+    QLabel* maxFileSize = new QLabel(i18nc("@label:slider", "Maximum file size:"), previewBox);
 
     KHBox* vBox = new KHBox(previewBox);
     vBox->setSpacing(spacing);
@@ -92,15 +94,11 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
 
 GeneralViewSettingsPage::~GeneralViewSettingsPage()
 {
-    GeneralSettings* settings = DolphinSettings::instance().generalSettings();
-    settings->setDefaults();
-
-    loadSettings();
 }
 
 void GeneralViewSettingsPage::applySettings()
 {
-    const KUrl& url = m_mainWindow->activeView()->url();
+    const KUrl& url = m_mainWindow->activeViewContainer()->url();
     ViewProperties props(url);  // read current view properties
 
     const bool useGlobalProps = m_globalProps->isChecked();
@@ -149,7 +147,7 @@ void GeneralViewSettingsPage::loadSettings()
     m_maxPreviewSize->setTickPosition(QSlider::TicksBelow);
 
     KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
-    const int maxByteSize = globalConfig.readEntry("MaximumSize", 1024 * 1024 /* 1 MB */);
+    const int maxByteSize = globalConfig.readEntry("MaximumSize", 5 * 1024 * 1024 /* 5 MB */);
     int maxMByteSize = maxByteSize / (1024 * 1024);
     if (maxMByteSize < 1) {
         maxMByteSize = 1;