tools/assistant/lib/qhelpenginecore.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    64 void QHelpEngineCorePrivate::init(const QString &collectionFile,
    64 void QHelpEngineCorePrivate::init(const QString &collectionFile,
    65                                   QHelpEngineCore *helpEngineCore)
    65                                   QHelpEngineCore *helpEngineCore)
    66 {
    66 {
    67     q = helpEngineCore;
    67     q = helpEngineCore;
    68     collectionHandler = new QHelpCollectionHandler(collectionFile, helpEngineCore);
    68     collectionHandler = new QHelpCollectionHandler(collectionFile, helpEngineCore);
    69     connect(collectionHandler, SIGNAL(error(const QString&)),
    69     connect(collectionHandler, SIGNAL(error(QString)),
    70         this, SLOT(errorReceived(const QString&)));
    70         this, SLOT(errorReceived(QString)));
    71     needsSetup = true;
    71     needsSetup = true;
    72 }
    72 }
    73 
    73 
    74 QHelpEngineCorePrivate::~QHelpEngineCorePrivate()
    74 QHelpEngineCorePrivate::~QHelpEngineCorePrivate()
    75 {
    75 {
   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
   177     instead.
   177     instead.
   178 
   178 
   179     When creating a custom help viewer the viewer can be
   179     When creating a custom help viewer the viewer can be
   180 configured by writing a custom collection file which could contain various
   180     configured by writing a custom collection file which could contain various
   181 keywords to be used to configure the help engine. These keywords and values
   181     keywords to be used to configure the help engine. These keywords and values
   182 and their meaning can be found in the help information for
   182     and their meaning can be found in the help information for
   183 \l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file
   183     \l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file}
   184 }{creating a custom help collection file} for
   184     {creating a custom help collection file} for Assistant.
   185 Assistant.
       
   186 */
   185 */
   187 
   186 
   188 /*!
   187 /*!
   189     \fn void QHelpEngineCore::setupStarted()
   188     \fn void QHelpEngineCore::setupStarted()
   190 
   189 
   358 
   357 
   359     \sa namespaceName()
   358     \sa namespaceName()
   360 */
   359 */
   361 QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
   360 QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
   362 {
   361 {
   363     QString res;
   362     if (d->setup()) {
   364     if (!d->setup())
   363         const QHelpCollectionHandler::DocInfoList docList =
   365         return res;
   364             d->collectionHandler->registeredDocumentations();
   366     const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations();
   365         foreach(const QHelpCollectionHandler::DocInfo info, docList) {
   367     foreach(const QHelpCollectionHandler::DocInfo info, docList) {
   366             if (info.namespaceName == namespaceName) {
   368         if (info.namespaceName == namespaceName) {
   367                 if (QDir::isAbsolutePath(info.fileName))
   369             QFileInfo fi(d->collectionHandler->collectionFile());
   368                     return QDir::cleanPath(info.fileName);
   370             fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName);
   369 
   371             res = QDir::cleanPath(fi.absoluteFilePath());
   370                 QFileInfo fi(d->collectionHandler->collectionFile());
   372             break;
   371                 fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName);
       
   372                 return QDir::cleanPath(fi.absoluteFilePath());
       
   373             }
   373         }
   374         }
   374     }
   375     }
   375     return res;
   376     return QString();
   376 }
   377 }
   377 
   378 
   378 /*!
   379 /*!
   379     Returns a list of all registered Qt compressed help files of the current collection file.
   380     Returns a list of all registered Qt compressed help files of the current collection file.
   380     The returned names are the namespaces of the registered Qt compressed help files (.qch).
   381     The returned names are the namespaces of the registered Qt compressed help files (.qch).