diff --git a/src/core/databasefactory.cpp b/src/core/databasefactory.cpp index 6771e38a5..aa87c5d85 100644 --- a/src/core/databasefactory.cpp +++ b/src/core/databasefactory.cpp @@ -72,6 +72,9 @@ QSqlDatabase DatabaseFactory::initialize(const QString &connection_name) { qPrintable(database.lastError().text())); } else { + // TODO: smazat QSQLDatabase::exec() všude + // a nahradit jej funkcí QSQLquery::exec() + database.exec("PRAGMA encoding = \"UTF-8\""); database.exec("PRAGMA synchronous = OFF"); database.exec("PRAGMA journal_mode = MEMORY"); diff --git a/src/core/feedsmodelcategory.h b/src/core/feedsmodelcategory.h index f2e0116f7..9d6459112 100644 --- a/src/core/feedsmodelcategory.h +++ b/src/core/feedsmodelcategory.h @@ -23,6 +23,9 @@ class FeedsModelCategory : public FeedsModelRootItem { explicit FeedsModelCategory(FeedsModelRootItem *parent_item = NULL); virtual ~FeedsModelCategory(); + // Counts of messages. + // NOTE: Counts of messages in categories include + // counts of messages from all children. int countOfAllMessages() const; int countOfUnreadMessages() const; diff --git a/src/core/feedsmodelfeed.h b/src/core/feedsmodelfeed.h index b7d9c7417..c92bac769 100644 --- a/src/core/feedsmodelfeed.h +++ b/src/core/feedsmodelfeed.h @@ -24,6 +24,8 @@ class FeedsModelFeed : public FeedsModelRootItem { int childCount() const; // Getters/setters for count of messages. + // NOTE: For feeds, counts are stored internally + // and can be updated from the database. int countOfAllMessages() const; int countOfUnreadMessages() const; diff --git a/src/core/feedsmodelstandardcategory.h b/src/core/feedsmodelstandardcategory.h index 63d4df3aa..c3a9fbadf 100644 --- a/src/core/feedsmodelstandardcategory.h +++ b/src/core/feedsmodelstandardcategory.h @@ -18,11 +18,13 @@ class FeedsModelStandardCategory : public FeedsModelCategory { explicit FeedsModelStandardCategory(FeedsModelRootItem *parent_item = NULL); virtual ~FeedsModelStandardCategory(); + // Returns the actual data representation of standard category. QVariant data(int column, int role) const; // Performs update on all children of this category. void update(); + // Loads particular "standard category" from given sql record. static FeedsModelStandardCategory *loadFromRecord(const QSqlRecord &record); };