From 74e3df421ea9d1ecc52a83c76756395e05f54b18 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 23 Sep 2017 22:15:56 +0200 Subject: [PATCH] Added some comments. --- resources/sql/db_init_mysql.sql | 2 +- src/miscellaneous/databasequeries.cpp | 4 ++-- src/services/owncloud/network/owncloudnetworkfactory.cpp | 2 ++ src/services/standard/standardserviceroot.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/sql/db_init_mysql.sql b/resources/sql/db_init_mysql.sql index b8c688c4e..807f21c08 100644 --- a/resources/sql/db_init_mysql.sql +++ b/resources/sql/db_init_mysql.sql @@ -56,7 +56,7 @@ DROP TABLE IF EXISTS Categories; -- ! CREATE TABLE IF NOT EXISTS Categories ( id INTEGER AUTO_INCREMENT PRIMARY KEY, - parent_id INTEGER NOT NULL, + parent_id TEXT NOT NULL, title VARCHAR(100) NOT NULL CHECK (title != ''), description TEXT, date_created BIGINT, diff --git a/src/miscellaneous/databasequeries.cpp b/src/miscellaneous/databasequeries.cpp index 4e0d30b27..47857de76 100755 --- a/src/miscellaneous/databasequeries.cpp +++ b/src/miscellaneous/databasequeries.cpp @@ -779,7 +779,7 @@ bool DatabaseQueries::storeAccountTree(QSqlDatabase db, RootItem* tree_root, int query_category.bindValue(QSL(":parent_id"), child->parent()->id()); query_category.bindValue(QSL(":title"), child->title()); query_category.bindValue(QSL(":account_id"), account_id); - query_category.bindValue(QSL(":custom_id"), child->toCategory()->customId()); + query_category.bindValue(QSL(":custom_id"), child->customId()); if (query_category.exec()) { child->setId(query_category.lastInsertId().toInt()); @@ -793,7 +793,7 @@ bool DatabaseQueries::storeAccountTree(QSqlDatabase db, RootItem* tree_root, int query_feed.bindValue(QSL(":title"), feed->title()); query_feed.bindValue(QSL(":icon"), qApp->icons()->toByteArray(feed->icon())); - query_feed.bindValue(QSL(":category"), feed->parent()->customId()); + query_feed.bindValue(QSL(":category"), feed->parent()->id()); query_feed.bindValue(QSL(":protected"), 0); query_feed.bindValue(QSL(":update_type"), (int) feed->autoUpdateType()); query_feed.bindValue(QSL(":update_interval"), feed->autoUpdateInitialInterval()); diff --git a/src/services/owncloud/network/owncloudnetworkfactory.cpp b/src/services/owncloud/network/owncloudnetworkfactory.cpp index 229b8c7e7..2b9af2c59 100755 --- a/src/services/owncloud/network/owncloudnetworkfactory.cpp +++ b/src/services/owncloud/network/owncloudnetworkfactory.cpp @@ -480,6 +480,8 @@ RootItem* OwnCloudGetFeedsCategoriesResponse::feedsCategories(bool obtain_icons) RootItem* parent = new RootItem(); QMap cats; + + // Top-level feed have "folderId" set to "0". cats.insert(QSL("0"), parent); // Process categories first, then process feeds. diff --git a/src/services/standard/standardserviceroot.cpp b/src/services/standard/standardserviceroot.cpp index 7c3cc38c0..c54fb1346 100755 --- a/src/services/standard/standardserviceroot.cpp +++ b/src/services/standard/standardserviceroot.cpp @@ -46,7 +46,7 @@ StandardServiceRoot::StandardServiceRoot(RootItem* parent) : ServiceRoot(parent), m_actionExportFeeds(nullptr), m_actionImportFeeds(nullptr), m_serviceMenu(QList()), m_feedContextMenu(QList()), m_actionFeedFetchMetadata(nullptr) { - setTitle(qApp->system()->loggedInUser() + tr(" (%1 classic account)").arg(APP_NAME)); + setTitle(qApp->system()->loggedInUser() + QSL(" (RSS/RDF/ATOM)")); setIcon(StandardServiceEntryPoint().icon()); setDescription(tr("This is obligatory service account for standard RSS/RDF/ATOM feeds.")); }