summaryrefslogtreecommitdiff
path: root/src/opensearch/opensearchengine.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-11-08 11:43:48 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-11-08 11:43:48 +0100
commit7916468e69e2c17e56d189efe8c74471764f85a3 (patch)
tree8cac4c6b0cff0c0bd7d405a6d24e03e627d29227 /src/opensearch/opensearchengine.cpp
parentrekonq 0.8.52 (diff)
downloadrekonq-7916468e69e2c17e56d189efe8c74471764f85a3.tar.xz
Get sure against "strange" behaviours in opensearchengine
BUG: 285277
Diffstat (limited to 'src/opensearch/opensearchengine.cpp')
-rw-r--r--src/opensearch/opensearchengine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/opensearch/opensearchengine.cpp b/src/opensearch/opensearchengine.cpp
index d5c64d68..28027828 100644
--- a/src/opensearch/opensearchengine.cpp
+++ b/src/opensearch/opensearchengine.cpp
@@ -254,11 +254,14 @@ bool OpenSearchEngine::operator<(const OpenSearchEngine &other) const
ResponseList OpenSearchEngine::parseSuggestion(const QString &searchTerm, const QByteArray &resp)
{
- QFile file(suggestionPathFor(searchTerm));
- if (file.open(QIODevice::WriteOnly | QIODevice::Text))
+ if (!searchTerm.isEmpty() && !resp.isEmpty())
{
- file.write(resp, resp.size());
- file.close();
+ QFile file(suggestionPathFor(searchTerm));
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text))
+ {
+ file.write(resp, resp.size());
+ file.close();
+ }
}
return parseSuggestion(resp);