summaryrefslogtreecommitdiffstats
path: root/krfb/srvloc
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 /krfb/srvloc
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 'krfb/srvloc')
-rw-r--r--krfb/srvloc/kinetinterface.cpp20
-rw-r--r--krfb/srvloc/kinetinterface.h14
-rw-r--r--krfb/srvloc/kinetinterfacewatcher.cpp10
-rw-r--r--krfb/srvloc/kinetinterfacewatcher.h26
-rw-r--r--krfb/srvloc/kserviceregistry.cpp40
-rw-r--r--krfb/srvloc/kserviceregistry.h28
-rw-r--r--krfb/srvloc/uuid.cpp4
-rw-r--r--krfb/srvloc/uuid.h4
8 files changed, 73 insertions, 73 deletions
diff --git a/krfb/srvloc/kinetinterface.cpp b/krfb/srvloc/kinetinterface.cpp
index 0599dfa7..d1f45652 100644
--- a/krfb/srvloc/kinetinterface.cpp
+++ b/krfb/srvloc/kinetinterface.cpp
@@ -30,7 +30,7 @@
class KInetInterfacePrivate {
public:
- QString name;
+ TQString name;
int flags;
KInetSocketAddress *address;
KInetSocketAddress *netmask;
@@ -45,7 +45,7 @@ public:
destination(0) {
}
- KInetInterfacePrivate(const QString _name,
+ KInetInterfacePrivate(const TQString _name,
int _flags,
KInetSocketAddress *_address,
KInetSocketAddress *_netmask,
@@ -99,7 +99,7 @@ KInetInterface::KInetInterface() :
d(0) {
}
-KInetInterface::KInetInterface(const QString &_name,
+KInetInterface::KInetInterface(const TQString &_name,
int _flags,
KInetSocketAddress *_address,
KInetSocketAddress *_netmask,
@@ -143,11 +143,11 @@ bool KInetInterface::isValid() const {
return d == 0;
}
-QString KInetInterface::displayName() const {
+TQString KInetInterface::displayName() const {
return d->name;
}
-QString KInetInterface::name() const {
+TQString KInetInterface::name() const {
return d->name;
}
@@ -172,13 +172,13 @@ KInetSocketAddress *KInetInterface::destinationAddress() const {
}
KInetSocketAddress *KInetInterface::getPublicInetAddress() {
- QValueVector<KInetInterface> v = getAllInterfaces(true);
+ TQValueVector<KInetInterface> v = getAllInterfaces(true);
// TODO: first step: take the default route interface
// try to find point-2-point interface, because it may be
// a dial-up connection. Take it.
- QValueVector<KInetInterface>::const_iterator it = v.begin();
+ TQValueVector<KInetInterface>::const_iterator it = v.begin();
while (it != v.end()) {
if (((*it).flags() & (PointToPoint | Up | Running)) &&
(!((*it).flags() & Loopback)) &&
@@ -247,10 +247,10 @@ namespace {
}
}
-QValueVector<KInetInterface> KInetInterface::getAllInterfaces(bool includeLoopback) {
+TQValueVector<KInetInterface> KInetInterface::getAllInterfaces(bool includeLoopback) {
struct kde_ifaddrs *ads;
struct kde_ifaddrs *a;
- QValueVector<KInetInterface> r;
+ TQValueVector<KInetInterface> r;
if (kde_getifaddrs(&ads))
return r;
@@ -260,7 +260,7 @@ QValueVector<KInetInterface> KInetInterface::getAllInterfaces(bool includeLoopba
a = a->ifa_next;
continue;
}
- r.push_back(KInetInterface(QString::fromUtf8(a->ifa_name),
+ r.push_back(KInetInterface(TQString::fromUtf8(a->ifa_name),
convertFlags(a->ifa_flags),
createAddress(a->ifa_addr),
createAddress(a->ifa_netmask),
diff --git a/krfb/srvloc/kinetinterface.h b/krfb/srvloc/kinetinterface.h
index fe3899cb..e3f0328b 100644
--- a/krfb/srvloc/kinetinterface.h
+++ b/krfb/srvloc/kinetinterface.h
@@ -22,9 +22,9 @@
#ifndef KINETINTERFACE_H
#define KINETINTERFACE_H
-#include <qvaluevector.h>
-#include <qcstring.h>
-#include <qstring.h>
+#include <tqvaluevector.h>
+#include <tqcstring.h>
+#include <tqstring.h>
class KInetInterfacePrivate;
@@ -48,7 +48,7 @@ class KInetSocketAddress;
*/
class KInetInterface {
private:
- KInetInterface(const QString &name,
+ KInetInterface(const TQString &name,
int flags,
KInetSocketAddress *address,
KInetSocketAddress *netmask,
@@ -93,14 +93,14 @@ public:
* @return the display name of the interface
* @see name()
*/
- QString displayName() const;
+ TQString displayName() const;
/**
* Returns the name of the interface, e.g. 'eth0'.
* @return the name of the interface
* @see displayName()
*/
- QString name() const;
+ TQString name() const;
/**
* Flags describing the interface. These flags
@@ -177,7 +177,7 @@ public:
* name
* @return the list of IP addresses
*/
- static QValueVector<KInetInterface> getAllInterfaces(bool includeLoopback = false);
+ static TQValueVector<KInetInterface> getAllInterfaces(bool includeLoopback = false);
private:
KInetInterfacePrivate* d;
diff --git a/krfb/srvloc/kinetinterfacewatcher.cpp b/krfb/srvloc/kinetinterfacewatcher.cpp
index 02f21c6c..1e0fa8e6 100644
--- a/krfb/srvloc/kinetinterfacewatcher.cpp
+++ b/krfb/srvloc/kinetinterfacewatcher.cpp
@@ -25,11 +25,11 @@
class KInetInterfaceWatcherPrivate {
public:
- QString interface;
+ TQString interface;
int minInterval; // not used yet, but my be when a daemon watches
- KInetInterfaceWatcherPrivate(const QString &iface,
+ KInetInterfaceWatcherPrivate(const TQString &iface,
int minIntv) :
interface(iface),
minInterval(minIntv) {
@@ -39,17 +39,17 @@ public:
/*
* or all network interfaces.
* @param interface the name of the interface to watch (e.g.'eth0')
- * or QString::null to watch all interfaces
+ * or TQString::null to watch all interfaces
* @param minInterval the minimum interval between two checks in
* seconds. Be careful not to check too often, to
* avoid unneccessary wasting of CPU time
*/
-KInetInterfaceWatcher::KInetInterfaceWatcher(const QString &interface,
+KInetInterfaceWatcher::KInetInterfaceWatcher(const TQString &interface,
int minInterval) {
d = new KInetInterfaceWatcherPrivate(interface, minInterval);
}
-QString KInetInterfaceWatcher::interface() const {
+TQString KInetInterfaceWatcher::interface() const {
return d->interface;
}
diff --git a/krfb/srvloc/kinetinterfacewatcher.h b/krfb/srvloc/kinetinterfacewatcher.h
index 399aa3fc..75d72ef8 100644
--- a/krfb/srvloc/kinetinterfacewatcher.h
+++ b/krfb/srvloc/kinetinterfacewatcher.h
@@ -23,10 +23,10 @@
#define KINETINTERFACEWATCHER_H
#include <kinetinterface.h>
-#include <qobject.h>
-#include <qvaluevector.h>
-#include <qcstring.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqvaluevector.h>
+#include <tqcstring.h>
+#include <tqstring.h>
class KInetInterfaceWatcherPrivate;
@@ -43,7 +43,7 @@ class KInetInterfaceWatcherPrivate;
* @see KInetInterface
* @since 3.2
*/
-class KInetInterfaceWatcher : public QObject {
+class KInetInterfaceWatcher : public TQObject {
Q_OBJECT
public:
/**
@@ -51,34 +51,34 @@ public:
* you must @ref start() it.
*
* @param interface the name of the interface to watch (e.g.'eth0')
- * or QString::null to watch all interfaces
+ * or TQString::null to watch all interfaces
* @param minInterval the minimum interval between two checks in
* seconds. Be careful not to check too often, to
* avoid unneccessary wasting of CPU time
*/
- KInetInterfaceWatcher(const QString &interface = QString::null,
+ KInetInterfaceWatcher(const TQString &interface = TQString::null,
int minInterval = 60);
/**
* Returns the name of the interface that is being watched.
- * @return the name of the interface, or QString::null if all
+ * @return the name of the interface, or TQString::null if all
* interfaces are watched
*/
- QString interface() const;
+ TQString interface() const;
/**
* Starts the KInetInterfaceWatcher. It watches either one
* or all network interfaces. When one of them changed.
* it emits a @ref changed() signal.
* @param interface the name of the interface to watch (e.g.'eth0')
- * or QString::null to watch all interfaces
+ * or TQString::null to watch all interfaces
* @param minInterval the minimum interval between two checks in
* seconds. Be careful not to check too often, to
* avoid unneccessary wasting of CPU time
* @see changed()
* @see stop()
*/
- void start(const QString &interface = QString::null,
+ void start(const TQString &interface = TQString::null,
int minInterval = 60);
/**
@@ -109,11 +109,11 @@ signals:
* address has changed.
*
* @param interfaceName the name of the interface that is watched,
- * by the emitter, or QString::null if all
+ * by the emitter, or TQString::null if all
* interfaces are being watched
* @see start()
*/
- void changed(QString interfaceName);
+ void changed(TQString interfaceName);
private:
KInetInterfaceWatcherPrivate* d;
diff --git a/krfb/srvloc/kserviceregistry.cpp b/krfb/srvloc/kserviceregistry.cpp
index 49e3de15..f8ab6b51 100644
--- a/krfb/srvloc/kserviceregistry.cpp
+++ b/krfb/srvloc/kserviceregistry.cpp
@@ -31,14 +31,14 @@
class KServiceRegistryPrivate {
public:
- KServiceRegistryPrivate(const QString &lang) :
+ KServiceRegistryPrivate(const TQString &lang) :
m_opened(false),
m_lang(lang) {
}
bool ensureOpen();
bool m_opened;
- QString m_lang;
+ TQString m_lang;
SLPHandle m_handle;
friend void KServiceRegistryRegReport(SLPHandle slp,
@@ -57,7 +57,7 @@ void KServiceRegistryRegReport(SLPHandle,
}
-KServiceRegistry::KServiceRegistry(const QString &lang) {
+KServiceRegistry::KServiceRegistry(const TQString &lang) {
d = new KServiceRegistryPrivate(lang);
}
@@ -86,8 +86,8 @@ bool KServiceRegistry::available() {
return d->ensureOpen();
}
-bool KServiceRegistry::registerService(const QString &serviceURL,
- QString attributes,
+bool KServiceRegistry::registerService(const TQString &serviceURL,
+ TQString attributes,
unsigned short lifetime) {
if (!d->ensureOpen())
return false;
@@ -108,24 +108,24 @@ bool KServiceRegistry::registerService(const QString &serviceURL,
return d->m_cbSuccess;
}
-bool KServiceRegistry::registerService(const QString &serviceURL,
- QMap<QString,QString> attributes,
+bool KServiceRegistry::registerService(const TQString &serviceURL,
+ TQMap<TQString,TQString> attributes,
unsigned short lifetime) {
if (!d->ensureOpen())
return false;
// TODO: encode strings in map?
- QString s;
- QMap<QString,QString>::iterator it = attributes.begin();
+ TQString s;
+ TQMap<TQString,TQString>::iterator it = attributes.begin();
while (it != attributes.end()) {
if (!s.isEmpty())
s += ",";
- s += QString("(%1=%2)").arg(it.key()).arg(it.data());
+ s += TQString("(%1=%2)").arg(it.key()).arg(it.data());
it++;
}
return registerService(serviceURL, s, lifetime);
}
-void KServiceRegistry::unregisterService(const QString &serviceURL) {
+void KServiceRegistry::unregisterService(const TQString &serviceURL) {
if (!d->m_opened)
return;
SLPDereg(d->m_handle, serviceURL.latin1(),
@@ -133,19 +133,19 @@ void KServiceRegistry::unregisterService(const QString &serviceURL) {
d);
}
-QString KServiceRegistry::encodeAttributeValue(const QString &value) {
+TQString KServiceRegistry::encodeAttributeValue(const TQString &value) {
char *n;
if (SLPEscape(value.latin1(), &n, SLP_TRUE) == SLP_OK) {
- QString r(n);
+ TQString r(n);
SLPFree(n);
return r;
}
- return QString::null;
+ return TQString::null;
}
#else
-KServiceRegistry::KServiceRegistry(const QString &lang) :
+KServiceRegistry::KServiceRegistry(const TQString &lang) :
d(0) {
}
@@ -156,24 +156,24 @@ bool KServiceRegistry::available() {
return false;
}
-bool KServiceRegistry::registerService(const QString &, QString, unsigned short ) {
+bool KServiceRegistry::registerService(const TQString &, TQString, unsigned short ) {
return false;
}
-bool KServiceRegistry::registerService(const QString &, QMap<QString,QString>, unsigned short) {
+bool KServiceRegistry::registerService(const TQString &, TQMap<TQString,TQString>, unsigned short) {
return false;
}
-void KServiceRegistry::unregisterService(const QString &) {
+void KServiceRegistry::unregisterService(const TQString &) {
}
-QString KServiceRegistry::encodeAttributeValue(const QString &value) {
+TQString KServiceRegistry::encodeAttributeValue(const TQString &value) {
return value;
}
#endif
-QString KServiceRegistry::createCommaList(const QStringList &values) {
+TQString KServiceRegistry::createCommaList(const TQStringList &values) {
return values.join(",");
}
diff --git a/krfb/srvloc/kserviceregistry.h b/krfb/srvloc/kserviceregistry.h
index a1c439ae..8cd965e6 100644
--- a/krfb/srvloc/kserviceregistry.h
+++ b/krfb/srvloc/kserviceregistry.h
@@ -25,9 +25,9 @@
#ifndef __KSERVICEREGISTRY_H
#define __KSERVICEREGISTRY_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
class KServiceRegistryPrivate;
@@ -78,7 +78,7 @@ class KServiceRegistryPrivate;
* <pre>
* KServiceRegistry ksr;
* KInetAddress kia = KInetAddress->getLocalAddress();
- * ksr.registerService(QString("service:remotedesktop.kde:vnc://%1:0").arg(kia->nodeName()),
+ * ksr.registerService(TQString("service:remotedesktop.kde:vnc://%1:0").arg(kia->nodeName()),
* "(type=shared)");
* delete kia;
* </pre>
@@ -91,10 +91,10 @@ class KServiceRegistry {
/**
* Creates a new service registration instance for the given
* language.
- * @param lang the language as two letter code, or QString::null for the
+ * @param lang the language as two letter code, or TQString::null for the
* system default
*/
- KServiceRegistry(const QString &lang = QString::null);
+ KServiceRegistry(const TQString &lang = TQString::null);
virtual ~KServiceRegistry();
/**
@@ -110,17 +110,17 @@ class KServiceRegistry {
* @param map the items of this list will be converted
* @return the comma-separated list
*/
- static QString createCommaList(const QStringList &values);
+ static TQString createCommaList(const TQStringList &values);
/**
- * Encodes an QString for use as a attribute value. This will escape
+ * Encodes an TQString for use as a attribute value. This will escape
* all characters that are not allowed. This method is only available
* when a SLP library is available, otherwise it will return the
* given value.
* @param value the value string to encode
* @return the encoded value string
*/
- static QString encodeAttributeValue(const QString &value);
+ static TQString encodeAttributeValue(const TQString &value);
/**
* Registers the given service.
@@ -132,8 +132,8 @@ class KServiceRegistry {
* @return true if successful, false otherwise. False usually means that no
* SA daemon (slpd) is running.
*/
- bool registerService(const QString &serviceURL,
- QString attributes = QString::null,
+ bool registerService(const TQString &serviceURL,
+ TQString attributes = TQString::null,
unsigned short lifetime = 0);
/**
@@ -144,15 +144,15 @@ class KServiceRegistry {
* @return true if successful, false otherwise. False usually means that no
* SA daemon is running (slpd).
*/
- bool registerService(const QString &serviceURL,
- QMap<QString,QString> attributes,
+ bool registerService(const TQString &serviceURL,
+ TQMap<TQString,TQString> attributes,
unsigned short lifetime = 0);
/**
* Unregisters the given service.
* @param serviceURL the service URL to unregister
*/
- void unregisterService(const QString &serviceURL);
+ void unregisterService(const TQString &serviceURL);
private:
KServiceRegistryPrivate *d;
diff --git a/krfb/srvloc/uuid.cpp b/krfb/srvloc/uuid.cpp
index 61f78d86..931f0aa8 100644
--- a/krfb/srvloc/uuid.cpp
+++ b/krfb/srvloc/uuid.cpp
@@ -235,11 +235,11 @@ static void uuid_unparse(const uuid_t uu, char *out)
uuid.node[3], uuid.node[4], uuid.node[5]);
}
-QString createUUID() {
+TQString createUUID() {
char s[37];
uuid_t uu;
uuid_generate_time(uu);
uuid_unparse(uu, s);
- return QString(s);
+ return TQString(s);
}
diff --git a/krfb/srvloc/uuid.h b/krfb/srvloc/uuid.h
index d63f2cf5..eed91de5 100644
--- a/krfb/srvloc/uuid.h
+++ b/krfb/srvloc/uuid.h
@@ -22,8 +22,8 @@
#ifndef UUID_H
#define UUID_H
-#include <qstring.h>
+#include <tqstring.h>
-QString createUUID();
+TQString createUUID();
#endif /* UUID_H */