remove entries when removing feed

This commit is contained in:
Tobias Fella 2020-04-20 02:02:31 +02:00
parent 708b958da1
commit 593d221c9c
1 changed files with 6 additions and 2 deletions

View File

@ -86,9 +86,13 @@ bool FeedListModel::feedExists(QString url) {
void FeedListModel::removeFeed(int index) void FeedListModel::removeFeed(int index)
{ {
//Workaround...
QSqlQuery query; QSqlQuery query;
query.prepare(QStringLiteral("DELETE FROM Feeds WHERE url=:url")); query.prepare(QStringLiteral("DELETE FROM Entries WHERE feed=:feed;"));
query.bindValue(QStringLiteral(":feed"), data(createIndex(index, 0), 1).toString());
Database::instance().execute(query);
//Workaround...
query.prepare(QStringLiteral("DELETE FROM Feeds WHERE url=:url;"));
query.bindValue(QStringLiteral(":url"), data(createIndex(index, 0), 1).toString()); query.bindValue(QStringLiteral(":url"), data(createIndex(index, 0), 1).toString());
Database::instance().execute(query); Database::instance().execute(query);
select(); select();