diff options
author | kh1 <qt-info@nokia.com> | 2010-03-15 12:04:14 (GMT) |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2010-03-15 12:04:14 (GMT) |
commit | 2ee0c797d9bb582073b53cb1f8348abaf2acc0db (patch) | |
tree | ceb02597eeba54ff5a06ccc13335462f3030c75a /tools/assistant/lib | |
parent | ab0bd00d06356ded7c53e61421e3139571410c2c (diff) | |
download | Qt-2ee0c797d9bb582073b53cb1f8348abaf2acc0db.zip Qt-2ee0c797d9bb582073b53cb1f8348abaf2acc0db.tar.gz Qt-2ee0c797d9bb582073b53cb1f8348abaf2acc0db.tar.bz2 |
Fix broken setCollectionFile (creating multiple models instead reusing)
Reviewed-by: ck
Diffstat (limited to 'tools/assistant/lib')
-rw-r--r-- | tools/assistant/lib/qhelpcontentwidget.cpp | 3 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpengine.cpp | 17 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpindexwidget.cpp | 3 |
3 files changed, 13 insertions, 10 deletions
diff --git a/tools/assistant/lib/qhelpcontentwidget.cpp b/tools/assistant/lib/qhelpcontentwidget.cpp index a80dc39..6f3f942 100644 --- a/tools/assistant/lib/qhelpcontentwidget.cpp +++ b/tools/assistant/lib/qhelpcontentwidget.cpp @@ -370,7 +370,8 @@ void QHelpContentModel::invalidateContents(bool onShutDown) delete d->rootItem; d->rootItem = 0; } - reset(); + if (!onShutDown) + reset(); } /*! diff --git a/tools/assistant/lib/qhelpengine.cpp b/tools/assistant/lib/qhelpengine.cpp index 96cf0fd..e8ae31b 100644 --- a/tools/assistant/lib/qhelpengine.cpp +++ b/tools/assistant/lib/qhelpengine.cpp @@ -75,14 +75,15 @@ void QHelpEnginePrivate::init(const QString &collectionFile, { QHelpEngineCorePrivate::init(collectionFile, helpEngineCore); - contentModel = new QHelpContentModel(this); - indexModel = new QHelpIndexModel(this); - - connect(helpEngineCore, SIGNAL(setupFinished()), - this, SLOT(applyCurrentFilter())); - connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), - this, SLOT(applyCurrentFilter())); - + if (!contentModel) + contentModel = new QHelpContentModel(this); + if (!indexModel) + indexModel = new QHelpIndexModel(this); + + connect(helpEngineCore, SIGNAL(setupFinished()), this, + SLOT(applyCurrentFilter())); + connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), this, + SLOT(applyCurrentFilter())); } void QHelpEnginePrivate::applyCurrentFilter() diff --git a/tools/assistant/lib/qhelpindexwidget.cpp b/tools/assistant/lib/qhelpindexwidget.cpp index 270bcdd..11b9966 100644 --- a/tools/assistant/lib/qhelpindexwidget.cpp +++ b/tools/assistant/lib/qhelpindexwidget.cpp @@ -244,7 +244,8 @@ void QHelpIndexModel::invalidateIndex(bool onShutDown) disconnect(this, SLOT(insertIndices())); d->indexProvider->stopCollecting(); d->indices.clear(); - filter(QString()); + if (!onShutDown) + filter(QString()); } /*! |