diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-11-08 11:43:48 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-11-08 11:46:13 +0100 |
commit | 1a8077db55578e0e6c70d5d1e6a5a11674e60e2a (patch) | |
tree | be86a4b0e02935d2be20bf2c247e156e6807210d /src | |
parent | Fix to bug 242675 backported in Branches.0.8 (diff) | |
download | rekonq-1a8077db55578e0e6c70d5d1e6a5a11674e60e2a.tar.xz |
Get sure against "strange" behaviours in opensearchengine
BUG: 285277
Diffstat (limited to 'src')
-rw-r--r-- | src/opensearch/opensearchengine.cpp | 11 |
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); |