diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /atlantik/client/monopigator.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'atlantik/client/monopigator.cpp')
-rw-r--r-- | atlantik/client/monopigator.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/atlantik/client/monopigator.cpp b/atlantik/client/monopigator.cpp index 83ef0d42..7e0a834d 100644 --- a/atlantik/client/monopigator.cpp +++ b/atlantik/client/monopigator.cpp @@ -14,9 +14,9 @@ // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301, USA. -#include <qdom.h> -#include <qptrlist.h> -#include <qregexp.h> +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqregexp.h> #include <kextendedsocket.h> @@ -41,25 +41,25 @@ Monopigator::~Monopigator() void Monopigator::loadData(const KURL &url) { delete m_downloadData; - m_downloadData = new QBuffer(); + m_downloadData = new TQBuffer(); m_downloadData->open(IO_WriteOnly); m_downloadData->reset(); m_job = KIO::get(url, true, false); - m_job->addMetaData(QString::fromLatin1("UserAgent"), QString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); + m_job->addMetaData(TQString::fromLatin1("UserAgent"), TQString::fromLatin1("Atlantik/" ATLANTIK_VERSION_STRING)); if (!m_timer) { - m_timer = new QTimer(this); + m_timer = new TQTimer(this); m_timer->start(10000, true); } - connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)), SLOT(slotData(KIO::Job *, const QByteArray &))); - connect(m_job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *))); - connect(m_timer, SIGNAL(timeout()), SLOT(slotTimeout())); + connect(m_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), TQT_SLOT(slotData(KIO::Job *, const TQByteArray &))); + connect(m_job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *))); + connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); } -void Monopigator::slotData(KIO::Job *, const QByteArray &data) +void Monopigator::slotData(KIO::Job *, const TQByteArray &data) { m_timer->stop(); m_downloadData->writeBlock(data.data(), data.size()); @@ -80,26 +80,26 @@ void Monopigator::slotTimeout() emit timeout(); } -void Monopigator::processData(const QByteArray &data, bool okSoFar) +void Monopigator::processData(const TQByteArray &data, bool okSoFar) { if (okSoFar) { - QString xmlData(data); - QDomDocument domDoc; + TQString xmlData(data); + TQDomDocument domDoc; if (domDoc.setContent(xmlData)) { - QDomElement eTop = domDoc.documentElement(); + TQDomElement eTop = domDoc.documentElement(); if (eTop.tagName() != "monopigator") return; - QDomNode n = eTop.firstChild(); + TQDomNode n = eTop.firstChild(); while(!n.isNull()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if(!e.isNull()) { if (e.tagName() == "server") - emit monopigatorAdd(e.attributeNode(QString("ip")).value(), e.attributeNode(QString("host")).value(), e.attributeNode(QString("port")).value(), e.attributeNode(QString("version")).value(), e.attributeNode(QString("users")).value().toInt()); + emit monopigatorAdd(e.attributeNode(TQString("ip")).value(), e.attributeNode(TQString("host")).value(), e.attributeNode(TQString("port")).value(), e.attributeNode(TQString("version")).value(), e.attributeNode(TQString("users")).value().toInt()); } n = n.nextSibling(); } @@ -108,9 +108,9 @@ void Monopigator::processData(const QByteArray &data, bool okSoFar) } } -MonopigatorEntry::MonopigatorEntry(QListView *parent, QString host, QString latency, QString version, QString users, QString port, QString ip) : QObject(), QListViewItem(parent, host, latency, version, users, port) +MonopigatorEntry::MonopigatorEntry(TQListView *parent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(parent, host, latency, version, users, port) { - m_isDev = ( version.find( QRegExp("(CVS|-dev)") ) != -1 ) ? true : false; + m_isDev = ( version.find( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; setEnabled(false); parent->sort(); @@ -118,8 +118,8 @@ MonopigatorEntry::MonopigatorEntry(QListView *parent, QString host, QString late if ( !ip.isEmpty() ) host = ip; m_latencySocket = new KExtendedSocket( host, port.toInt(), KExtendedSocket::inputBufferedSocket | KExtendedSocket::noResolve ); - connect(m_latencySocket, SIGNAL(lookupFinished(int)), this, SLOT(resolved())); - connect(m_latencySocket, SIGNAL(connectionSuccess()), this, SLOT(connected())); + connect(m_latencySocket, TQT_SIGNAL(lookupFinished(int)), this, TQT_SLOT(resolved())); + connect(m_latencySocket, TQT_SIGNAL(connectionSuccess()), this, TQT_SLOT(connected())); m_latencySocket->startAsyncConnect(); } @@ -130,13 +130,13 @@ void MonopigatorEntry::resolved() void MonopigatorEntry::connected() { - setText( 1, QString::number(time.elapsed()) ); + setText( 1, TQString::number(time.elapsed()) ); setEnabled(true); listView()->sort(); delete m_latencySocket; } -int MonopigatorEntry::compare(QListViewItem *i, int col, bool ascending) const +int MonopigatorEntry::compare(TQListViewItem *i, int col, bool ascending) const { // Colums 1 and 3 are integers (latency and users) if (col == 1 || col == 3) |