From 8e9b7dc23c7fde1d9970cd83b3283260b881f5e9 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 21 Oct 2009 15:33:15 +0200 Subject: Assistant: More useful error messages for help collections. --- tools/assistant/lib/qhelpcollectionhandler.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index f59b227..4aa7ab6 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -76,7 +76,8 @@ bool QHelpCollectionHandler::isDBOpened() { if (m_dbOpened) return true; - emit error(tr("The collection file is not set up yet!")); + emit error(tr("The collection file '%1' is not set up yet!"). + arg(m_collectionFile)); return false; } @@ -134,7 +135,8 @@ bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) QFileInfo fi(fileName); if (fi.exists()) { - emit error(tr("The specified collection file already exists!")); + emit error(tr("The collection file '%1' already exists!"). + arg(fileName)); return false; } @@ -281,7 +283,7 @@ bool QHelpCollectionHandler::removeCustomFilter(const QString &filterName) filterNameId = m_query.value(0).toInt(); if (filterNameId < 0) { - emit error(tr("Unknown filter!")); + emit error(tr("Unknown filter '%1'!").arg(filterName)); return false; } @@ -386,7 +388,7 @@ bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) QString ns = reader.namespaceName(); if (ns.isEmpty()) { - emit error(tr("Invalid documentation file!")); + emit error(tr("Invalid documentation file '%1'!").arg(fileName)); return false; } @@ -553,7 +555,7 @@ int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QStri if (m_query.exec()) namespaceId = m_query.lastInsertId().toInt(); if (namespaceId < 1) { - emit error(tr("Cannot register namespace!")); + emit error(tr("Cannot register namespace '%1'!").arg(nspace)); return -1; } return namespaceId; @@ -577,7 +579,7 @@ void QHelpCollectionHandler::optimizeDatabase(const QString &fileName) db.setDatabaseName(fileName); if (!db.open()) { QSqlDatabase::removeDatabase(QLatin1String("optimize")); - emit error(tr("Cannot open database to optimize!")); + emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); return; } -- cgit v0.12