Line data Source code
1 : #include "SearchFeedItem.h"
2 :
3 1 : SearchFeedItem::SearchFeedItem(ListModel *feedList) :
4 : LisvelFeedItem(FEED_ID_SEARCH, -3, "Search Results", feedList),
5 1 : searchScope(Scope::Global),
6 1 : scopeId(-1)
7 : {
8 1 : }
9 :
10 1 : void SearchFeedItem::setScope(Scope scope, qint64 id)
11 : {
12 1 : searchScope = scope;
13 1 : scopeId = id;
14 1 : }
15 :
16 8 : void SearchFeedItem::setSearchQuery(const QString& query)
17 : {
18 8 : searchQuery = query.trimmed();
19 :
20 : // Clear any existing results when starting a new search.
21 8 : clearNews();
22 :
23 8 : setTitle("Search Results");
24 8 : }
25 :
26 0 : 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 0 : return false;
34 : }
35 :
36 0 : bool SearchFeedItem::bookmarksEnabled() const
37 : {
38 0 : return false;
39 : }
|