mirror of https://github.com/KDE/kasts.git
remove entries when removing feed
This commit is contained in:
parent
708b958da1
commit
593d221c9c
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue