This commit is contained in:
Martin Rotter 2013-12-14 13:45:24 +01:00
parent 68b85b5549
commit a3803ee6bc
3 changed files with 15 additions and 4 deletions

View File

@ -65,11 +65,18 @@ CREATE TABLE IF NOT EXISTS Messages (
FOREIGN KEY (feed) REFERENCES Feeds (id)
);
-- !
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('qqq', '1994-11-05T08:15:30-05:00', 0, 'UTF-8', 'http://www.seznam2.cz', 1);
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('vwvw', '1994-11-05T08:15:30-05:00', 1, 'UTF-8', 'http://www.seznam3.cz', 1);
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('qqq', '1994-11-05T08:15:30-05:00', 0, 'UTF-8', 'http://www.seznam2.cz', 1);
-- !
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('vwvw', '1994-11-05T08:15:30-05:00', 1, 'UTF-8', 'http://www.seznam3.cz', 1);
-- !
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('cbcd', '1994-11-05T08:15:30-05:00', -1, 'UTF-8', 'http://www.seznam1.cz', 1);
-- !
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('attt', '1994-11-05T08:15:30-05:00', 1, 'UTF-8', 'http://www.seznam4.cz', 0);
-- !
INSERT INTO Feeds (title, date_created, category, encoding, url, type) VALUES ('ahht', '1994-11-05T08:15:30-05:00', -1, 'UTF-8', 'http://www.seznam6.cz', 0);
-- !
INSERT INTO Categories (id, parent_id, title, date_created, type) VALUES (1, 0, 'bbb', '1994-11-05T08:15:30-05:00', 0);
-- !
INSERT INTO Categories (id, parent_id, title, date_created, type) VALUES (0, -1, 'aaa', '1994-11-05T08:15:30-05:00', 0);
-- !
INSERT INTO Categories (id, parent_id, title, date_created, type) VALUES (2, 0, 'ccc', '1994-11-05T08:15:30-05:00', 0);

View File

@ -88,7 +88,7 @@ QSqlDatabase DatabaseFactory::initialize(const QString &connection_name) {
if (!file_init.open(QIODevice::ReadOnly | QIODevice::Text)) {
// Database initialization file not opened. HUGE problem.
qFatal("Databaza initialization file '%s' was not found. Database is uninitialized.",
qFatal("Database initialization file '%s' was not found. Database is uninitialized.",
APP_DB_INIT_FILE);
}

View File

@ -263,10 +263,14 @@ void FeedsModel::assembleFeeds(FeedAssignment feeds) {
// This is top-level feed, add it to the root item.
m_rootItem->appendChild(feed.second);
}
else {
else if (categories.contains(feed.first)) {
// This feed belongs to some category.
categories.value(feed.first)->appendChild(feed.second);
}
else {
qWarning("Feed '%s' is loose, skipping it.",
qPrintable(feed.second->title()));
}
}
}