Added some comments.

This commit is contained in:
Martin Rotter 2017-09-23 22:15:56 +02:00
parent 3b4a4d5ed1
commit 74e3df421e
4 changed files with 6 additions and 4 deletions

View File

@ -56,7 +56,7 @@ DROP TABLE IF EXISTS Categories;
-- ! -- !
CREATE TABLE IF NOT EXISTS Categories ( CREATE TABLE IF NOT EXISTS Categories (
id INTEGER AUTO_INCREMENT PRIMARY KEY, id INTEGER AUTO_INCREMENT PRIMARY KEY,
parent_id INTEGER NOT NULL, parent_id TEXT NOT NULL,
title VARCHAR(100) NOT NULL CHECK (title != ''), title VARCHAR(100) NOT NULL CHECK (title != ''),
description TEXT, description TEXT,
date_created BIGINT, date_created BIGINT,

View File

@ -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(":parent_id"), child->parent()->id());
query_category.bindValue(QSL(":title"), child->title()); query_category.bindValue(QSL(":title"), child->title());
query_category.bindValue(QSL(":account_id"), account_id); 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()) { if (query_category.exec()) {
child->setId(query_category.lastInsertId().toInt()); 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(":title"), feed->title());
query_feed.bindValue(QSL(":icon"), qApp->icons()->toByteArray(feed->icon())); 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(":protected"), 0);
query_feed.bindValue(QSL(":update_type"), (int) feed->autoUpdateType()); query_feed.bindValue(QSL(":update_type"), (int) feed->autoUpdateType());
query_feed.bindValue(QSL(":update_interval"), feed->autoUpdateInitialInterval()); query_feed.bindValue(QSL(":update_interval"), feed->autoUpdateInitialInterval());

View File

@ -480,6 +480,8 @@ RootItem* OwnCloudGetFeedsCategoriesResponse::feedsCategories(bool obtain_icons)
RootItem* parent = new RootItem(); RootItem* parent = new RootItem();
QMap<QString, RootItem*> cats; QMap<QString, RootItem*> cats;
// Top-level feed have "folderId" set to "0".
cats.insert(QSL("0"), parent); cats.insert(QSL("0"), parent);
// Process categories first, then process feeds. // Process categories first, then process feeds.

View File

@ -46,7 +46,7 @@ StandardServiceRoot::StandardServiceRoot(RootItem* parent)
: ServiceRoot(parent), : ServiceRoot(parent),
m_actionExportFeeds(nullptr), m_actionImportFeeds(nullptr), m_serviceMenu(QList<QAction*>()), m_actionExportFeeds(nullptr), m_actionImportFeeds(nullptr), m_serviceMenu(QList<QAction*>()),
m_feedContextMenu(QList<QAction*>()), m_actionFeedFetchMetadata(nullptr) { m_feedContextMenu(QList<QAction*>()), 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()); setIcon(StandardServiceEntryPoint().icon());
setDescription(tr("This is obligatory service account for standard RSS/RDF/ATOM feeds.")); setDescription(tr("This is obligatory service account for standard RSS/RDF/ATOM feeds."));
} }