Line data Source code
1 : #include "SearchFeedItem.h"
2 :
3 12 : SearchFeedItem::SearchFeedItem(ListModel *feedList) :
4 : LisvelFeedItem(FEED_ID_SEARCH, -3, "Search Results", feedList),
5 12 : searchScope(Scope::Global),
6 12 : scopeId(-1)
7 : {
8 12 : }
9 :
10 3 : void SearchFeedItem::setScope(Scope scope, qint64 id)
11 : {
12 3 : searchScope = scope;
13 3 : scopeId = id;
14 3 : }
15 :
16 13 : void SearchFeedItem::setSearchQuery(const QString& query)
17 : {
18 13 : searchQuery = query.trimmed();
19 :
20 : // Clear any existing results when starting a new search.
21 13 : clearNews();
22 :
23 13 : setTitle("Search Results");
24 13 : }
25 :
26 2 : bool SearchFeedItem::canBookmark(qint64 bookmarkID, bool allowBackward)
27 : {
28 : Q_UNUSED(bookmarkID);
29 : Q_UNUSED(allowBackward);
30 :
31 : // Search results are relevance-ordered, not chronological.
32 : // Bookmarking doesn't make sense in this context.
33 2 : return false;
34 : }
35 :
36 1 : bool SearchFeedItem::bookmarksEnabled() const
37 : {
38 1 : return false;
39 : }
|