From 17d4122a728d809f0ac886ebbbda486eebe782e9 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 19 Dec 2013 08:54:31 +0100 Subject: [PATCH] Another work on feedsmodel. --- src/core/feedsmodel.cpp | 17 ++++++------- src/core/feedsmodel.h | 2 +- src/core/feedsmodelfeed.cpp | 7 ++---- src/core/parsingfactory.h | 3 +-- src/gui/formsettings.cpp | 21 ++++++++-------- src/gui/formsettings.ui | 48 ++++++++++++++++++++++++------------- 6 files changed, 56 insertions(+), 42 deletions(-) diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 4da8c7a15..daaedcd82 100644 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -174,25 +174,26 @@ FeedsModelRootItem *FeedsModel::itemForIndex(const QModelIndex &index) { } void FeedsModel::changeLayout(QModelIndexList list) { - // TODO: Udělat analyzu pres cachegrind - // esli je lepsi tohle, nebo zakomentovana cast - // zakomentovana cast udela to ze view se dopta na všecky - // polozky - while (!list.isEmpty()) { QModelIndex ix = list.takeLast(); + + // Underlying data are changed. emit dataChanged(index(ix.row(), 0, ix.parent()), index(ix.row(), FDS_MODEL_COUNTS_INDEX, ix.parent())); + + if (ix.parent().isValid()) { + // Make sure that data of parent are changed too. list.append(ix.parent()); } } /* + // NOTE: Take a look at docs about this. + // I have tested that this is LITTLE slower than code above, + // but it is really SIMPLER, so if code above will be buggy, then + // we can use this. emit layoutAboutToBeChanged(); - // TODO: kouknout do dokumentace na signal layoutChanged, - // protoze ten signal layoutAboutToBeChanged by se měl volat PRED - // zmenou dat v modelu emit layoutChanged(); */ } diff --git a/src/core/feedsmodel.h b/src/core/feedsmodel.h index 76f74adab..f12f117e7 100644 --- a/src/core/feedsmodel.h +++ b/src/core/feedsmodel.h @@ -50,7 +50,7 @@ class FeedsModel : public QAbstractItemModel { FeedsModelRootItem *itemForIndex(const QModelIndex &index); public slots: - // Signals that ALL data of this model need + // Signals that SOME data of this model need // to be reloaded by ALL attached views. void changeLayout(QModelIndexList list); diff --git a/src/core/feedsmodelfeed.cpp b/src/core/feedsmodelfeed.cpp index 47e35227b..162b2278e 100755 --- a/src/core/feedsmodelfeed.cpp +++ b/src/core/feedsmodelfeed.cpp @@ -53,14 +53,11 @@ QString FeedsModelFeed::typeToString(FeedsModelFeed::Type type) { return QObject::tr("RDF 1.0"); case StandardRss0X: - return QObject::tr("RSS 0.X"); - - case StandardRss1X: - return QObject::tr("RSS 1.X"); + return QObject::tr("RSS 0.90/0.91/0.92"); case StandardRss2X: default: - return QObject::tr("RSS 2.X"); + return QObject::tr("RSS 2.0/2.0.1"); } } diff --git a/src/core/parsingfactory.h b/src/core/parsingfactory.h index 2f67115d2..b24708db1 100644 --- a/src/core/parsingfactory.h +++ b/src/core/parsingfactory.h @@ -13,8 +13,7 @@ class ParsingFactory { public: // Parses inpute textual data into Message objects. // NOTE: Input is correctly encoded in Unicode. - QList parseAsRSS20(const QString &data); - + static QList parseAsRSS20(const QString &data); }; #endif // PARSINGFACTORY_H diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp index fdc28c384..570186a36 100755 --- a/src/gui/formsettings.cpp +++ b/src/gui/formsettings.cpp @@ -121,6 +121,7 @@ void FormSettings::changeBrowserProgressColor() { QColorDialog color_dialog(m_initialSettings.m_webBrowserProgress, this); color_dialog.setWindowTitle(tr("Select color for web browser progress bar")); color_dialog.setOption(QColorDialog::ShowAlphaChannel); + if (color_dialog.exec() == QDialog::Accepted) { m_initialSettings.m_webBrowserProgress = color_dialog.selectedColor(); loadWebBrowserColor(m_initialSettings.m_webBrowserProgress); @@ -178,9 +179,9 @@ bool FormSettings::doSaveCheck() { if (!m_ui->m_shortcuts->areShortcutsUnique()) { everything_ok = false; #if QT_VERSION >= 0x050000 - resulting_information.append(tr(" • some keyboard shortcuts are not unique")); + resulting_information.append(tr(" \u2022 some keyboard shortcuts are not unique")); #else - resulting_information.append(trUtf8(" • some keyboard shortcuts are not unique")); + resulting_information.append(trUtf8(" \u2022 some keyboard shortcuts are not unique")); #endif } @@ -188,9 +189,9 @@ bool FormSettings::doSaveCheck() { m_ui->m_txtExternalBrowserArguments->text().isEmpty()) { everything_ok = false; #if QT_VERSION >= 0x050000 - resulting_information.append(tr(" • external browser is not set")); + resulting_information.append(tr(" \u2022 external browser is not set")); #else - resulting_information.append(trUtf8(" • external browser is not set")); + resulting_information.append(trUtf8(" \u2022 external browser is not set")); #endif } @@ -393,9 +394,9 @@ void FormSettings::saveLanguage() { // Save prompt for restart if language has changed. if (new_lang != actual_lang) { #if QT_VERSION >= 0x050000 - m_changedDataTexts.append(tr(" • language changed")); + m_changedDataTexts.append(tr(" \u2022 language changed")); #else - m_changedDataTexts.append(trUtf8(" • language changed")); + m_changedDataTexts.append(trUtf8(" \u2022 language changed")); #endif settings->setValue(APP_CFG_GEN, "language", new_lang); } @@ -566,9 +567,9 @@ void FormSettings::saveInterface() { // Check if icon theme was changed. if (selected_icon_theme != original_icon_theme) { #if QT_VERSION >= 0x050000 - m_changedDataTexts.append(tr(" • icon theme changed")); + m_changedDataTexts.append(tr(" \u2022 icon theme changed")); #else - m_changedDataTexts.append(trUtf8(" • icon theme changed")); + m_changedDataTexts.append(trUtf8(" \u2022 icon theme changed")); #endif } @@ -579,9 +580,9 @@ void FormSettings::saveInterface() { if (SkinFactory::getInstance()->getSelectedSkinName() != active_skin.m_baseName) { SkinFactory::getInstance()->setCurrentSkinName(active_skin.m_baseName); #if QT_VERSION >= 0x050000 - m_changedDataTexts.append(tr(" • skin changed")); + m_changedDataTexts.append(tr(" \u2022 skin changed")); #else - m_changedDataTexts.append(trUtf8(" • skin changed")); + m_changedDataTexts.append(trUtf8(" \u2022 skin changed")); #endif } } diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui index 74da90fc2..b99c7d11b 100644 --- a/src/gui/formsettings.ui +++ b/src/gui/formsettings.ui @@ -863,8 +863,8 @@ reject() - 325 - 404 + 334 + 400 286 @@ -895,12 +895,12 @@ setEnabled(bool) - 261 - 37 + 508 + 102 - 261 - 37 + 419 + 128 @@ -911,12 +911,12 @@ setEnabled(bool) - 261 - 37 + 508 + 102 - 261 - 37 + 678 + 128 @@ -927,12 +927,12 @@ setEnabled(bool) - 261 - 37 + 508 + 102 - 261 - 37 + 508 + 151 @@ -947,8 +947,24 @@ 48 - 667 - 54 + 577 + 63 + + + + + m_checkBrowserProgressColor + toggled(bool) + m_btnWebBrowserColorSample + setEnabled(bool) + + + 468 + 52 + + + 664 + 52