tools/assistant/lib/qhelpenginecore.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
child 30 5dc02b23752f
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the Qt Assistant of the Qt Toolkit.
     7 ** This file is part of the Qt Assistant of the Qt Toolkit.
     8 **
     8 **
   166     filter is defined by a name and set of filter attributes and can be
   166     filter is defined by a name and set of filter attributes and can be
   167     added to the help engine by calling addCustomFilter(). Analogous,
   167     added to the help engine by calling addCustomFilter(). Analogous,
   168     it is removed by calling removeCustomFilter(). customFilters() returns
   168     it is removed by calling removeCustomFilter(). customFilters() returns
   169     all defined filters.
   169     all defined filters.
   170 
   170 
   171     The help engine also offers the possiblity to set and read values
   171     The help engine also offers the possibility to set and read values
   172     in a persistant way comparable to ini files or Windows registry
   172     in a persistant way comparable to ini files or Windows registry
   173     entries. For more information see setValue() or value().
   173     entries. For more information see setValue() or value().
   174 
   174 
   175     This class does not offer any GUI components or functionality for
   175     This class does not offer any GUI components or functionality for
   176     indices or contents. If you need one of those use QHelpEngine
   176     indices or contents. If you need one of those use QHelpEngine
   360 QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
   360 QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
   361 {
   361 {
   362     if (d->setup()) {
   362     if (d->setup()) {
   363         const QHelpCollectionHandler::DocInfoList docList =
   363         const QHelpCollectionHandler::DocInfoList docList =
   364             d->collectionHandler->registeredDocumentations();
   364             d->collectionHandler->registeredDocumentations();
   365         foreach(const QHelpCollectionHandler::DocInfo info, docList) {
   365         foreach(const QHelpCollectionHandler::DocInfo &info, docList) {
   366             if (info.namespaceName == namespaceName) {
   366             if (info.namespaceName == namespaceName) {
   367                 if (QDir::isAbsolutePath(info.fileName))
   367                 if (QDir::isAbsolutePath(info.fileName))
   368                     return QDir::cleanPath(info.fileName);
   368                     return QDir::cleanPath(info.fileName);
   369 
   369 
   370                 QFileInfo fi(d->collectionHandler->collectionFile());
   370                 QFileInfo fi(d->collectionHandler->collectionFile());
   384 {
   384 {
   385     QStringList list;
   385     QStringList list;
   386     if (!d->setup())
   386     if (!d->setup())
   387         return list;
   387         return list;
   388     const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations();
   388     const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations();
   389     foreach(const QHelpCollectionHandler::DocInfo info, docList) {
   389     foreach(const QHelpCollectionHandler::DocInfo &info, docList) {
   390         list.append(info.namespaceName);
   390         list.append(info.namespaceName);
   391     }
   391     }
   392     return list;
   392     return list;
   393 }
   393 }
   394 
   394 
   529     QUrl url;
   529     QUrl url;
   530     url.setScheme(QLatin1String("qthelp"));
   530     url.setScheme(QLatin1String("qthelp"));
   531     url.setAuthority(namespaceName);
   531     url.setAuthority(namespaceName);
   532 
   532 
   533     const QStringList files = reader->files(filterAttributes, extensionFilter);
   533     const QStringList files = reader->files(filterAttributes, extensionFilter);
   534     foreach (const QString file, files) {
   534     foreach (const QString &file, files) {
   535         url.setPath(QLatin1String("/") + file);
   535         url.setPath(QLatin1String("/") + file);
   536         res.append(url);
   536         res.append(url);
   537     }
   537     }
   538     return res;
   538     return res;
   539 }
   539 }