From c7f96f5301c2e60d1c5ef1e945e70e921afc71ce Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 29 May 2019 12:39:04 +0200 Subject: Close the last SELECT query with pending results Ensure we close the last SELECT query in case we read just one result. If we don't iterate over all results available, the query may block the database connection. The other database connection won't be able to interact with database until the open query is closed. Fixes: QDS-779 Change-Id: I30cece520918a10972deaa3d093ffaea11cab5c0 Reviewed-by: Thomas Hartmann --- src/assistant/help/qhelpcollectionhandler.cpp | 20 ++++++++++++++++---- 1 file 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; -- cgit v1.2.1 From 0d2a9408ed2a5c664330c5742c9afb610a6c7348 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 6 Jun 2019 16:05:05 +0200 Subject: lupdate: Improve documentation of -recursive, -no-recursive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'the following' directories can be read in the sense that the arguments are positional, and that e.g. lupdate -no-recursive x -recursive y will scan x without subdirectories, but y with subdirectories. However this is not the case; -recursive and -non-recursive are binary options that affect all directories scanned in a run. Task-number: QTBUG-76243 Change-Id: I417a84708b7228890d0644aed582dbb9073de1a8 Reviewed-by: Lucie Gerard Reviewed-by: Jörg Bornemann --- src/linguist/lupdate/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index c6b026dc7..16fe85f2a 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -239,9 +239,9 @@ static void printUsage() " -no-sort\n" " Do not sort contexts in TS files.\n" " -no-recursive\n" - " Do not recursively scan the following directories.\n" + " Do not recursively scan directories.\n" " -recursive\n" - " Recursively scan the following directories (default).\n" + " Recursively scan directories (default).\n" " -I or -I\n" " Additional location to look for include files.\n" " May be specified multiple times.\n" -- cgit v1.2.1