diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2012-08-01 14:20:32 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-02 17:37:56 +0200 |
commit | 227a60a427f83931ca8bdaec7509a673738f053b (patch) | |
tree | 361a34049f4b15efc8782966e6bb80a7382308cd /src/assistant/help | |
parent | 677acf607409b4fe99a99516ddd6fc81e63cd82c (diff) | |
download | qttools-227a60a427f83931ca8bdaec7509a673738f053b.tar.gz |
Prepare QtHelp library for modularized documentation.
- Support ".." in QCH documentation file paths.
This essentially means that we stop using cleanPath, and where needed,
prepend the virtual folder name, followed by "/..", in front of the
original path.
- Remove com.trolltech default DocPath since this was not used anymore.
Done-with: Casper van Donderen <casper.vandonderen@nokia.com>
Change-Id: I7309805000f343e2f58c74cd0655a936399fd939
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'src/assistant/help')
-rw-r--r-- | src/assistant/help/qhelpcontentwidget.cpp | 3 | ||||
-rw-r--r-- | src/assistant/help/qhelpengine.h | 2 | ||||
-rw-r--r-- | src/assistant/help/qhelpengine_p.h | 2 | ||||
-rw-r--r-- | src/assistant/help/qhelpenginecore.cpp | 10 |
4 files changed, 11 insertions, 6 deletions
diff --git a/src/assistant/help/qhelpcontentwidget.cpp b/src/assistant/help/qhelpcontentwidget.cpp index 75f9f7e7e..37c9bf0c1 100644 --- a/src/assistant/help/qhelpcontentwidget.cpp +++ b/src/assistant/help/qhelpcontentwidget.cpp @@ -44,7 +44,6 @@ #include "qhelpengine_p.h" #include "qhelpdbreader_p.h" -#include <QtCore/QDir> #include <QtCore/QStack> #include <QtCore/QThread> #include <QtCore/QMutex> @@ -559,7 +558,7 @@ bool QHelpContentWidget::searchContentItem(QHelpContentModel *model, if (!parentItem) return false; - if (QDir::cleanPath(parentItem->url().path()) == path) { + if (parentItem->url().path() == path) { m_syncIndex = parent; return true; } diff --git a/src/assistant/help/qhelpengine.h b/src/assistant/help/qhelpengine.h index 3bff849d1..72a8d3938 100644 --- a/src/assistant/help/qhelpengine.h +++ b/src/assistant/help/qhelpengine.h @@ -74,6 +74,8 @@ public: private: QHelpEnginePrivate *d; + + friend class HelpEngineWrapper; }; QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpengine_p.h b/src/assistant/help/qhelpengine_p.h index c8d9d06d1..48412a07d 100644 --- a/src/assistant/help/qhelpengine_p.h +++ b/src/assistant/help/qhelpengine_p.h @@ -53,6 +53,7 @@ // We mean it. // +#include <QtCore/QHash> #include <QtCore/QMap> #include <QtCore/QStringList> #include <QtCore/QObject> @@ -88,6 +89,7 @@ public: QMap<QString, QHelpDBReader*> fileNameReaderMap; QMultiMap<QString, QHelpDBReader*> virtualFolderMap; QStringList orderedFileNameList; + QHash<QString, QString> nameSpaceVirtualFolderMap; QHelpCollectionHandler *collectionHandler; QString currentFilter; diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp index 6876a69a7..e67f8bbb4 100644 --- a/src/assistant/help/qhelpenginecore.cpp +++ b/src/assistant/help/qhelpenginecore.cpp @@ -88,6 +88,7 @@ void QHelpEngineCorePrivate::clearMaps() fileNameReaderMap.clear(); virtualFolderMap.clear(); orderedFileNameList.clear(); + nameSpaceVirtualFolderMap.clear(); } bool QHelpEngineCorePrivate::setup() @@ -128,6 +129,7 @@ bool QHelpEngineCorePrivate::setup() fileNameReaderMap.insert(absFileName, reader); virtualFolderMap.insert(info.folderName, reader); orderedFileNameList.append(absFileName); + nameSpaceVirtualFolderMap.insert(info.namespaceName, info.folderName); } q->currentFilter(); emit q->setupFinished(); @@ -365,11 +367,11 @@ QString QHelpEngineCore::documentationFileName(const QString &namespaceName) foreach(const QHelpCollectionHandler::DocInfo &info, docList) { if (info.namespaceName == namespaceName) { if (QDir::isAbsolutePath(info.fileName)) - return QDir::cleanPath(info.fileName); + return info.fileName; QFileInfo fi(d->collectionHandler->collectionFile()); fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName); - return QDir::cleanPath(fi.absoluteFilePath()); + return fi.absoluteFilePath(); } } } @@ -553,7 +555,7 @@ QUrl QHelpEngineCore::findFile(const QUrl &url) const return res; QString ns = url.authority(); - QString filePath = QDir::cleanPath(url.path()); + QString filePath = url.path(); if (filePath.startsWith(QLatin1Char('/'))) filePath = filePath.mid(1); QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); @@ -603,7 +605,7 @@ QByteArray QHelpEngineCore::fileData(const QUrl &url) const return QByteArray(); QString ns = url.authority(); - QString filePath = QDir::cleanPath(url.path()); + QString filePath = url.path(); if (filePath.startsWith(QLatin1Char('/'))) filePath = filePath.mid(1); QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); |