DEFINES -= QT_ASCII_CAST_WARNINGS
+# impossible to disable exceptions in clucene atm and use help lib without
+CONFIG(exceptions_off) {
+ CONFIG -= exceptions_off
+ CONFIG += exceptions
+ !win32|win32-g++* {
+ QMAKE_CFLAGS -= -fno-exceptions
+ QMAKE_CXXFLAGS -= -fno-exceptions
+ QMAKE_LFLAGS -= -fno-exceptions
+ QMAKE_CFLAGS += -fexceptions
+ QMAKE_CXXFLAGS += -fexceptions
+ QMAKE_LFLAGS += -fexceptions
+ }
+}
+
RESOURCES += helpsystem.qrc
SOURCES += qhelpenginecore.cpp \
qhelpengine.cpp \
emit searchingStarted();
-#if !defined(QT_NO_EXCEPTIONS)
try {
-#endif
QCLuceneBooleanQuery booleanQueryTitle;
QCLuceneBooleanQuery booleanQueryContent;
QCLuceneStandardAnalyzer analyzer;
if ((count > 0) && boost)
boostSearchHits(engine, hitList, queryList);
emit searchingFinished(hitList.count());
-
-#if !defined(QT_NO_EXCEPTIONS)
} catch(...) {
mutex.lock();
hitList.clear();
mutex.unlock();
emit searchingFinished(0);
}
-#endif
}
}
void QHelpSearchIndexWriter::optimizeIndex()
{
-#if !defined(QT_NO_EXCEPTIONS)
try {
-#endif
if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) {
if (QCLuceneIndexReader::isLocked(m_indexFilesFolder))
return;
writer.optimize();
writer.close();
}
-#if !defined(QT_NO_EXCEPTIONS)
} catch (...) {
qWarning("Full Text Search, could not optimize index.");
return;
}
-#endif
}
void QHelpSearchIndexWriter::run()
{
-#if !defined(QT_NO_EXCEPTIONS)
try {
-#endif
QMutexLocker mutexLocker(&mutex);
if (m_cancel)
}
}
}
-
-#if !defined(QT_NO_EXCEPTIONS)
} catch (...) {
qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO);
}
-#endif
-
emit indexingFinished();
}
QCLuceneDocument document;
DocumentHelper helper(url.toString(), engine.fileData(url));
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)
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