diff --git a/CMakeModules/FindCLucene.cmake b/CMakeModules/FindCLucene.cmake index 19dba8277..c4ea7850c 100644 --- a/CMakeModules/FindCLucene.cmake +++ b/CMakeModules/FindCLucene.cmake @@ -75,7 +75,7 @@ FIND_PATH(CLUCENE_LIBRARY_DIR PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH) IF (CLUCENE_LIBRARY_DIR) MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}") - INCLUDE(${CLUCENE_LIBRARY_DIR}/CLuceneConfig.cmake/CLuceneConfig.cmake) + #INCLUDE(${CLUCENE_LIBRARY_DIR}/CLuceneConfig.cmake/CLuceneConfig.cmake) IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}") MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}") SET(CLUCENE_GOOD_VERSION FALSE) diff --git a/src/sip/jabber/jabber_p.cpp b/src/sip/jabber/jabber_p.cpp index 035da9d6d..ca3c1dd3f 100644 --- a/src/sip/jabber/jabber_p.cpp +++ b/src/sip/jabber/jabber_p.cpp @@ -148,12 +148,11 @@ Jabber_p::go() // Handle proxy qDebug() << "Connecting to the XMPP server..."; - //FIXME: This call blocks and locks up the whole GUI if the network is down if( m_client->connect( false ) ) { - qDebug() << "Connected to the XMPP server"; - emit connected(); - QTimer::singleShot( 0, this, SLOT( doJabberRecv() ) ); + int sock = static_cast( m_client->connectionImpl() )->socket(); + notifier_.reset( new QSocketNotifier( sock, QSocketNotifier::Read ) ); + connect( notifier_.data(), SIGNAL(activated(int)), SLOT(doJabberRecv())); } else qDebug() << "Could not connect to the XMPP server!"; @@ -171,10 +170,6 @@ Jabber_p::doJabberRecv() { qDebug() << "Jabber_p::Recv failed, disconnected"; } - else - { - QTimer::singleShot( 100, this, SLOT( doJabberRecv() ) ); - } } @@ -260,6 +255,7 @@ Jabber_p::addContact( const QString& jid, const QString& msg ) void Jabber_p::onConnect() { + qDebug() << "Connected to the XMPP server"; // update jid resource, servers like gtalk use resource binding and may // have changed our requested /resource if ( m_client->resource() != m_jid.resource() ) @@ -270,6 +266,7 @@ Jabber_p::onConnect() } qDebug() << "Connected as:" << m_jid.full().c_str(); + emit connected(); } diff --git a/src/sip/jabber/jabber_p.h b/src/sip/jabber/jabber_p.h index b4611c149..a307bcf35 100644 --- a/src/sip/jabber/jabber_p.h +++ b/src/sip/jabber/jabber_p.h @@ -7,7 +7,9 @@ #define JABBER_P_H #include +#include #include +#include #include #include @@ -137,6 +139,7 @@ private: QMap m_peers; QSharedPointer m_vcardManager; QString m_server; + QScopedPointer notifier_; }; #endif // JABBER_H