src: removed query syntax

This change removes the query syntax from the QtSmartSearchbox and all its classes. Now it only autocompletes to one
single Token, but the UI functionality for composing a query of multiple elements is still left for later use. The struct
SearchMatch is now used in the whole pipeline for passing search results back and forth.
This commit is contained in:
Eberhard Graether
2015-09-02 11:52:07 +02:00
parent 9bcf7d2f0f
commit 1b445d4c3a
38 changed files with 247 additions and 1696 deletions
+5 -18
View File
@@ -1,8 +1,6 @@
#ifndef MESSAGE_SEARCH_H
#define MESSAGE_SEARCH_H
#include <deque>
#include "utility/messaging/Message.h"
#include "utility/utilityString.h"
@@ -12,12 +10,7 @@ class MessageSearch
: public Message<MessageSearch>
{
public:
MessageSearch(const std::string& query)
: m_query(query)
{
}
MessageSearch(const std::deque<SearchMatch>& matches)
MessageSearch(const std::vector<SearchMatch>& matches)
: m_matches(matches)
{
}
@@ -27,24 +20,18 @@ public:
return "MessageSearch";
}
std::string getQuery() const
std::string getMatchesAsString() const
{
if (m_query.size())
{
return m_query;
}
return utility::join(SearchMatch::searchMatchDequeToStringDeque(m_matches), "");
return SearchMatch::searchMatchesToString(m_matches);
}
const std::deque<SearchMatch>& getMatches() const
const std::vector<SearchMatch>& getMatches() const
{
return m_matches;
}
private:
const std::string m_query;
const std::deque<SearchMatch> m_matches;
const std::vector<SearchMatch> m_matches;
};
#endif // MESSAGE_SEARCH_H