summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/assistant/help/qhelpcollectionhandler.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/assistant/help/qhelpcollectionhandler.cpp b/src/assistant/help/qhelpcollectionhandler.cpp
index c67c92518..ddf5edccc 100644
--- a/src/assistant/help/qhelpcollectionhandler.cpp
+++ b/src/assistant/help/qhelpcollectionhandler.cpp
@@ -278,6 +278,7 @@ bool QHelpCollectionHandler::isTimeStampCorrect(const TimeStamp &timeStamp) cons
return false;
const QString oldFileName = m_query->value(0).toString();
+ m_query->clear();
if (oldFileName != timeStamp.fileName)
return false;
@@ -300,6 +301,7 @@ bool QHelpCollectionHandler::hasTimeStampInfo(const QString &nameSpace) const
if (!m_query->next())
return false;
+ m_query->clear();
return true;
}
@@ -797,7 +799,10 @@ bool QHelpCollectionHandler::fileExists(const QUrl &url) const
if (!m_query->exec() || !m_query->next())
return false;
- return m_query->value(0).toInt();
+ const int count = m_query->value(0).toInt();
+ m_query->clear();
+
+ return count;
}
static QString prepareFilterQuery(int attributesCount,
@@ -1328,7 +1333,10 @@ QString QHelpCollectionHandler::namespaceVersion(const QString &namespaceName) c
if (!m_query->exec() || !m_query->next())
return QString();
- return m_query->value(0).toString();
+ const QString ret = m_query->value(0).toString();
+ m_query->clear();
+
+ return ret;
}
int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QString &fileName)
@@ -1352,8 +1360,10 @@ int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QStri
m_query->bindValue(0, nspace);
m_query->bindValue(1, fi.absoluteDir().relativeFilePath(fileName));
int namespaceId = errorValue;
- if (m_query->exec())
+ if (m_query->exec()) {
namespaceId = m_query->lastInsertId().toInt();
+ m_query->clear();
+ }
if (namespaceId < 1) {
emit error(tr("Cannot register namespace \"%1\".").arg(nspace));
return errorValue;
@@ -1371,8 +1381,10 @@ int QHelpCollectionHandler::registerVirtualFolder(const QString &folderName, int
m_query->bindValue(1, folderName);
int virtualId = -1;
- if (m_query->exec())
+ if (m_query->exec()) {
virtualId = m_query->lastInsertId().toInt();
+ m_query->clear();
+ }
if (virtualId < 1) {
emit error(tr("Cannot register virtual folder '%1'.").arg(folderName));
return -1;