From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: TQt4 port kdegames This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkdegames/kgame/kgamepropertyhandler.cpp | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'libkdegames/kgame/kgamepropertyhandler.cpp') diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp index f395fc66..32e831d8 100644 --- a/libkdegames/kgame/kgamepropertyhandler.cpp +++ b/libkdegames/kgame/kgamepropertyhandler.cpp @@ -51,13 +51,13 @@ public: TQPtrQueue mSignalQueue; }; -KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent) +KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* tqparent) : TQObject(tqparent) { init(); registerHandler(id,receiver,sendf,emitf); } -KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent) +KGamePropertyHandler::KGamePropertyHandler(TQObject* tqparent) : TQObject(tqparent) { init(); } @@ -117,7 +117,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS int cmd; KGameMessage::extractPropertyCommand(stream, propertyId, cmd); //kdDebug(11001) << k_funcinfo << ": Got COMMAND for id= "<mIdDict.find(propertyId); + p = d->mIdDict.tqfind(propertyId); if (p) { if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { p->command(stream, cmd, isSender); @@ -127,7 +127,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS } return true; } - p = d->mIdDict.find(propertyId); + p = d->mIdDict.tqfind(propertyId); if (p) { //kdDebug(11001) << k_funcinfo << ": Loading " << propertyId << endl; if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { @@ -151,7 +151,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data) bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) { //kdDebug(11001) << k_funcinfo << ": " << data->id() << endl; - if (d->mIdDict.find(data->id())) { + if (d->mIdDict.tqfind(data->id())) { // this id already exists kdError(11001) << " -> cannot add property " << data->id() << endl; return false; @@ -172,15 +172,15 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) TQString KGamePropertyHandler::propertyName(int id) const { TQString s; - if (d->mIdDict.find(id)) { - if (d->mNameMap.contains(id)) { - s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id); + if (d->mIdDict.tqfind(id)) { + if (d->mNameMap.tqcontains(id)) { + s = i18n("%1 (%2)").tqarg(d->mNameMap[id]).tqarg(id); } else { - s = i18n("Unnamed - ID: %1").arg(id); + s = i18n("Unnamed - ID: %1").tqarg(id); } } else { // Should _never_ happen - s = i18n("%1 unregistered").arg(id); + s = i18n("%1 unregistered").tqarg(id); } return s; } @@ -195,7 +195,7 @@ bool KGamePropertyHandler::load(TQDataStream &stream) for (i = 0; i < count; i++) { processMessage(stream, id(),false); } - Q_INT16 cookie; + TQ_INT16 cookie; stream >> cookie; if (cookie == KPLAYERHANDLER_LOAD_COOKIE) { kdDebug(11001) << " KGamePropertyHandler loaded propertly"<mIdDict.find(id); + return d->mIdDict.tqfind(id); } void KGamePropertyHandler::clear() @@ -338,7 +338,7 @@ void KGamePropertyHandler::clear() while (it.toFirst()) { KGamePropertyBase* p = it.toFirst(); p->unregisterData(); - if (d->mIdDict.find(p->id())) { + if (d->mIdDict.tqfind(p->id())) { // shouldn't happen - but if mOwner in KGamePropertyBase is NULL // this might be possible removeProperty(p); @@ -371,8 +371,8 @@ TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) } else if (*t == typeid(unsigned long int)) { value = TQString::number(((KGameProperty *)prop)->value()); } else if (*t == typeid(TQString)) { - value = ((KGamePropertyQString*)prop)->value(); - } else if (*t == typeid(Q_INT8)) { + value = ((KGamePropertyTQString*)prop)->value(); + } else if (*t == typeid(TQ_INT8)) { value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False"); } else { emit signalRequestValue(prop, value); -- cgit v1.2.1