diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-01-19 02:26:13 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-01-19 02:26:13 +0100 |
commit | 76d30285358bedd8b2fc6caf48d2a871f7546685 (patch) | |
tree | 28ee333ad33eeeb4f6edd9f647702fc2522db122 /src/history.cpp | |
parent | m_tabWidget --> m_view (diff) | |
download | rekonq-76d30285358bedd8b2fc6caf48d2a871f7546685.tar.xz |
Ported tons of code to KConfigXT. To merge kcfg branch we need just to
port cookie settings..
Diffstat (limited to 'src/history.cpp')
-rw-r--r-- | src/history.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/history.cpp b/src/history.cpp index dedabfdd..652ee962 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -22,12 +22,14 @@ #include "history.h" #include "history.moc" +// Auto Includes +#include "rekonq.h" + // Local Includes #include "autosaver.h" #include "browserapplication.h" // KDE Includes -#include <KConfig> #include <KDebug> // Qt Includes @@ -219,10 +221,19 @@ void HistoryManager::clear() void HistoryManager::loadSettings() { - // load settings - KConfig config("rekonqrc"); - KConfigGroup group = config.group("history"); - m_historyLimit = group.readEntry( QString("historyLimit"), 30 ); + int historyExpire = ReKonfig::expireHistory(); + int days; + switch (historyExpire) + { + case 0: days = 1; break; + case 1: days = 7; break; + case 2: days = 14; break; + case 3: days = 30; break; + case 4: days = 365; break; + case 5: days = -1; break; + default: days = -1; + } + m_historyLimit = days; } @@ -297,9 +308,9 @@ void HistoryManager::load() void HistoryManager::save() { - KConfig config("rekonqrc"); - KConfigGroup group = config.group("history"); - group.writeEntry( QString("historyLimit"), m_historyLimit ); +// KConfig config("rekonqrc"); +// KConfigGroup group = config.group("history"); +// group.writeEntry( QString("historyLimit"), m_historyLimit ); bool saveAll = m_lastSavedUrl.isEmpty(); int first = m_history.count() - 1; @@ -369,7 +380,7 @@ void HistoryManager::save() } -// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +// -------------------------------------------------------------------------------------------------------------------------- HistoryModel::HistoryModel(HistoryManager *history, QObject *parent) |