summaryrefslogtreecommitdiffstats
path: root/kdnssd/ioslave/dnssd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdnssd/ioslave/dnssd.cpp')
-rw-r--r--kdnssd/ioslave/dnssd.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/kdnssd/ioslave/dnssd.cpp b/kdnssd/ioslave/dnssd.cpp
index b039298a..6508a13a 100644
--- a/kdnssd/ioslave/dnssd.cpp
+++ b/kdnssd/ioslave/dnssd.cpp
@@ -18,10 +18,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qcstring.h>
-#include <qsocket.h>
-#include <qdatetime.h>
-#include <qbitarray.h>
+#include <tqcstring.h>
+#include <tqsocket.h>
+#include <tqdatetime.h>
+#include <tqbitarray.h>
#include <stdlib.h>
#include <math.h>
@@ -43,9 +43,9 @@
#include <klocale.h>
#include <kurl.h>
#include <ksock.h>
-#include <qmap.h>
+#include <tqmap.h>
#include <kapplication.h>
-#include <qeventloop.h>
+#include <tqeventloop.h>
#include <dnssd/domainbrowser.h>
#include <krun.h>
@@ -60,7 +60,7 @@ static const KCmdLineOptions options[] =
KCmdLineLastOption
};
-ZeroConfProtocol::ZeroConfProtocol(const QCString& protocol, const QCString &pool_socket, const QCString &app_socket)
+ZeroConfProtocol::ZeroConfProtocol(const TQCString& protocol, const TQCString &pool_socket, const TQCString &app_socket)
: SlaveBase(protocol, pool_socket, app_socket), browser(0),toResolve(0),
configData(0)
{}
@@ -79,11 +79,11 @@ void ZeroConfProtocol::get(const KURL& url )
{
resolveAndRedirect(url,true);
mimeType("text/html");
- QString reply= "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
+ TQString reply= "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
reply+="</head>\n<body>\n<h2>"+i18n("Requested service has been launched in separate window.");
reply+="</h2>\n</body></html>";
data(reply.utf8());
- data(QByteArray());
+ data(TQByteArray());
finished();
break;
}
@@ -102,9 +102,9 @@ void ZeroConfProtocol::mimetype(const KURL& url )
UrlType ZeroConfProtocol::checkURL(const KURL& url)
{
if (url.path()=="/") return RootDir;
- QString service, type, domain;
+ TQString service, type, domain;
dissect(url,service,type,domain);
- const QString& proto = type.section('.',1,-1);
+ const TQString& proto = type.section('.',1,-1);
if (type[0]!='_' || (proto!="_udp" && proto!="_tcp")) return Invalid;
if (service.isEmpty()) return ServiceDir;
if (!domain.isEmpty()) {
@@ -118,7 +118,7 @@ UrlType ZeroConfProtocol::checkURL(const KURL& url)
// URL zeroconf://domain/_http._tcp/some%20service
// URL invitation://host:port/_http._tcp/some%20service?u=username&root=directory
-void ZeroConfProtocol::dissect(const KURL& url,QString& name,QString& type,QString& domain)
+void ZeroConfProtocol::dissect(const KURL& url,TQString& name,TQString& type,TQString& domain)
{
type = url.path().section("/",1,1);
domain = url.host();
@@ -159,7 +159,7 @@ void ZeroConfProtocol::stat(const KURL& url)
break;
case HelperProtocol:
{
- QString name,type,domain;
+ TQString name,type,domain;
dissect(url,name,type,domain);
buildServiceEntry(entry,name,type,domain);
statEntry(entry);
@@ -170,15 +170,15 @@ void ZeroConfProtocol::stat(const KURL& url)
error(ERR_MALFORMED_URL,i18n("invalid URL"));
}
}
-QString ZeroConfProtocol::getAttribute(const QString& name)
+TQString ZeroConfProtocol::getAttribute(const TQString& name)
{
- QString entry = configData->readEntry(name);
- return (entry.isNull()) ? QString::null : toResolve->textData()[entry];
+ TQString entry = configData->readEntry(name);
+ return (entry.isNull()) ? TQString::null : toResolve->textData()[entry];
}
void ZeroConfProtocol::resolveAndRedirect(const KURL& url, bool useKRun)
{
- QString name,type,domain;
+ TQString name,type,domain;
dissect(url,name,type,domain);
if (url.protocol()=="invitation") {
delete toResolve;
@@ -216,7 +216,7 @@ void ZeroConfProtocol::resolveAndRedirect(const KURL& url, bool useKRun)
}
}
-bool ZeroConfProtocol::setConfig(const QString& type)
+bool ZeroConfProtocol::setConfig(const TQString& type)
{
kdDebug() << "Setting config for " << type << endl;
if (configData)
@@ -233,7 +233,7 @@ bool ZeroConfProtocol::setConfig(const QString& type)
return (configData->readEntry("Type")==type);
}
-inline void buildAtom(UDSEntry& entry,UDSAtomTypes type, const QString& data)
+inline void buildAtom(UDSEntry& entry,UDSAtomTypes type, const TQString& data)
{
UDSAtom atom;
atom.m_uds=type;
@@ -249,7 +249,7 @@ inline void buildAtom(UDSEntry& entry,UDSAtomTypes type, long data)
}
-void ZeroConfProtocol::buildDirEntry(UDSEntry& entry,const QString& name,const QString& type, const QString& host)
+void ZeroConfProtocol::buildDirEntry(UDSEntry& entry,const TQString& name,const TQString& type, const TQString& host)
{
entry.clear();
buildAtom(entry,UDS_NAME,name);
@@ -259,23 +259,23 @@ void ZeroConfProtocol::buildDirEntry(UDSEntry& entry,const QString& name,const Q
buildAtom(entry,UDS_MIME_TYPE,"inode/directory");
if (!type.isNull()) buildAtom(entry,UDS_URL,"zeroconf:/"+((!host.isNull()) ? "/"+host+"/" : "" )+type+"/");
}
-QString ZeroConfProtocol::getProtocol(const QString& type)
+TQString ZeroConfProtocol::getProtocol(const TQString& type)
{
setConfig(type);
return configData->readEntry("Protocol",type.section(".",0,0).mid(1));
}
-void ZeroConfProtocol::buildServiceEntry(UDSEntry& entry,const QString& name,const QString& type,const QString& domain)
+void ZeroConfProtocol::buildServiceEntry(UDSEntry& entry,const TQString& name,const TQString& type,const TQString& domain)
{
setConfig(type);
entry.clear();
buildAtom(entry,UDS_NAME,name);
buildAtom(entry,UDS_ACCESS,0666);
- QString icon=configData->readEntry("Icon",KProtocolInfo::icon(getProtocol(type)));
+ TQString icon=configData->readEntry("Icon",KProtocolInfo::icon(getProtocol(type)));
if (!icon.isNull()) buildAtom(entry,UDS_ICON_NAME,icon);
KURL protourl;
protourl.setProtocol(getProtocol(type));
- QString encname = "zeroconf://" + domain +"/" +type+ "/" + name;
+ TQString encname = "zeroconf://" + domain +"/" +type+ "/" + name;
if (KProtocolInfo::supportsListing(protourl)) {
buildAtom(entry,UDS_FILE_TYPE,S_IFDIR);
encname+="/";
@@ -294,15 +294,15 @@ void ZeroConfProtocol::listDir(const KURL& url )
if (allDomains=url.host().isEmpty())
browser = new ServiceBrowser(ServiceBrowser::AllServices);
else browser = new ServiceBrowser(ServiceBrowser::AllServices,url.host());
- connect(browser,SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
- this,SLOT(newType(DNSSD::RemoteService::Ptr)));
+ connect(browser,TQT_SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
+ this,TQT_SLOT(newType(DNSSD::RemoteService::Ptr)));
break;
case ServiceDir:
if (url.host().isEmpty())
browser = new ServiceBrowser(url.path(-1).section("/",1,-1));
else browser = new ServiceBrowser(url.path(-1).section("/",1,-1),url.host());
- connect(browser,SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
- this,SLOT(newService(DNSSD::RemoteService::Ptr)));
+ connect(browser,TQT_SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
+ this,TQT_SLOT(newService(DNSSD::RemoteService::Ptr)));
break;
case Service:
resolveAndRedirect(url);
@@ -311,7 +311,7 @@ void ZeroConfProtocol::listDir(const KURL& url )
error(ERR_MALFORMED_URL,i18n("invalid URL"));
return;
}
- connect(browser,SIGNAL(finished()),this,SLOT(allReported()));
+ connect(browser,TQT_SIGNAL(finished()),this,TQT_SLOT(allReported()));
browser->startBrowse();
kapp->eventLoop()->enterLoop();
}
@@ -332,9 +332,9 @@ void ZeroConfProtocol::newType(DNSSD::RemoteService::Ptr srv)
UDSEntry entry;
kdDebug() << "Got new entry " << srv->type() << endl;
if (!setConfig(srv->type())) return;
- QString name = configData->readEntry("Name");
+ TQString name = configData->readEntry("Name");
if (!name.isNull()) {
- buildDirEntry(entry,name,srv->type(), (allDomains) ? QString::null :
+ buildDirEntry(entry,name,srv->type(), (allDomains) ? TQString::null :
browser->browsedDomains()->domains()[0]);
listEntry(entry,false);
}