diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dae91ef9..d68828684 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,7 @@ set(APP_SOURCES src/gui/tabbar.cpp src/gui/tabcontent.cpp src/gui/cornerbutton.cpp + src/gui/feedmessageviewer.cpp # CORE sources. src/core/debugging.cpp @@ -236,6 +237,7 @@ set(APP_HEADERS src/gui/tabbar.h src/gui/tabcontent.h src/gui/cornerbutton.h + src/gui/feedmessageviewer.h # CORE headers. src/core/settings.h diff --git a/src/core/localization.h b/src/core/localization.h index 23c61d236..c5a7ea60b 100644 --- a/src/core/localization.h +++ b/src/core/localization.h @@ -4,26 +4,27 @@ // Loads currently active language. // NOTE: Macro is used due to QTranslator persistency. #define LoadLocalization(); \ - QString locale_name = Settings::getInstance()->value(APP_CFG_GEN, \ - "language", \ - "en").toString(); \ + QString locale_name = Settings::getInstance()->value( \ + APP_CFG_GEN, \ + "language", \ + "en").toString(); \ QTranslator qt_translator, app_translator; \ if (app_translator.load(QString("rssguard_%1.qm").arg(locale_name), \ - APP_LANG_PATH)) { \ - QApplication::installTranslator(&app_translator); \ - qDebug("Application localization %s loaded successfully.", \ - qPrintable(locale_name)); \ + APP_LANG_PATH)) { \ + QApplication::installTranslator(&app_translator); \ + qDebug("Application localization %s loaded successfully.", \ + qPrintable(locale_name)); \ } \ else { \ - qWarning("Application localization %s was not loaded.", qPrintable(locale_name)); \ + qWarning("Application localization %s was not loaded.", qPrintable(locale_name)); \ } \ if (qt_translator.load(QString("qt_%1.qm").arg(locale_name), \ - APP_LANG_PATH)) { \ - qDebug("Qt localization %s loaded successfully.", \ - qPrintable(locale_name)); \ + APP_LANG_PATH)) { \ + qDebug("Qt localization %s loaded successfully.", \ + qPrintable(locale_name)); \ } \ else { \ - qWarning("Qt localization %s was not loaded.", qPrintable(locale_name)); \ + qWarning("Qt localization %s was not loaded.", qPrintable(locale_name)); \ } \ QLocale::setDefault(QLocale(locale_name)); diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp new file mode 100644 index 000000000..07c5a5717 --- /dev/null +++ b/src/gui/feedmessageviewer.cpp @@ -0,0 +1,15 @@ +#include "gui/feedmessageviewer.h" +#include "gui/webbrowser.h" + + +FeedMessageViewer::FeedMessageViewer(QWidget *parent) : TabContent(parent) +{ +} + +FeedMessageViewer::~FeedMessageViewer() { + qDebug("Destroying FeedMessageViewer instance."); +} + +WebBrowser *FeedMessageViewer::webBrowser() { + return NULL; +} diff --git a/src/gui/feedmessageviewer.h b/src/gui/feedmessageviewer.h new file mode 100644 index 000000000..f43e6afc7 --- /dev/null +++ b/src/gui/feedmessageviewer.h @@ -0,0 +1,24 @@ +#ifndef FEEDMESSAGEVIEWER_H +#define FEEDMESSAGEVIEWER_H + +#include "gui/tabcontent.h" + + +class WebBrowser; + +class FeedMessageViewer : public TabContent { + Q_OBJECT + + public: + explicit FeedMessageViewer(QWidget *parent = 0); + virtual ~FeedMessageViewer(); + + WebBrowser *webBrowser(); + + signals: + + public slots: + +}; + +#endif // FEEDMESSAGEVIEWER_H diff --git a/src/gui/iconthemefactory.cpp b/src/gui/iconthemefactory.cpp index 495a695d6..9bce4f357 100644 --- a/src/gui/iconthemefactory.cpp +++ b/src/gui/iconthemefactory.cpp @@ -81,6 +81,12 @@ void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) { "icon_theme", "mini-kfaenza").toString(); + if (m_currentIconTheme == theme_name_from_settings) { + qDebug("Icon theme '%s' already loaded.", + qPrintable(theme_name_from_settings)); + return; + } + // Display list of installed themes. qDebug("Installed icon themes are: %s.", qPrintable(installed_themes.join(", "))); @@ -88,7 +94,7 @@ void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) { if (installed_themes.contains(theme_name_from_settings)) { // Desired icon theme is installed and can be loaded. - qDebug("Loading theme '%s'.", qPrintable(theme_name_from_settings)); + qDebug("Loading icon theme '%s'.", qPrintable(theme_name_from_settings)); QIcon::setThemeName(theme_name_from_settings); m_currentIconTheme = theme_name_from_settings; } diff --git a/src/gui/tabwidget.cpp b/src/gui/tabwidget.cpp index 0c2120ff1..3be9a1322 100644 --- a/src/gui/tabwidget.cpp +++ b/src/gui/tabwidget.cpp @@ -9,6 +9,7 @@ #include "gui/tabbar.h" #include "gui/iconthemefactory.h" #include "gui/webbrowser.h" +#include "gui/feedmessageviewer.h" #include "gui/cornerbutton.h" @@ -43,7 +44,7 @@ TabBar *TabWidget::tabBar() { void TabWidget::initializeTabs() { // Create widget for "Feeds" page and add it. - WebBrowser *browser = new WebBrowser(this); + FeedMessageViewer *browser = new FeedMessageViewer(this); int index_of_browser = addTab(static_cast(browser), QIcon(), tr("Feeds"), @@ -196,6 +197,6 @@ void TabWidget::fixContentsAfterMove(int from, int to) { void TabWidget::fixContentsIndexes(int starting_index, int ending_index) { for ( ; starting_index <= ending_index; starting_index++) { TabContent *content = static_cast(widget(starting_index)); - content->webBrowser()->setIndex(starting_index); + content->setIndex(starting_index); } }