summaryrefslogtreecommitdiffstats
path: root/libkdegames/kgame/kgamechat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdegames/kgame/kgamechat.cpp')
-rw-r--r--libkdegames/kgame/kgamechat.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/libkdegames/kgame/kgamechat.cpp b/libkdegames/kgame/kgamechat.cpp
index 16ec7c18..ddc1bd66 100644
--- a/libkdegames/kgame/kgamechat.cpp
+++ b/libkdegames/kgame/kgamechat.cpp
@@ -29,8 +29,8 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qmap.h>
-#include <qintdict.h>
+#include <tqmap.h>
+#include <tqintdict.h>
//FIXME:
#define FIRST_ID 2 // first id, that is free of use, aka not defined above
@@ -51,24 +51,24 @@ public:
int mMessageId;
- QIntDict<KPlayer> mIndex2Player;
+ TQIntDict<KPlayer> mIndex2Player;
- QMap<int, int> mSendId2PlayerId;
+ TQMap<int, int> mSendId2PlayerId;
int mToMyGroup; // just as the above - but for the group, not for players
};
-KGameChat::KGameChat(KGame* g, int msgid, QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, TQWidget* parent) : KChatBase(parent)
{
init(g, msgid);
}
-KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* parent) : KChatBase(parent)
{
init(g, msgid);
setFromPlayer(fromPlayer);
}
-KGameChat::KGameChat(QWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(TQWidget* parent) : KChatBase(parent)
{
init(0, -1);
}
@@ -88,7 +88,7 @@ void KGameChat::init(KGame* g, int msgId)
setKGame(g);
}
-void KGameChat::addMessage(int fromId, const QString& text)
+void KGameChat::addMessage(int fromId, const TQString& text)
{
if (!d->mGame) {
kdWarning(11001) << "no KGame object has been set" << endl;
@@ -105,7 +105,7 @@ void KGameChat::addMessage(int fromId, const QString& text)
}
}
-void KGameChat::returnPressed(const QString& text)
+void KGameChat::returnPressed(const TQString& text)
{
if (!d->mFromPlayer) {
kdWarning(11001) << k_funcinfo << ": You must set a player first!" << endl;
@@ -123,7 +123,7 @@ void KGameChat::returnPressed(const QString& text)
if (isToGroupMessage(id)) {
// note: there is currently no support for other groups than the players
// group! It might be useful to send to other groups, too
- QString group = d->mFromPlayer->group();
+ TQString group = d->mFromPlayer->group();
kdDebug(11001) << "send to group " << group << endl;
int sender = d->mFromPlayer->id();
d->mGame->sendGroupMessage(text, messageId(), sender, group);
@@ -164,7 +164,7 @@ bool KGameChat::isToPlayerMessage(int id) const
{
return d->mSendId2PlayerId.contains(id); }
-QString KGameChat::sendToPlayerEntry(const QString& name) const
+TQString KGameChat::sendToPlayerEntry(const TQString& name) const
{ return i18n("Send to %1").arg(name); }
int KGameChat::playerId(int id) const
@@ -178,7 +178,7 @@ int KGameChat::playerId(int id) const
int KGameChat::sendingId(int playerId) const
{
- QMap<int, int>::Iterator it;
+ TQMap<int, int>::Iterator it;
for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) {
if (it.data() == playerId) {
return it.key();
@@ -187,8 +187,8 @@ int KGameChat::sendingId(int playerId) const
return -1;
}
-const QString& KGameChat::fromName() const
-{ return d->mFromPlayer ? d->mFromPlayer->name() : QString::null; }
+const TQString& KGameChat::fromName() const
+{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString::null; }
bool KGameChat::hasPlayer(int id) const
{
@@ -227,15 +227,15 @@ void KGameChat::setKGame(KGame* g)
d->mGame = g;
if (d->mGame) {
- connect(d->mGame, SIGNAL(signalPlayerJoinedGame(KPlayer*)),
- this, SLOT(slotAddPlayer(KPlayer*)));
- connect(d->mGame, SIGNAL(signalPlayerLeftGame(KPlayer*)),
- this, SLOT(slotRemovePlayer(KPlayer*)));
- connect(d->mGame, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, Q_UINT32)),
- this, SLOT(slotReceiveMessage(int, const QByteArray&, Q_UINT32, Q_UINT32)));
- connect(d->mGame, SIGNAL(destroyed()), this, SLOT(slotUnsetKGame()));
-
- QPtrList<KPlayer> playerList = *d->mGame->playerList();
+ connect(d->mGame, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer*)),
+ this, TQT_SLOT(slotAddPlayer(KPlayer*)));
+ connect(d->mGame, TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)),
+ this, TQT_SLOT(slotRemovePlayer(KPlayer*)));
+ connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, Q_UINT32)),
+ this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
+
+ TQPtrList<KPlayer> playerList = *d->mGame->playerList();
for (int unsigned i = 0; i < playerList.count(); i++) {
slotAddPlayer(playerList.at(i));
}
@@ -261,7 +261,7 @@ void KGameChat::slotUnsetKGame()
}
disconnect(d->mGame, 0, this, 0);
removeSendingEntry(d->mToMyGroup);
- QMap<int, int>::Iterator it;
+ TQMap<int, int>::Iterator it;
for (it = d->mSendId2PlayerId.begin(); it != d->mSendId2PlayerId.end(); ++it) {
removeSendingEntry(it.data());
}
@@ -281,10 +281,10 @@ void KGameChat::slotAddPlayer(KPlayer* p)
int sendingId = nextId();
addSendingEntry(comboBoxItem(p->name()), sendingId);
d->mSendId2PlayerId.insert(sendingId, p->id());
- connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
- connect(p, SIGNAL(signalNetworkData(int, const QByteArray&, Q_UINT32, KPlayer*)),
- this, SLOT(slotReceivePrivateMessage(int, const QByteArray&, Q_UINT32, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, KPlayer*)),
+ this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, Q_UINT32, KPlayer*)));
}
void KGameChat::slotRemovePlayer(KPlayer* p)
@@ -317,7 +317,7 @@ void KGameChat::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player)
}
}
-void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q_UINT32 sender, KPlayer* me)
+void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me)
{
if (!me || me != fromPlayer()) {
kdDebug() << k_funcinfo << "nope - not for us!" << endl;
@@ -326,14 +326,14 @@ void KGameChat::slotReceivePrivateMessage(int msgid, const QByteArray& buffer, Q
slotReceiveMessage(msgid, buffer, me->id(), sender);
}
-void KGameChat::slotReceiveMessage(int msgid, const QByteArray& buffer, Q_UINT32 , Q_UINT32 sender)
+void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, Q_UINT32 , Q_UINT32 sender)
{
- QDataStream msg(buffer, IO_ReadOnly);
+ TQDataStream msg(buffer, IO_ReadOnly);
if (msgid != messageId()) {
return;
}
- QString text;
+ TQString text;
msg >> text;
addMessage(sender, text);