1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 00:34:04 +00:00

(trunk qt) #3836 "libevent2 support" -- add a mechanism to make it easier to build the Qt client with custom installs of libevent2

This commit is contained in:
Charles Kerr 2010-12-31 19:44:51 +00:00
parent 60c5ebb4be
commit 19c043ed84
3 changed files with 11 additions and 4 deletions

View file

@ -15,13 +15,17 @@ CONFIG += qt qdbus thread debug link_pkgconfig
QT += network
PKGCONFIG = fontconfig libcurl openssl dbus-1
# if you have libevent2 installed in a custom path, specify it here
EVENT_TOP = /usr
INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
TRANSMISSION_TOP = ..
INCLUDEPATH += $${TRANSMISSION_TOP}
LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
unix: LIBS += -levent -lz
unix: LIBS += -L$${EVENT_TOP}/lib -levent -lz
win32:DEFINES += QT_DBUS
win32:LIBS += -levent -lws2_32 -lintl
win32:LIBS += -lidn -liconv -lwldap32 -liphlpapi

View file

@ -30,6 +30,8 @@
#include <curl/curl.h>
#include <event2/buffer.h>
#include <libtransmission/transmission.h>
#include <libtransmission/bencode.h>
#include <libtransmission/json.h>
@ -662,11 +664,11 @@ Session :: exec( const tr_benc * request )
}
void
Session :: localSessionCallback( tr_session * session, const char * json, size_t len, void * self )
Session :: localSessionCallback( tr_session * session, struct evbuffer * json, void * self )
{
Q_UNUSED( session );
((Session*)self)->parseResponse( json, len );
((Session*)self)->parseResponse( (const char*) evbuffer_pullup( json, -1 ), evbuffer_get_length( json ) );
}
#define REQUEST_DATA_PROPERTY_KEY "requestData"

View file

@ -29,6 +29,7 @@ class AddData;
extern "C"
{
struct evbuffer;
struct tr_benc;
}
@ -74,7 +75,7 @@ class Session: public QObject
void updateStats( struct tr_benc * args );
void updateInfo( struct tr_benc * args );
void parseResponse( const char * json, size_t len );
static void localSessionCallback( tr_session *, const char *, size_t, void * );
static void localSessionCallback( tr_session *, struct evbuffer *, void * );
public:
void exec( const char * json );