~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to tools/assistant/lib/qhelpenginecore.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-08-01 11:30:30 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20080801113030-c33y1z0l21t6cj5r
Tags: upstream-4.4.1
ImportĀ upstreamĀ versionĀ 4.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
#include <QtCore/QLibrary>
52
52
#include <QtCore/QPluginLoader>
53
53
#include <QtCore/QFileInfo>
 
54
#include <QtCore/QThread>
54
55
#include <QtGui/QApplication>
55
56
#include <QtSql/QSqlQuery>
56
57
 
82
83
    readerMap.clear();
83
84
    fileNameReaderMap.clear();
84
85
    virtualFolderMap.clear();
 
86
    orderedFileNameList.clear();
85
87
}
86
88
 
87
89
bool QHelpEngineCorePrivate::setup()
119
121
        readerMap.insert(info.namespaceName, reader);
120
122
        fileNameReaderMap.insert(absFileName, reader);
121
123
        virtualFolderMap.insert(info.folderName, reader);
 
124
        orderedFileNameList.append(absFileName);
122
125
    }
123
126
    q->currentFilter();
124
127
    emit q->setupFinished();
134
137
 
135
138
/*!
136
139
    \class QHelpEngineCore
 
140
    \since 4.4
137
141
    \inmodule QtHelp
138
142
    \brief The QHelpEngineCore class provides the core functionality
139
143
    of the help system.
140
 
    
 
144
 
141
145
    Before the help engine can be used, it must be initialized by
142
146
    calling setupData(). At the beginning of the setup process the
143
147
    signal setupStarted() is emitted. From this point on until
283
287
}
284
288
 
285
289
/*!
286
 
    Returns the namespace name of a documentation set
287
 
    specified by its file name. If the file is not valid,
288
 
    an empty string is returned.
 
290
    Returns the namespace name defined for the Qt compressed help file (.qch)
 
291
    specified by its file name. If the file is not valid, an empty string is
 
292
    returned.
289
293
 
290
294
    \sa documentationFileName()
291
295
*/
292
296
QString QHelpEngineCore::namespaceName(const QString &documentationFileName)
293
297
{
294
 
    QHelpDBReader reader(documentationFileName, QLatin1String("GetNamespaceName"), 0);
 
298
    QHelpDBReader reader(documentationFileName,
 
299
        uniquifyConnectionName(QLatin1String("GetNamespaceName"), QThread::currentThread()), 0);
295
300
    if (reader.init())
296
301
        return reader.namespaceName();
297
302
    return QString();
298
303
}
299
304
 
300
305
/*!
301
 
    Registers the documentation set contained in the file
302
 
    \a documentationFileName. One documentation set, uniquely
 
306
    Registers the Qt compressed help file (.qch) contained in the file
 
307
    \a documentationFileName. One compressed help file, uniquely
303
308
    identified by its namespace can only be registered once.
304
309
    True is returned if the registration was successful, otherwise
305
310
    false.
314
319
}
315
320
 
316
321
/*!
317
 
    Unregisters the documentation set identified by its 
 
322
    Unregisters the Qt compressed help file (.qch) identified by its 
318
323
    \a namespaceName from the help collection. Returns true 
319
324
    on success, otherwise false.
320
325
 
328
333
}
329
334
 
330
335
/*!
331
 
    Returns the absolute file name of the Qt documentation file (.qch)
332
 
    identified by the \a namespaceName. If there is no documentation
 
336
    Returns the absolute file name of the Qt compressed help file (.qch)
 
337
    identified by the \a namespaceName. If there is no Qt compressed help file
333
338
    with the specified namespace registered, an empty string is returned.
334
339
 
335
340
    \sa namespaceName()
352
357
}
353
358
 
354
359
/*!
355
 
    Returns a list of all documentations registered in the collection
356
 
    file. The returned names are the namespaces of the documentation
357
 
    sets.
 
360
    Returns a list of all registered Qt compressed help files of the current collection file.
 
361
    The returned names are the namespaces of the registered Qt compressed help files (.qch).
358
362
*/
359
363
QStringList QHelpEngineCore::registeredDocumentations() const
360
364
{
463
467
}
464
468
 
465
469
/*!
466
 
    Returns a list of filter attributes for the different filter
467
 
    sections defined in the documentation set with the namespace
 
470
    Returns a list of filter attributes for the different filter sections
 
471
    defined in the Qt compressed help file with the given namespace
468
472
    \a namespaceName.
469
473
*/
470
474
QList<QStringList> QHelpEngineCore::filterAttributeSets(const QString &namespaceName) const
478
482
}
479
483
 
480
484
/*!
481
 
    Returns a list of files contained in the documentation set \a
 
485
    Returns a list of files contained in the Qt compressed help file \a
482
486
    namespaceName. The files can be filtered by \a filterAttributes as
483
487
    well as by their extension \a extensionFilter (e.g. 'html').
484
488
*/
656
660
}
657
661
 
658
662
/*!
659
 
    Returns the meta data for the documentation file \a
 
663
    Returns the meta data for the Qt compressed help file \a
660
664
    documentationFileName. If there is no data available for
661
665
    \a name, an invalid QVariant() is returned. The meta
662
 
    data is defined when creating the documention file and
 
666
    data is defined when creating the Qt compressed help file and
663
667
    cannot be modified later. Common meta data includes e.g.
664
668
    the author of the documentation.
665
669
*/