summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2009-11-19 15:24:09 (GMT)
committerkh1 <qt-info@nokia.com>2009-11-19 15:33:45 (GMT)
commitf3a6686f0784b77b623576248928e7640c5df5f1 (patch)
treede28ad6c366d751da9905def09bf90373f4f8138
parenta9c0b9e00f8fee70eef51f14892826c1e7d4a93f (diff)
downloadQt-f3a6686f0784b77b623576248928e7640c5df5f1.zip
Qt-f3a6686f0784b77b623576248928e7640c5df5f1.tar.gz
Qt-f3a6686f0784b77b623576248928e7640c5df5f1.tar.bz2
Properly return the absolute file path for help files.
This fixes a bug that can only be seen on windows when we have the collection storage location on e.g. Drive c:\ while the help files reside on a different drive. QHelpEngineCore::registerDocumentation would fail to gather the proper relative file path, thus register the file with it's absolute path. In QHelpEngineCore::documentationFileName we still assumed that all files in the collection are registered relative and fail to concatenate the proper path. Now we check if the path is already absolute and return. Reviewed-by: ck
-rw-r--r--tools/assistant/lib/qhelpenginecore.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/assistant/lib/qhelpenginecore.cpp b/tools/assistant/lib/qhelpenginecore.cpp
index 140e99a..4ea2f42 100644
--- a/tools/assistant/lib/qhelpenginecore.cpp
+++ b/tools/assistant/lib/qhelpenginecore.cpp
@@ -359,19 +359,21 @@ bool QHelpEngineCore::unregisterDocumentation(const QString &namespaceName)
*/
QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
{
- QString res;
- if (!d->setup())
- return res;
- const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations();
- foreach(const QHelpCollectionHandler::DocInfo info, docList) {
- if (info.namespaceName == namespaceName) {
- QFileInfo fi(d->collectionHandler->collectionFile());
- fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName);
- res = QDir::cleanPath(fi.absoluteFilePath());
- break;
+ if (d->setup()) {
+ const QHelpCollectionHandler::DocInfoList docList =
+ d->collectionHandler->registeredDocumentations();
+ foreach(const QHelpCollectionHandler::DocInfo info, docList) {
+ if (info.namespaceName == namespaceName) {
+ if (QDir::isAbsolutePath(info.fileName))
+ return QDir::cleanPath(info.fileName);
+
+ QFileInfo fi(d->collectionHandler->collectionFile());
+ fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName);
+ return QDir::cleanPath(fi.absoluteFilePath());
+ }
}
}
- return res;
+ return QString();
}
/*!