diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-17 14:54:44 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-17 14:54:44 (GMT) |
commit | 46a33725125f0b5408fd421ae8fd9f4c76a123ab (patch) | |
tree | 5df2038ecc5225377fbbdb2aa9da4e68acafae56 /tools | |
parent | ba25514d1c1010d84ffdbf75331ff71596e56c99 (diff) | |
parent | ac9f56b31dacc35dd2007caee69a9cf521ed8410 (diff) | |
download | Qt-46a33725125f0b5408fd421ae8fd9f4c76a123ab.zip Qt-46a33725125f0b5408fd421ae8fd9f4c76a123ab.tar.gz Qt-46a33725125f0b5408fd421ae8fd9f4c76a123ab.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qtscript-jsc-backend
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/lib.pro | 8 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp | 78 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h | 2 | ||||
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 4 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 6 | ||||
-rw-r--r-- | tools/qdoc3/tree.cpp | 2 |
6 files changed, 72 insertions, 28 deletions
diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro index 5d6d436..011dec2 100644 --- a/tools/assistant/lib/lib.pro +++ b/tools/assistant/lib/lib.pro @@ -18,14 +18,12 @@ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { mac:qclucene = $${qclucene}_debug win32:qclucene = $${qclucene}d } -linux-lsb-g++:LIBS += --lsb-shared-libs=$$qclucene -unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ - QtSql \ - QtXml -LIBS += -l$$qclucene +linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ QtSql \ QtXml +LIBS_PRIVATE += -l$$qclucene + RESOURCES += helpsystem.qrc SOURCES += qhelpenginecore.cpp \ qhelpengine.cpp \ diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp index 6f7c035..4651d2e 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp @@ -590,15 +590,24 @@ void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, void QHelpSearchIndexWriter::optimizeIndex() { - if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { - if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) - return; - - QCLuceneStandardAnalyzer analyzer; - QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); - writer.optimize(); - writer.close(); +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { + if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) + return; + + QCLuceneStandardAnalyzer analyzer; + QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); + writer.optimize(); + writer.close(); + } +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not optimize index."); + return; } +#endif } void QHelpSearchIndexWriter::run() @@ -720,21 +729,30 @@ void QHelpSearchIndexWriter::run() } #if !defined(QT_NO_EXCEPTIONS) } catch (...) { - qWarning("Full Text Search, could not create index writer in '%s'.", qPrintable(indexPath)); + qWarning("Full Text Search, could not create index writer in '%s'.", + qPrintable(indexPath)); return; } #endif - writer->setMergeFactor(100); - writer->setMinMergeDocs(1000); - writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + writer->setMergeFactor(100); + writer->setMinMergeDocs(1000); + writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not set writer properties."); + return; + } +#endif QStringList namespaces; foreach(const QString &namespaceName, registeredDocs) { mutexLocker.relock(); if (m_cancel) { - writer->close(); - delete writer; + closeIndexWriter(writer); emit indexingFinished(); return; } @@ -777,8 +795,7 @@ void QHelpSearchIndexWriter::run() mutexLocker.unlock(); } - writer->close(); - delete writer; + closeIndexWriter(writer); mutexLocker.relock(); if (!m_cancel) { @@ -813,15 +830,23 @@ bool QHelpSearchIndexWriter::addDocuments(const QList<QUrl> docFiles, foreach(const QUrl &url, docFiles) { QCLuceneDocument document; DocumentHelper helper(url.toString(), engine.fileData(url)); - if (helper.addFieldsToDocument(&document, namespaceName, attrList)) - writer->addDocument(document, analyzer); - + if (helper.addFieldsToDocument(&document, namespaceName, attrList)) { +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + writer->addDocument(document, analyzer); +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not properly add documents."); + return false; + } +#endif + } locker.relock(); if (m_cancel) return false; locker.unlock(); } - return true; } @@ -861,6 +886,19 @@ QList<QUrl> QHelpSearchIndexWriter::indexableFiles(QHelpEngineCore *helpEngine, return docFiles; } +void QHelpSearchIndexWriter::closeIndexWriter(QCLuceneIndexWriter *writer) +{ +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + writer->close(); + delete writer; +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not properly close index writer."); + } +#endif +} } // namespace clucene } // namespace fulltextsearch diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h b/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h index e9a917b..d4bb755 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h @@ -104,6 +104,8 @@ private: QList<QUrl> indexableFiles(QHelpEngineCore *helpEngine, const QString &namespaceName, const QStringList &attributes) const; + void closeIndexWriter(QCLuceneIndexWriter *writer); + private: QMutex mutex; QWaitCondition waitCondition; diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ebe5ec9..7519ff1 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1734,11 +1734,11 @@ bool CppCodeParser::matchProperty(InnerNode *parent) property->setDesignable(value.toLower() == "true"); else if (key == "RESET") tre->addPropertyFunction(property, value, PropertyNode::Resetter); -#if 0 + else if (key == "NOTIFY") { tre->addPropertyFunction(property, value, PropertyNode::Notifier); } -#endif + } match(Tok_RightParen); return true; diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 2a1ca05..0cddf51 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -598,6 +598,7 @@ class PropertyNode : public LeafNode void setDataType(const QString& dataType) { dt = dataType; } void addFunction(FunctionNode *function, FunctionRole role); + void addSignal(FunctionNode *function, FunctionRole role); void setStored(bool stored) { sto = toTrool(stored); } void setDesignable(bool designable) { des = toTrool(designable); } void setOverriddenFrom(const PropertyNode *baseProperty); @@ -641,6 +642,11 @@ inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role) function->setAssociatedProperty(this); } +inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role) +{ + funcs[(int)role].append(function); +} + inline NodeList PropertyNode::functions() const { NodeList list; diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index b42701f..7d488df 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -501,7 +501,7 @@ void Tree::resolveProperties() } else if (function->name() == resetterName) { property->addFunction(function, PropertyNode::Resetter); } else if (function->name() == notifierName) { - property->addFunction(function, PropertyNode::Notifier); + property->addSignal(function, PropertyNode::Notifier); } } } |