Port FeedListDelegate to BasicListItem

This commit is contained in:
Tobias Fella 2020-07-29 23:41:11 +02:00
parent c8dea42485
commit 6c02f118e6
2 changed files with 12 additions and 15 deletions

View File

@ -116,6 +116,7 @@ void Entry::setRead(bool read)
query.bindValue(QStringLiteral(":feed"), m_feed->url());
query.bindValue(QStringLiteral(":read"), m_read);
Database::instance().execute(query);
Q_EMIT m_feed->unreadEntryCountChanged();
}
QString Entry::adjustedContent(int width, int fontSize)

View File

@ -27,18 +27,18 @@ import org.kde.kirigami 2.12 as Kirigami
import org.kde.alligator 1.0
Kirigami.SwipeListItem {
height: Kirigami.Units.gridUnit*2
Item {
FeedImage {
id: image
feed: model.feed
}
Controls.Label {
text: model.feed.name
height: parent.height
anchors.left: image.right
leftPadding: 0.5*Kirigami.Units.gridUnit
contentItem: Kirigami.BasicListItem {
anchors.top: parent.top
anchors.bottom: parent.bottom
text: model.feed.name
icon: model.feed.refreshing ? "view-refresh" : model.feed.image === "" ? "rss" : model.feed.image
subtitle: i18np("%1 unread entry", "%1 unread entries", model.feed.unreadEntryCount)
onClicked: {
lastFeed = model.feed.url
pageStack.push("qrc:/EntryListPage.qml", {"feed": model.feed})
}
}
@ -54,8 +54,4 @@ Kirigami.SwipeListItem {
]
onClicked: {
lastFeed = model.feed.url
pageStack.push("qrc:/EntryListPage.qml", {"feed": model.feed})
}
}