~ubuntu-branches/debian/sid/kde-baseapps/sid

« back to all changes in this revision

Viewing changes to dolphin/src/settings/general/previewssettingspage.cpp

  • Committer: Package Import Robot
  • Author(s): Modestas Vainius, Eshat Cakar, Pino Toscano
  • Date: 2012-06-09 22:18:08 UTC
  • mfrom: (4.2.1) (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20120609221808-h1l0ekd5qmb8nefr
Tags: 4:4.8.4-1
* New upstream release.

[ Eshat Cakar ]
* Add watch file.
* Bump kde-sc-dev-latest build dependency to version 4:4.8.4.
* Update installed files.

[ Pino Toscano ]
* Move files of the konqueror documentation from kde-baseapps-data to
  konqueror itself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <KServiceTypeTrader>
31
31
#include <KService>
32
32
 
33
 
#include <settings/dolphinsettings.h>
34
33
#include <settings/serviceitemdelegate.h>
35
34
#include <settings/servicemodel.h>
36
35
 
95
94
    m_localFileSizeBox = new KIntSpinBox(this);
96
95
    m_localFileSizeBox->setSingleStep(1);
97
96
    m_localFileSizeBox->setSuffix(QLatin1String(" MB"));
98
 
    m_localFileSizeBox->setRange(0, 9999); /* MB */
 
97
    m_localFileSizeBox->setRange(0, 9999999); /* MB */
99
98
 
100
99
    QLabel* remoteFileSizeLabel = new QLabel(i18nc("@label Don't create previews for: <Remote files above:> XX MByte",
101
100
                                                   "Remote files above:"), this);
103
102
    m_remoteFileSizeBox = new KIntSpinBox(this);
104
103
    m_remoteFileSizeBox->setSingleStep(1);
105
104
    m_remoteFileSizeBox->setSuffix(QLatin1String(" MB"));
106
 
    m_remoteFileSizeBox->setRange(0, 9999); /* MB */
 
105
    m_remoteFileSizeBox->setRange(0, 9999999); /* MB */
107
106
 
108
107
    QGridLayout* fileSizeBoxLayout = new QGridLayout(fileSizeBox);
109
108
    fileSizeBoxLayout->addWidget(localFileSizeLabel, 0, 0, Qt::AlignRight);
144
143
    KConfigGroup globalConfig(KGlobal::config(), QLatin1String("PreviewSettings"));
145
144
    globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins);
146
145
 
 
146
    const qulonglong maximumLocalSize = static_cast<qulonglong>(m_localFileSizeBox->value()) * 1024 * 1024;
147
147
    globalConfig.writeEntry("MaximumSize",
148
 
                            m_localFileSizeBox->value() * 1024 * 1024,
 
148
                            maximumLocalSize,
149
149
                            KConfigBase::Normal | KConfigBase::Global);
 
150
    const qulonglong maximumRemoteSize = static_cast<qulonglong>(m_remoteFileSizeBox->value()) * 1024 * 1024;
150
151
    globalConfig.writeEntry("MaximumRemoteSize",
151
 
                            m_remoteFileSizeBox->value() * 1024 * 1024,
 
152
                            maximumRemoteSize,
152
153
                            KConfigBase::Normal | KConfigBase::Global);
153
154
    globalConfig.sync();
154
155
}
220
221
        globalConfig.sync();
221
222
    }
222
223
 
223
 
    const int maxLocalByteSize = globalConfig.readEntry("MaximumSize", MaxLocalPreviewSize * 1024 * 1024);
 
224
    const qulonglong defaultLocalPreview = static_cast<qulonglong>(MaxLocalPreviewSize) * 1024 * 1024;
 
225
    const qulonglong maxLocalByteSize = globalConfig.readEntry("MaximumSize", defaultLocalPreview);
224
226
    const int maxLocalMByteSize = maxLocalByteSize / (1024 * 1024);
225
227
    m_localFileSizeBox->setValue(maxLocalMByteSize);
226
228
 
227
 
    const int maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", MaxRemotePreviewSize * 1024 * 1024);
 
229
    const qulonglong defaultRemotePreview = static_cast<qulonglong>(MaxRemotePreviewSize) * 1024 * 1024;
 
230
    const qulonglong maxRemoteByteSize = globalConfig.readEntry("MaximumRemoteSize", defaultRemotePreview);
228
231
    const int maxRemoteMByteSize = maxRemoteByteSize / (1024 * 1024);
229
232
    m_remoteFileSizeBox->setValue(maxRemoteMByteSize);
230
233
}