diff --git a/resources/misc/db_init.sql b/resources/misc/db_init.sql index 70ca3009f..ea6e2c81e 100644 --- a/resources/misc/db_init.sql +++ b/resources/misc/db_init.sql @@ -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); \ No newline at end of file diff --git a/src/core/databasefactory.cpp b/src/core/databasefactory.cpp index 66259ef07..6771e38a5 100644 --- a/src/core/databasefactory.cpp +++ b/src/core/databasefactory.cpp @@ -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); } diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 53f6fcc7d..46a93733d 100644 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -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())); + } } }