summaryrefslogtreecommitdiffstats
path: root/plugins/zeroconf/avahiservice.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
commit1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch)
tree38559cd68cd4f63023fb5f6375def9db3b8b491e /plugins/zeroconf/avahiservice.cpp
parent894f94545727610df22c4f73911d62d58266f695 (diff)
downloadktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz
ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip
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
Diffstat (limited to 'plugins/zeroconf/avahiservice.cpp')
-rw-r--r--plugins/zeroconf/avahiservice.cpp18
1 files changed, 9 insertions, 9 deletions
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 <util/log.h>
#include <torrent/peerid.h>
#include <avahi-common/watch.h>
-#include <avahi-qt3/qt-watch.h>
+#include <avahi-qt3/tqt-watch.h>
#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<AvahiService*>(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();