summaryrefslogtreecommitdiffstats
path: root/kdnssd
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kdnssd
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdnssd')
-rw-r--r--kdnssd/ioslave/dnssd.cpp62
-rw-r--r--kdnssd/ioslave/dnssd.h30
-rw-r--r--kdnssd/kdedmodule/dnssdwatcher.cpp14
-rw-r--r--kdnssd/kdedmodule/dnssdwatcher.h14
-rw-r--r--kdnssd/kdedmodule/watcher.cpp16
-rw-r--r--kdnssd/kdedmodule/watcher.h10
6 files changed, 73 insertions, 73 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);
}
diff --git a/kdnssd/ioslave/dnssd.h b/kdnssd/ioslave/dnssd.h
index 1dc1dc05..8aaa90a8 100644
--- a/kdnssd/ioslave/dnssd.h
+++ b/kdnssd/ioslave/dnssd.h
@@ -21,16 +21,16 @@
#ifndef _dnssd_H_
#define _dnssd_H_
-#include <qstring.h>
-#include <qcstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqobject.h>
#include <kurl.h>
#include <kio/global.h>
#include <kio/slavebase.h>
#include <dnssd/servicebrowser.h>
#include <dnssd/remoteservice.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
class QCString;
@@ -39,11 +39,11 @@ using namespace DNSSD;
enum UrlType { RootDir, ServiceDir, Service, HelperProtocol, Invalid };
-class ZeroConfProtocol : public QObject, public KIO::SlaveBase
+class ZeroConfProtocol : public TQObject, public KIO::SlaveBase
{
Q_OBJECT
public:
- ZeroConfProtocol(const QCString& protocol, const QCString &pool_socket, const QCString &app_socket);
+ ZeroConfProtocol(const TQCString& protocol, const TQCString &pool_socket, const TQCString &app_socket);
~ZeroConfProtocol();
virtual void get(const KURL& url);
virtual void mimetype(const KURL& url);
@@ -51,26 +51,26 @@ public:
virtual void listDir(const KURL& url );
private:
// Create UDSEntry for zeroconf:/ or zeroconf:/type/ paths
- void buildDirEntry(UDSEntry& entry,const QString& name,const QString& type=QString::null,
- const QString& host=QString::null);
+ void buildDirEntry(UDSEntry& entry,const TQString& name,const TQString& type=TQString::null,
+ const TQString& host=TQString::null);
// Create UDSEntry for single services: dnssd:/type/service
- void buildServiceEntry(UDSEntry& entry,const QString& name,const QString& type,
- const QString& domain);
+ void buildServiceEntry(UDSEntry& entry,const TQString& name,const TQString& type,
+ const TQString& domain);
// Returns root dir, service dir, service or invalid
UrlType checkURL(const KURL& url);
// extract name, type and domain from URL
- void dissect(const KURL& url,QString& name,QString& type,QString& domain);
+ void dissect(const KURL& url,TQString& name,TQString& type,TQString& domain);
// resolve given service and redirect() to it or use KRun on it (used for helper protocols)
void resolveAndRedirect(const KURL& url, bool useKRun = false);
bool dnssdOK();
- QString getAttribute(const QString& name);
- QString getProtocol(const QString& type);
+ TQString getAttribute(const TQString& name);
+ TQString getProtocol(const TQString& type);
// try to load config file for given service type (or just return if already loaded)
- bool setConfig(const QString& type);
+ bool setConfig(const TQString& type);
ServiceBrowser* browser;
// service types merged from all domains - to avoid duplicates
- QStringList mergedtypes;
+ TQStringList mergedtypes;
// last resolved or still being resolved services - acts as one-entry cache
RemoteService *toResolve;
// Config file for service - also acts as one-entry cache
diff --git a/kdnssd/kdedmodule/dnssdwatcher.cpp b/kdnssd/kdedmodule/dnssdwatcher.cpp
index a7eb256f..7e1ef6d2 100644
--- a/kdnssd/kdedmodule/dnssdwatcher.cpp
+++ b/kdnssd/kdedmodule/dnssdwatcher.cpp
@@ -26,7 +26,7 @@
#include "watcher.h"
-DNSSDWatcher::DNSSDWatcher(const QCString& obj)
+DNSSDWatcher::DNSSDWatcher(const TQCString& obj)
: KDEDModule(obj)
{
connectDCOPSignal("","KDirNotify","enteredDirectory(KURL)","enteredDirectory(KURL)",false);
@@ -34,12 +34,12 @@ DNSSDWatcher::DNSSDWatcher(const QCString& obj)
watchers.setAutoDelete(true);
}
-QStringList DNSSDWatcher::watchedDirectories()
+TQStringList DNSSDWatcher::watchedDirectories()
{
//TODO
// return watchers.keys();
- QStringList keys;
- for (QDictIterator<Watcher> it(watchers) ; it.current(); ++it ) {
+ TQStringList keys;
+ for (TQDictIterator<Watcher> it(watchers) ; it.current(); ++it ) {
keys << it.currentKey();
kdDebug() << it.currentKey() << " " << (*it)->refcount << "\n";
}
@@ -48,7 +48,7 @@ return keys;
// from ioslave
-void DNSSDWatcher::dissect(const KURL& url,QString& name,QString& type,QString& domain)
+void DNSSDWatcher::dissect(const KURL& url,TQString& name,TQString& type,TQString& domain)
{
type = url.path().section("/",1,1);
domain = url.host();
@@ -76,7 +76,7 @@ void DNSSDWatcher::leftDirectory(const KURL& dir)
void DNSSDWatcher::createNotifier(const KURL& url)
{
- QString domain,type,name;
+ TQString domain,type,name;
dissect(url,name,type,domain);
if (type.isEmpty()) type = DNSSD::ServiceBrowser::AllServices;
Watcher *w = new Watcher(type,domain);
@@ -84,7 +84,7 @@ void DNSSDWatcher::createNotifier(const KURL& url)
}
extern "C" {
- KDE_EXPORT KDEDModule *create_dnssdwatcher(const QCString &obj)
+ KDE_EXPORT KDEDModule *create_dnssdwatcher(const TQCString &obj)
{
KGlobal::locale()->insertCatalogue("dnssdwatcher");
return new DNSSDWatcher(obj);
diff --git a/kdnssd/kdedmodule/dnssdwatcher.h b/kdnssd/kdedmodule/dnssdwatcher.h
index eb2d7092..2baea9fe 100644
--- a/kdnssd/kdedmodule/dnssdwatcher.h
+++ b/kdnssd/kdedmodule/dnssdwatcher.h
@@ -19,10 +19,10 @@
#ifndef _DNSSDWATCHER_H_
#define _DNSSDWATCHER_H_
-#include <qdict.h>
+#include <tqdict.h>
#include <kdedmodule.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include <kurl.h>
class Watcher;
@@ -31,18 +31,18 @@ class DNSSDWatcher : public KDEDModule
Q_OBJECT
K_DCOP
public:
- DNSSDWatcher(const QCString& obj);
+ DNSSDWatcher(const TQCString& obj);
k_dcop:
- QStringList watchedDirectories();
+ TQStringList watchedDirectories();
void enteredDirectory(const KURL& dir);
void leftDirectory(const KURL& dir);
private:
- QDict<Watcher> watchers;
+ TQDict<Watcher> watchers;
void createNotifier(const KURL& url);
- void dissect(const KURL& url,QString& name,QString& type,QString& domain);
+ void dissect(const KURL& url,TQString& name,TQString& type,TQString& domain);
};
diff --git a/kdnssd/kdedmodule/watcher.cpp b/kdnssd/kdedmodule/watcher.cpp
index d4dcc95a..f6b7a973 100644
--- a/kdnssd/kdedmodule/watcher.cpp
+++ b/kdnssd/kdedmodule/watcher.cpp
@@ -21,20 +21,20 @@
#include <kdebug.h>
#include <kdirnotify_stub.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
-Watcher::Watcher(const QString& type, const QString& domain)
+Watcher::Watcher(const TQString& type, const TQString& domain)
: refcount(1), updateNeeded(false), m_type(type), m_domain(domain)
{
if (domain.isEmpty()) browser = new ServiceBrowser(type);
else browser = new ServiceBrowser(type,domain);
- connect(browser,SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
- SLOT(serviceAdded(DNSSD::RemoteService::Ptr)));
- connect(browser,SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)),
- SLOT(serviceRemoved(DNSSD::RemoteService::Ptr)));
- connect(browser,SIGNAL(finished()),SLOT(finished()));
+ connect(browser,TQT_SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)),
+ TQT_SLOT(serviceAdded(DNSSD::RemoteService::Ptr)));
+ connect(browser,TQT_SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)),
+ TQT_SLOT(serviceRemoved(DNSSD::RemoteService::Ptr)));
+ connect(browser,TQT_SIGNAL(finished()),TQT_SLOT(finished()));
browser->startBrowse();
}
@@ -59,7 +59,7 @@ void Watcher::finished()
KDirNotify_stub st("*","*");
kdDebug() << "Finished for " << m_type << "@" << m_domain << "\n";
if (updateNeeded || removed.count()) {
- QString url = "zeroconf:/";
+ TQString url = "zeroconf:/";
if (!m_domain.isEmpty()) url+="/"+m_domain+"/";
if (m_type!=ServiceBrowser::AllServices) url+=m_type;
kdDebug() << "Sending update: " << url << "\n";
diff --git a/kdnssd/kdedmodule/watcher.h b/kdnssd/kdedmodule/watcher.h
index 84e9104e..64c5635c 100644
--- a/kdnssd/kdedmodule/watcher.h
+++ b/kdnssd/kdedmodule/watcher.h
@@ -19,7 +19,7 @@
#ifndef _WATCHER_H_
#define _WATCHER_H_
-#include <qstring.h>
+#include <tqstring.h>
#include <dnssd/servicebrowser.h>
#include <dnssd/remoteservice.h>
@@ -29,16 +29,16 @@ class Watcher : public QObject
{
Q_OBJECT
public:
- Watcher(const QString& type, const QString& domain);
+ Watcher(const TQString& type, const TQString& domain);
~Watcher();
unsigned int refcount;
private:
ServiceBrowser* browser;
bool updateNeeded;
- QString m_type;
- QString m_domain;
- QValueList<DNSSD::RemoteService::Ptr> removed;
+ TQString m_type;
+ TQString m_domain;
+ TQValueList<DNSSD::RemoteService::Ptr> removed;
private slots:
void serviceRemoved(DNSSD::RemoteService::Ptr srv);