From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: TQt4 port ktorrent This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/zeroconf/avahiservice.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/zeroconf/avahiservice.cpp') diff --git a/plugins/zeroconf/avahiservice.cpp b/plugins/zeroconf/avahiservice.cpp index a190d8e..714d92a 100644 --- a/plugins/zeroconf/avahiservice.cpp +++ b/plugins/zeroconf/avahiservice.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "localbrowser.h" #include "avahiservice.h" @@ -66,16 +66,16 @@ namespace kt } } - const char* name = avahi_strdup(QString("%1__%2%3").arg(service->id).arg((rand() % 26) + 65).arg((rand() % 26) + 65).ascii()); + const char* name = avahi_strdup(TQString("%1__%2%3").tqarg(service->id).tqarg((rand() % 26) + 65).tqarg((rand() % 26) + 65).ascii()); const char* type = avahi_strdup("_bittorrent._tcp"); - const char* subtype = avahi_strdup(QString("_" + service->infoHash + "._sub._bittorrent._tcp").ascii()); + const char* subtype = avahi_strdup(TQString("_" + service->infoHash + "._sub._bittorrent._tcp").ascii()); if (avahi_entry_group_add_service( service->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, (AvahiPublishFlags)0, name, type, NULL, NULL, service->port, NULL)) { if (avahi_client_errno(c) != -8) - Out(SYS_ZCO|LOG_DEBUG) << QString("ZC: Failed to add the service (%i).").arg(avahi_client_errno(c)) << endl; + Out(SYS_ZCO|LOG_DEBUG) << TQString("ZC: Failed to add the service (%i).").tqarg(avahi_client_errno(c)) << endl; else publish_service(service, c); return; @@ -85,7 +85,7 @@ namespace kt service->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, (AvahiPublishFlags)0, name, type, NULL, subtype)) { - Out(SYS_ZCO|LOG_DEBUG) << QString("ZC: Failed to add the service subtype (%i).").arg( avahi_client_errno(c)) << endl; + Out(SYS_ZCO|LOG_DEBUG) << TQString("ZC: Failed to add the service subtype (%i).").tqarg( avahi_client_errno(c)) << endl; return; } @@ -166,10 +166,10 @@ namespace kt { AvahiService* service = reinterpret_cast(userdata); - QString realname = QString(name); + TQString realname = TQString(name); realname.truncate(realname.length() - 5); - if (service->id != QString(realname)) + if (service->id != TQString(realname)) { char a[AVAHI_ADDRESS_STR_MAX]; avahi_address_snprint(a, sizeof(a), address); @@ -214,7 +214,7 @@ namespace kt } case AVAHI_BROWSER_REMOVE: { - QString realname = QString(name); + TQString realname = TQString(name); realname.truncate(realname.length() - 5); LocalBrowser::remove(bt::PeerID(realname.ascii())); @@ -317,7 +317,7 @@ namespace kt return false; } - if (!(browser = avahi_service_browser_new(listener, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, avahi_strdup(QString("_" + infoHash + "._sub._bittorrent._tcp").ascii()), NULL, (AvahiLookupFlags)0, browser_callback, this))) + if (!(browser = avahi_service_browser_new(listener, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, avahi_strdup(TQString("_" + infoHash + "._sub._bittorrent._tcp").ascii()), NULL, (AvahiLookupFlags)0, browser_callback, this))) { Out(SYS_ZCO|LOG_DEBUG) << "ZC: Failed to create a service browser." << endl; stop(); -- cgit v1.2.1