qt5-qttools/qttools-system_clucene.patch

225 lines
10 KiB
Diff

diff -up qttools-opensource-src-5.0.2/src/assistant/clucene/fulltextsearch.pri.system_clucene qttools-opensource-src-5.0.2/src/assistant/clucene/fulltextsearch.pri
--- qttools-opensource-src-5.0.2/src/assistant/clucene/fulltextsearch.pri.system_clucene 2013-04-08 19:11:56.000000000 -0500
+++ qttools-opensource-src-5.0.2/src/assistant/clucene/fulltextsearch.pri 2013-08-18 13:50:04.872174953 -0500
@@ -1,125 +1,8 @@
-DEFINES += _BUILD_FOR_QT_ LUCENE_DISABLE_MEMTRACKING
-win32:DEFINES += _CRT_SECURE_NO_DEPRECATE _MT
-
-CLUCENEDIR = ../3rdparty/clucene/src/CLucene
-
-INCLUDEPATH += . .. \
- $$CLUCENEDIR \
- $$CLUCENEDIR/../ \
- $$CLUCENEDIR/analysis \
- $$CLUCENEDIR/analysis/standard \
- $$CLUCENEDIR/config \
- $$CLUCENEDIR/debug \
- $$CLUCENEDIR/document \
- $$CLUCENEDIR/index \
- $$CLUCENEDIR/queryParser \
- $$CLUCENEDIR/search \
- $$CLUCENEDIR/store \
- $$CLUCENEDIR/util
-
-
-SOURCES += $$CLUCENEDIR/StdHeader.cpp \
- $$CLUCENEDIR/analysis/AnalysisHeader.cpp \
- $$CLUCENEDIR/analysis/Analyzers.cpp \
- $$CLUCENEDIR/config/gunichartables.cpp \
- $$CLUCENEDIR/config/repl_lltot.cpp \
- $$CLUCENEDIR/config/repl_tcscasecmp.cpp \
- $$CLUCENEDIR/config/repl_tcslwr.cpp \
- $$CLUCENEDIR/config/repl_tcstod.cpp \
- $$CLUCENEDIR/config/repl_tcstoll.cpp \
- $$CLUCENEDIR/config/repl_tprintf.cpp \
- $$CLUCENEDIR/config/threads.cpp \
- $$CLUCENEDIR/config/utf8.cpp \
- $$CLUCENEDIR/debug/condition.cpp \
- $$CLUCENEDIR/debug/error.cpp \
- $$CLUCENEDIR/debug/memtracking.cpp \
- $$CLUCENEDIR/document/DateField.cpp \
- $$CLUCENEDIR/document/Document.cpp \
- $$CLUCENEDIR/document/Field.cpp \
- $$CLUCENEDIR/index/CompoundFile.cpp \
- $$CLUCENEDIR/index/DocumentWriter.cpp \
- $$CLUCENEDIR/index/FieldInfos.cpp \
- $$CLUCENEDIR/index/FieldsReader.cpp \
- $$CLUCENEDIR/index/FieldsWriter.cpp \
- $$CLUCENEDIR/index/IndexModifier.cpp \
- $$CLUCENEDIR/index/IndexReader.cpp \
- $$CLUCENEDIR/index/IndexWriter.cpp \
- $$CLUCENEDIR/index/MultiReader.cpp \
- $$CLUCENEDIR/index/SegmentInfos.cpp \
- $$CLUCENEDIR/index/SegmentMergeInfo.cpp \
- $$CLUCENEDIR/index/SegmentMergeQueue.cpp \
- $$CLUCENEDIR/index/SegmentMerger.cpp \
- $$CLUCENEDIR/index/SegmentReader.cpp \
- $$CLUCENEDIR/index/SegmentTermDocs.cpp \
- $$CLUCENEDIR/index/SegmentTermEnum.cpp \
- $$CLUCENEDIR/index/SegmentTermPositions.cpp \
- $$CLUCENEDIR/index/SegmentTermVector.cpp \
- $$CLUCENEDIR/index/Term.cpp \
- $$CLUCENEDIR/index/TermInfo.cpp \
- $$CLUCENEDIR/index/TermInfosReader.cpp \
- $$CLUCENEDIR/index/TermInfosWriter.cpp \
- $$CLUCENEDIR/index/TermVectorReader.cpp \
- $$CLUCENEDIR/index/TermVectorWriter.cpp \
- $$CLUCENEDIR/queryParser/Lexer.cpp \
- $$CLUCENEDIR/queryParser/MultiFieldQueryParser.cpp \
- $$CLUCENEDIR/queryParser/QueryParser.cpp \
- $$CLUCENEDIR/queryParser/QueryParserBase.cpp \
- $$CLUCENEDIR/queryParser/QueryToken.cpp \
- $$CLUCENEDIR/queryParser/TokenList.cpp \
- $$CLUCENEDIR/search/BooleanQuery.cpp \
- $$CLUCENEDIR/search/BooleanScorer.cpp \
- $$CLUCENEDIR/search/CachingWrapperFilter.cpp \
- $$CLUCENEDIR/search/ChainedFilter.cpp \
- $$CLUCENEDIR/search/ConjunctionScorer.cpp \
- $$CLUCENEDIR/search/DateFilter.cpp \
- $$CLUCENEDIR/search/ExactPhraseScorer.cpp \
- $$CLUCENEDIR/search/Explanation.cpp \
- $$CLUCENEDIR/search/FieldCache.cpp \
- $$CLUCENEDIR/search/FieldCacheImpl.cpp \
- $$CLUCENEDIR/search/FieldDocSortedHitQueue.cpp \
- $$CLUCENEDIR/search/FieldSortedHitQueue.cpp \
- $$CLUCENEDIR/search/FilteredTermEnum.cpp \
- $$CLUCENEDIR/search/FuzzyQuery.cpp \
- $$CLUCENEDIR/search/HitQueue.cpp \
- $$CLUCENEDIR/search/Hits.cpp \
- $$CLUCENEDIR/search/IndexSearcher.cpp \
- $$CLUCENEDIR/search/MultiSearcher.cpp \
- $$CLUCENEDIR/search/MultiTermQuery.cpp \
- $$CLUCENEDIR/search/PhrasePositions.cpp \
- $$CLUCENEDIR/search/PhraseQuery.cpp \
- $$CLUCENEDIR/search/PhraseScorer.cpp \
- $$CLUCENEDIR/search/PrefixQuery.cpp \
- $$CLUCENEDIR/search/QueryFilter.cpp \
- $$CLUCENEDIR/search/RangeFilter.cpp \
- $$CLUCENEDIR/search/RangeQuery.cpp \
- $$CLUCENEDIR/search/SearchHeader.cpp \
- $$CLUCENEDIR/search/Similarity.cpp \
- $$CLUCENEDIR/search/SloppyPhraseScorer.cpp \
- $$CLUCENEDIR/search/Sort.cpp \
- $$CLUCENEDIR/search/TermQuery.cpp \
- $$CLUCENEDIR/search/TermScorer.cpp \
- $$CLUCENEDIR/search/WildcardQuery.cpp \
- $$CLUCENEDIR/search/WildcardTermEnum.cpp \
- $$CLUCENEDIR/store/FSDirectory.cpp \
- $$CLUCENEDIR/store/IndexInput.cpp \
- $$CLUCENEDIR/store/IndexOutput.cpp \
- $$CLUCENEDIR/store/Lock.cpp \
- $$CLUCENEDIR/store/MMapInput.cpp \
- $$CLUCENEDIR/store/RAMDirectory.cpp \
- $$CLUCENEDIR/store/TransactionalRAMDirectory.cpp \
- $$CLUCENEDIR/util/BitSet.cpp \
- $$CLUCENEDIR/util/Equators.cpp \
- $$CLUCENEDIR/util/FastCharStream.cpp \
- $$CLUCENEDIR/util/fileinputstream.cpp \
- $$CLUCENEDIR/util/Misc.cpp \
- $$CLUCENEDIR/util/Reader.cpp \
- $$CLUCENEDIR/util/StringBuffer.cpp \
- $$CLUCENEDIR/util/StringIntern.cpp \
- $$CLUCENEDIR/util/ThreadLocal.cpp \
- $$CLUCENEDIR/analysis/standard/StandardAnalyzer.cpp \
- $$CLUCENEDIR/analysis/standard/StandardFilter.cpp \
- $$CLUCENEDIR/analysis/standard/StandardTokenizer.cpp
+INCLUDEPATH += /usr/include/clucene09 $$[QT_INSTALL_LIBS]/clucene09
+LIBS += -L$$[QT_INSTALL_LIBS]/clucene09 -lclucene
+DEFINES += LUCENE_ENABLE_REFCOUNT
+QMAKE_CXXFLAGS += -fpermissive
#Header files
HEADERS += qclucene_global_p.h \
diff -up qttools-opensource-src-5.0.2/src/assistant/clucene/qindexreader.cpp.system_clucene qttools-opensource-src-5.0.2/src/assistant/clucene/qindexreader.cpp
--- qttools-opensource-src-5.0.2/src/assistant/clucene/qindexreader.cpp.system_clucene 2013-04-08 19:11:56.000000000 -0500
+++ qttools-opensource-src-5.0.2/src/assistant/clucene/qindexreader.cpp 2013-08-18 12:59:34.992893144 -0500
@@ -59,13 +59,13 @@ bool QCLuceneIndexReader::isLuceneFile(c
{
using namespace lucene::index;
- return IndexReader::isLuceneFile(filename);
+ return IndexReader::isLuceneFile(filename.toStdString().c_str());
}
bool QCLuceneIndexReader::indexExists(const QString &directory)
{
using namespace lucene::index;
- return IndexReader::indexExists(directory);
+ return IndexReader::indexExists(directory.toStdString().c_str());
}
QCLuceneIndexReader QCLuceneIndexReader::open(const QString &path)
@@ -73,7 +73,7 @@ QCLuceneIndexReader QCLuceneIndexReader:
using namespace lucene::index;
QCLuceneIndexReader indexReader;
- indexReader.d->reader = IndexReader::open(path);
+ indexReader.d->reader = IndexReader::open(path.toStdString().c_str());
return indexReader;
}
@@ -81,25 +81,25 @@ QCLuceneIndexReader QCLuceneIndexReader:
void QCLuceneIndexReader::unlock(const QString &path)
{
using namespace lucene::index;
- IndexReader::unlock(path);
+ IndexReader::unlock(path.toStdString().c_str());
}
bool QCLuceneIndexReader::isLocked(const QString &directory)
{
using namespace lucene::index;
- return IndexReader::isLocked(directory);
+ return IndexReader::isLocked(directory.toStdString().c_str());
}
quint64 QCLuceneIndexReader::lastModified(const QString &directory)
{
using namespace lucene::index;
- return quint64(IndexReader::lastModified(directory));
+ return quint64(IndexReader::lastModified(directory.toStdString().c_str()));
}
qint64 QCLuceneIndexReader::getCurrentVersion(const QString &directory)
{
using namespace lucene::index;
- return qint64(IndexReader::getCurrentVersion(directory));
+ return qint64(IndexReader::getCurrentVersion(directory.toStdString().c_str()));
}
void QCLuceneIndexReader::close()
@@ -155,7 +155,7 @@ bool QCLuceneIndexReader::document(qint3
void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, qreal value)
{
TCHAR *fieldName = QStringToTChar(field);
- d->reader->setNorm(int32_t(doc), fieldName, qreal(value));
+ d->reader->setNorm(int32_t(doc), fieldName, float(value));
delete [] fieldName;
}
diff -up qttools-opensource-src-5.0.2/src/assistant/clucene/qindexwriter.cpp.system_clucene qttools-opensource-src-5.0.2/src/assistant/clucene/qindexwriter.cpp
--- qttools-opensource-src-5.0.2/src/assistant/clucene/qindexwriter.cpp.system_clucene 2013-04-08 19:11:56.000000000 -0500
+++ qttools-opensource-src-5.0.2/src/assistant/clucene/qindexwriter.cpp 2013-08-18 12:59:34.992893144 -0500
@@ -50,7 +50,7 @@ QCLuceneIndexWriter::QCLuceneIndexWriter
: d(new QCLuceneIndexWriterPrivate())
, analyzer(analyzer)
{
- d->writer = new lucene::index::IndexWriter(path,
+ d->writer = new lucene::index::IndexWriter(path.toStdString().c_str(),
analyzer.d->analyzer, create, closeDir);
}
diff -up qttools-opensource-src-5.0.2/src/assistant/clucene/qsearchable.cpp.system_clucene qttools-opensource-src-5.0.2/src/assistant/clucene/qsearchable.cpp
--- qttools-opensource-src-5.0.2/src/assistant/clucene/qsearchable.cpp.system_clucene 2013-04-08 19:11:56.000000000 -0500
+++ qttools-opensource-src-5.0.2/src/assistant/clucene/qsearchable.cpp 2013-08-18 12:59:34.992893144 -0500
@@ -95,7 +95,7 @@ QCLuceneIndexSearcher::QCLuceneIndexSear
: QCLuceneSearcher()
{
lucene::search::IndexSearcher *searcher =
- new lucene::search::IndexSearcher(path);
+ new lucene::search::IndexSearcher(path.toStdString().c_str());
reader.d->reader = searcher->getReader();
reader.d->deleteCLuceneIndexReader = false;