]> cloud.milkyroute.net Git - dolphin.git/commitdiff
allow to configure whether file thumbnails should be embedded for the file preview...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 13 Oct 2007 22:31:05 +0000 (22:31 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 13 Oct 2007 22:31:05 +0000 (22:31 +0000)
BUG: 150028

svn path=/trunk/KDE/kdebase/apps/; revision=724946

src/generalviewsettingspage.cpp
src/generalviewsettingspage.h

index 1bb4e81fcfad733fbf0fe4169c1515804cfd1024..15a985cf3015f1762c4e5f39f3b1bfdc17eb0904 100644 (file)
@@ -25,8 +25,9 @@
 
 #include "dolphin_generalsettings.h"
 
-#include <QLabel>
+#include <QCheckBox>
 #include <QGroupBox>
+#include <QLabel>
 #include <QRadioButton>
 #include <QSlider>
 #include <QSpinBox>
@@ -45,7 +46,8 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
     m_localProps(0),
     m_globalProps(0),
     m_maxPreviewSize(0),
-    m_spinBox(0)
+    m_spinBox(0),
+    m_useFileThumbnails(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -79,9 +81,12 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
     connect(m_spinBox, SIGNAL(valueChanged(int)),
             m_maxPreviewSize, SLOT(setValue(int)));
 
+    m_useFileThumbnails = new QCheckBox(i18n("Use thumbnails embedded in files"), previewBox);
+
     QVBoxLayout* previewBoxLayout = new QVBoxLayout(previewBox);
     previewBoxLayout->addWidget(maxFileSize);
     previewBoxLayout->addWidget(vBox);
+    previewBoxLayout->addWidget(m_useFileThumbnails);
 
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
@@ -120,6 +125,9 @@ void GeneralViewSettingsPage::applySettings()
     globalConfig.writeEntry("MaximumSize",
                             byteCount,
                             KConfigBase::Normal | KConfigBase::Global);
+    globalConfig.writeEntry("UseFileThumbnails",
+                            m_useFileThumbnails->isChecked(),
+                            KConfigBase::Normal | KConfigBase::Global);
     globalConfig.sync();
 }
 
@@ -161,6 +169,9 @@ void GeneralViewSettingsPage::loadSettings()
 
     m_maxPreviewSize->setValue(maxMByteSize);
     m_spinBox->setValue(m_maxPreviewSize->value());
+
+    const bool useFileThumbnails = globalConfig.readEntry("UseFileThumbnails", true);
+    m_useFileThumbnails->setChecked(useFileThumbnails);
 }
 
 #include "generalviewsettingspage.moc"
index 9c5edecf3a8c2e1a7e87cdcce03067a2bfd7510a..5aad4be4fc1146b5ecd8a091f1d03a14bbd40a8b 100644 (file)
@@ -23,6 +23,7 @@
 #include <kvbox.h>
 
 class DolphinMainWindow;
+class QCheckBox;
 class QRadioButton;
 class QSlider;
 class QSpinBox;
@@ -58,6 +59,7 @@ private:
     QRadioButton* m_globalProps;
     QSlider* m_maxPreviewSize;
     QSpinBox* m_spinBox;
+    QCheckBox* m_useFileThumbnails;
 };
 
 #endif