From 8a530c1f15d1fbf3e52c16504c7b62ee661b9db4 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 10 Feb 2011 11:42:46 +0100 Subject: [PATCH] * Fixed win32 build by breaking Linux. Will fix that right now, though. --- admin/win/revision.txt | 2 +- admin/win/tomahawk.nsi | 2 ++ src/libtomahawk/CMakeLists.txt | 2 +- src/libtomahawk/database/fuzzyindex.cpp | 38 ++++++++++++------------- src/libtomahawk/database/fuzzyindex.h | 38 ++++++++++++------------- thirdparty/jdns/CMakeLists.txt | 6 +--- 6 files changed, 43 insertions(+), 45 deletions(-) diff --git a/admin/win/revision.txt b/admin/win/revision.txt index eebd1d10b..4e9e28848 100644 --- a/admin/win/revision.txt +++ b/admin/win/revision.txt @@ -1 +1 @@ -61 \ No newline at end of file +63 \ No newline at end of file diff --git a/admin/win/tomahawk.nsi b/admin/win/tomahawk.nsi index 3212d7a51..0bc84cbaf 100755 --- a/admin/win/tomahawk.nsi +++ b/admin/win/tomahawk.nsi @@ -301,6 +301,8 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER File "${MING_DLL_PATH}\libechonest.dll" File "${MING_DLL_PATH}\liblastfm.dll" + File "${MING_LIB}\libclucene-core.dll" + File "${QXTWEB_DLL_PATH}\libqxtweb-standalone.dll" SectionEnd diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 27a38ef61..816e9ad34 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -360,7 +360,7 @@ target_link_libraries( tomahawklib ogg FLAC++ jdns - clucene + ${CLUCENE_LIBRARY} ) install( TARGETS tomahawklib DESTINATION lib ) diff --git a/src/libtomahawk/database/fuzzyindex.cpp b/src/libtomahawk/database/fuzzyindex.cpp index 8e85a72f2..3016a6f86 100644 --- a/src/libtomahawk/database/fuzzyindex.cpp +++ b/src/libtomahawk/database/fuzzyindex.cpp @@ -16,10 +16,10 @@ FuzzyIndex::FuzzyIndex( DatabaseImpl& db ) , m_luceneSearcher( 0 ) { QString lucenePath = TomahawkUtils::appDataDir().absoluteFilePath( "tomahawk.lucene" ); - bool create = !lucene::index::IndexReader::indexExists( lucenePath.toStdString().c_str() ); - m_luceneDir = lucene::store::FSDirectory::getDirectory( lucenePath.toStdString().c_str(), create ); + bool create = !IndexReader::indexExists( lucenePath.toStdString().c_str() ); + m_luceneDir = FSDirectory::getDirectory( lucenePath.toStdString().c_str(), create ); - m_analyzer = _CLNEW lucene::analysis::SimpleAnalyzer(); + m_analyzer = _CLNEW SimpleAnalyzer(); } @@ -36,7 +36,7 @@ void FuzzyIndex::beginIndexing() { m_mutex.lock(); - lucene::index::IndexWriter luceneWriter = lucene::index::IndexWriter( m_luceneDir, m_analyzer, true ); + IndexWriter luceneWriter = IndexWriter( m_luceneDir, m_analyzer, true ); } @@ -56,9 +56,9 @@ FuzzyIndex::appendFields( const QString& table, const QMap< unsigned int, QStrin m_luceneSearcher = 0; m_luceneReader = 0; - bool create = !lucene::index::IndexReader::indexExists( TomahawkUtils::appDataDir().absoluteFilePath( "tomahawk.lucene" ).toStdString().c_str() ); - lucene::index::IndexWriter luceneWriter = lucene::index::IndexWriter( m_luceneDir, m_analyzer, create ); - lucene::document::Document doc; + bool create = !IndexReader::indexExists( TomahawkUtils::appDataDir().absoluteFilePath( "tomahawk.lucene" ).toStdString().c_str() ); + IndexWriter luceneWriter = IndexWriter( m_luceneDir, m_analyzer, create ); + Document doc; QMapIterator< unsigned int, QString > it( fields ); while ( it.hasNext() ) @@ -68,14 +68,14 @@ FuzzyIndex::appendFields( const QString& table, const QMap< unsigned int, QStrin QString name = it.value(); { - lucene::document::Field* field = _CLNEW lucene::document::Field( table.toStdWString().c_str(), name.toStdWString().c_str(), - lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_UNTOKENIZED ); + Field* field = _CLNEW Field( table.toStdWString().c_str(), name.toStdWString().c_str(), + Field::STORE_YES | Field::INDEX_UNTOKENIZED ); doc.add( *field ); } { - lucene::document::Field* field = _CLNEW lucene::document::Field( _T( "id" ), QString::number( id ).toStdWString().c_str(), - lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_NO ); + Field* field = _CLNEW Field( _T( "id" ), QString::number( id ).toStdWString().c_str(), + Field::STORE_YES | Field::INDEX_NO ); doc.add( *field ); } @@ -102,29 +102,29 @@ FuzzyIndex::search( const QString& table, const QString& name ) QMap< int, float > resultsmap; if ( !m_luceneReader ) { - if ( !lucene::index::IndexReader::indexExists( TomahawkUtils::appDataDir().absoluteFilePath( "tomahawk.lucene" ).toStdString().c_str() ) ) + if ( !IndexReader::indexExists( TomahawkUtils::appDataDir().absoluteFilePath( "tomahawk.lucene" ).toStdString().c_str() ) ) { qDebug() << Q_FUNC_INFO << "index didn't exist."; return resultsmap; } - m_luceneReader = lucene::index::IndexReader::open( m_luceneDir ); - m_luceneSearcher = _CLNEW lucene::search::IndexSearcher( m_luceneReader ); + m_luceneReader = IndexReader::open( m_luceneDir ); + m_luceneSearcher = _CLNEW IndexSearcher( m_luceneReader ); } if ( name.isEmpty() ) return resultsmap; - lucene::analysis::SimpleAnalyzer analyzer; - lucene::queryParser::QueryParser parser( table.toStdWString().c_str(), m_analyzer ); - lucene::search::Hits* hits = 0; + SimpleAnalyzer analyzer; + QueryParser parser( table.toStdWString().c_str(), m_analyzer ); + Hits* hits = 0; - lucene::search::FuzzyQuery* qry = _CLNEW lucene::search::FuzzyQuery( _CLNEW lucene::index::Term( table.toStdWString().c_str(), name.toStdWString().c_str() ) ); + FuzzyQuery* qry = _CLNEW FuzzyQuery( _CLNEW Term( table.toStdWString().c_str(), name.toStdWString().c_str() ) ); hits = m_luceneSearcher->search( qry ); for ( int i = 0; i < hits->length(); i++ ) { - lucene::document::Document* d = &hits->doc( i ); + Document* d = &hits->doc( i ); float score = hits->score( i ); int id = QString::fromWCharArray( d->get( _T( "id" ) ) ).toInt(); diff --git a/src/libtomahawk/database/fuzzyindex.h b/src/libtomahawk/database/fuzzyindex.h index df49ba31b..176391afe 100644 --- a/src/libtomahawk/database/fuzzyindex.h +++ b/src/libtomahawk/database/fuzzyindex.h @@ -7,26 +7,26 @@ #include #include -namespace lucene -{ - namespace analysis - { +//namespace lucene +//{ +// namespace analysis +// { class SimpleAnalyzer; - } - namespace store - { +// } +// namespace store +// { class Directory; - } - namespace index - { +// } +// namespace index +// { class IndexReader; class IndexWriter; - } - namespace search - { +// } +// namespace search +// { class IndexSearcher; - } -} +// } +//} class DatabaseImpl; @@ -54,10 +54,10 @@ private: DatabaseImpl& m_db; QMutex m_mutex; - lucene::analysis::SimpleAnalyzer* m_analyzer; - lucene::store::Directory* m_luceneDir; - lucene::index::IndexReader* m_luceneReader; - lucene::search::IndexSearcher* m_luceneSearcher; + SimpleAnalyzer* m_analyzer; + Directory* m_luceneDir; + IndexReader* m_luceneReader; + IndexSearcher* m_luceneSearcher; }; #endif // FUZZYINDEX_H diff --git a/thirdparty/jdns/CMakeLists.txt b/thirdparty/jdns/CMakeLists.txt index 8111be46e..b231bfe8e 100644 --- a/thirdparty/jdns/CMakeLists.txt +++ b/thirdparty/jdns/CMakeLists.txt @@ -31,11 +31,7 @@ include_directories( qt4_wrap_cpp( JDNS_MOC ${JDNS_HEADERS} ) -if(WIN32) - ADD_LIBRARY(jdns SHARED ${JDNS_SOURCES} ${JDNS_MOC}) -else() - ADD_LIBRARY(jdns STATIC ${JDNS_SOURCES} ${JDNS_MOC}) -endif() +ADD_LIBRARY(jdns STATIC ${JDNS_SOURCES} ${JDNS_MOC}) target_link_libraries(jdns ${QT_LIBRARIES}