From 05f2e28984e75b531c95c63c4e5b81661e1e8011 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 8 Nov 2014 21:49:38 +0100 Subject: [PATCH] grrrrr --- src/gui/feedstoolbar.cpp | 6 ++--- src/gui/feedsview.cpp | 6 ++--- src/miscellaneous/settings.h | 48 ++++++++++++++++++++++-------------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/gui/feedstoolbar.cpp b/src/gui/feedstoolbar.cpp index 1190a9590..aa9f7a7e4 100755 --- a/src/gui/feedstoolbar.cpp +++ b/src/gui/feedstoolbar.cpp @@ -53,10 +53,8 @@ void FeedsToolBar::saveChangeableActions(const QStringList &actions) { } void FeedsToolBar::loadChangeableActions() { - QStringList action_names = qApp->settings()->value(GROUP(GUI), - "feeds_toolbar", - "m_actionUpdateAllFeeds,m_actionMarkAllFeedsRead").toString().split(',', - QString::SkipEmptyParts); + QStringList action_names = qApp->settings()->value(GROUP(GUI), SETTING(GUI::FeedsToolbarActions)).toString().split(',', + QString::SkipEmptyParts); loadChangeableActions(action_names); } diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index c9ff471e3..87efcd56a 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -77,9 +77,9 @@ void FeedsView::quit() { void FeedsView::updateAutoUpdateStatus() { // Restore global intervals. // NOTE: Specific per-feed interval are left intact. - m_globalAutoUpdateInitialInterval = qApp->settings()->value(GROUP(Feeds), "auto_update_interval", DEFAULT_AUTO_UPDATE_INTERVAL).toInt(); + m_globalAutoUpdateInitialInterval = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateInterval)).toInt(); m_globalAutoUpdateRemainingInterval = m_globalAutoUpdateInitialInterval; - m_globalAutoUpdateEnabled = qApp->settings()->value(GROUP(Feeds), "auto_update_enabled", false).toBool(); + m_globalAutoUpdateEnabled = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::AutoUpdateEnabled)).toBool(); // Start global auto-update timer if it is not running yet. // NOTE: The timer must run even if global auto-update @@ -170,7 +170,7 @@ void FeedsView::updateAllFeeds() { } void FeedsView::updateAllFeedsOnStartup() { - if (qApp->settings()->value(GROUP(Feeds), "feeds_update_on_startup", false).toBool()) { + if (qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::FeedsUpdateOnStartup)).toBool()) { qDebug("Requesting update for all feeds on application startup."); QTimer::singleShot(STARTUP_UPDATE_DELAY, this, SLOT(updateAllFeeds())); } diff --git a/src/miscellaneous/settings.h b/src/miscellaneous/settings.h index 9896940d6..3dc5c2413 100755 --- a/src/miscellaneous/settings.h +++ b/src/miscellaneous/settings.h @@ -31,18 +31,27 @@ // Feeds. namespace Feeds { - KEY ID = "feeds"; + KEY ID = "feeds"; - KEY UpdateTimeout = "feed_update_timeout"; - VALUE(int) UpdateTimeoutDef = DOWNLOAD_TIMEOUT; + KEY UpdateTimeout = "feed_update_timeout"; + VALUE(int) UpdateTimeoutDef = DOWNLOAD_TIMEOUT; - KEY CountFormat = "count_format"; - VALUE(char*) CountFormatDef = "(%unread)"; + KEY CountFormat = "count_format"; + VALUE(char*) CountFormatDef = "(%unread)"; + + KEY AutoUpdateInterval = "auto_update_interval"; + VALUE(int) AutoUpdateIntervalDef = DEFAULT_AUTO_UPDATE_INTERVAL; + + KEY AutoUpdateEnabled = "auto_update_enabled"; + VALUE(bool) AutoUpdateEnabledDef = false; + + KEY FeedsUpdateOnStartup = "feeds_update_on_startup"; + VALUE(bool) FeedsUpdateOnStartupDef = false; } // Messages. namespace Messages { - KEY ID = "messages"; + KEY ID = "messages"; KEY UseCustomDate = "use_custom_date"; VALUE(bool) UseCustomDateDef = false; @@ -56,46 +65,49 @@ namespace Messages { // GUI. namespace GUI { - KEY ID = "gui"; + KEY ID = "gui"; - KEY SplitterFeeds = "splitter_feeds"; - VALUE(char*) SplitterFeedsDef = ""; + KEY SplitterFeeds = "splitter_feeds"; + VALUE(char*) SplitterFeedsDef = ""; - KEY SplitterMessages = "splitter_messages"; - VALUE(char*) SplitterMessagesDef = ""; + KEY SplitterMessages = "splitter_messages"; + VALUE(char*) SplitterMessagesDef = ""; - KEY ToolbarStyle = "toolbar_style"; + KEY ToolbarStyle = "toolbar_style"; VALUE(Qt::ToolButtonStyle) ToolbarStyleDef = Qt::ToolButtonIconOnly; + + KEY FeedsToolbarActions = "feeds_toolbar"; + VALUE(char*) FeedsToolbarActionsDef = "m_actionUpdateAllFeeds,m_actionMarkAllFeedsRead"; } // General. namespace General { - KEY ID = "main"; + KEY ID = "main"; } // Proxy. namespace Proxy { - KEY ID = "proxy"; + KEY ID = "proxy"; } // Database. namespace Database { - KEY ID = "database"; + KEY ID = "database"; } // Keyboard. namespace Keyboard { - KEY ID = "keyboard"; + KEY ID = "keyboard"; } // Web browser. namespace Browser { - KEY ID = "browser"; + KEY ID = "browser"; } // Categories. namespace Categories { - KEY ID = "categories_expand_states"; + KEY ID = "categories_expand_states"; }