summaryrefslogtreecommitdiff
path: root/src/opensearch/opensearchreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opensearch/opensearchreader.cpp')
-rw-r--r--src/opensearch/opensearchreader.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/opensearch/opensearchreader.cpp b/src/opensearch/opensearchreader.cpp
index 5b7ece2c..7da4113f 100644
--- a/src/opensearch/opensearchreader.cpp
+++ b/src/opensearch/opensearchreader.cpp
@@ -32,6 +32,7 @@
// Local Includes
#include "opensearchengine.h"
+#include "suggestionparser.h"
// Qt Includes
#include <QtCore/QIODevice>
@@ -137,16 +138,25 @@ OpenSearchEngine *OpenSearchReader::read()
}
}
- if (type == QL1S("application/x-suggestions+json"))
- {
- engine->setSuggestionsUrlTemplate(url);
- engine->setSuggestionsParameters(parameters);
- }
- else
+ if (type == QLatin1String("text/html"))
{
engine->setSearchUrlTemplate(url);
engine->setSearchParameters(parameters);
}
+ else
+ {
+ engine->setSuggestionsUrlTemplate(url);
+ engine->setSuggestionsParameters(parameters);
+
+ if (type == QL1S("application/x-suggestions+xml"))
+ {
+ engine->setSuggestionParser(new XMLParser());
+ }
+ else if (type == QL1S("application/x-suggestions+json"))
+ {
+ engine->setSuggestionParser(new JSONParser());
+ }
+ }
continue;
}