void QHelpContentProvider::stopCollecting()
{
- if (!isRunning())
- return;
- m_mutex.lock();
- m_abort = true;
- m_mutex.unlock();
- wait();
+ if (isRunning()) {
+ m_mutex.lock();
+ m_abort = true;
+ m_mutex.unlock();
+ wait();
+ }
+ qDeleteAll(m_rootItems);
+ m_rootItems.clear();
}
QHelpContentItem *QHelpContentProvider::rootItem()
{
QMutexLocker locker(&m_mutex);
+ if (m_rootItems.isEmpty())
+ return 0;
return m_rootItems.dequeue();
}
int QHelpContentProvider::nextChildCount() const
{
+ if (m_rootItems.isEmpty())
+ return 0;
return m_rootItems.head()->childCount();
}
connect(d->qhelpContentProvider, SIGNAL(finished()),
this, SLOT(insertContents()), Qt::QueuedConnection);
- connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateContents()));
+ connect(helpEngine->q, SIGNAL(readersAboutToBeInvalidated()), this, SLOT(invalidateContents()));
}
/*!
void QHelpEngineCorePrivate::clearMaps()
{
+ emit q->readersAboutToBeInvalidated();
QMap<QString, QHelpDBReader*>::iterator it = readerMap.begin();
while (it != readerMap.end()) {
delete it.value();
void setupFinished();
void currentFilterChanged(const QString &newFilter);
void warning(const QString &msg);
+ void readersAboutToBeInvalidated();
protected:
QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate,
d = new QHelpIndexModelPrivate(helpEngine);
connect(d->indexProvider, SIGNAL(finished()), this, SLOT(insertIndices()));
- connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateIndex()));
+ connect(helpEngine->q, SIGNAL(readersAboutToBeInvalidated()), this, SLOT(invalidateIndex()));
}
QHelpIndexModel::~QHelpIndexModel()