From: Peter Penz Date: Sat, 13 Oct 2007 22:31:05 +0000 (+0000) Subject: allow to configure whether file thumbnails should be embedded for the file preview... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/1edf513e227dade81a51e4ab56f05d2e48f1e59b allow to configure whether file thumbnails should be embedded for the file preview (on per default) BUG: 150028 svn path=/trunk/KDE/kdebase/apps/; revision=724946 --- diff --git a/src/generalviewsettingspage.cpp b/src/generalviewsettingspage.cpp index 1bb4e81fc..15a985cf3 100644 --- a/src/generalviewsettingspage.cpp +++ b/src/generalviewsettingspage.cpp @@ -25,8 +25,9 @@ #include "dolphin_generalsettings.h" -#include +#include #include +#include #include #include #include @@ -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" diff --git a/src/generalviewsettingspage.h b/src/generalviewsettingspage.h index 9c5edecf3..5aad4be4f 100644 --- a/src/generalviewsettingspage.h +++ b/src/generalviewsettingspage.h @@ -23,6 +23,7 @@ #include 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