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 /libkdegames/kgame/kgamepropertyhandler.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 'libkdegames/kgame/kgamepropertyhandler.cpp')
-rw-r--r-- | libkdegames/kgame/kgamepropertyhandler.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp index 75b3e7e2..f395fc66 100644 --- a/libkdegames/kgame/kgamepropertyhandler.cpp +++ b/libkdegames/kgame/kgamepropertyhandler.cpp @@ -25,8 +25,8 @@ #include "kgameproperty.h" #include "kgamemessage.h" -#include <qmap.h> -#include <qptrqueue.h> +#include <tqmap.h> +#include <tqptrqueue.h> #include <klocale.h> #include <typeinfo> @@ -41,23 +41,23 @@ public: { } - QMap<int, QString> mNameMap; - QIntDict<KGamePropertyBase> mIdDict; + TQMap<int, TQString> mNameMap; + TQIntDict<KGamePropertyBase> mIdDict; int mUniqueId; int mId; KGamePropertyBase::PropertyPolicy mDefaultPolicy; bool mDefaultUserspace; int mIndirectEmit; - QPtrQueue<KGamePropertyBase> mSignalQueue; + TQPtrQueue<KGamePropertyBase> mSignalQueue; }; -KGamePropertyHandler::KGamePropertyHandler(int id, const QObject* receiver, const char * sendf, const char *emitf, QObject* parent) : QObject(parent) +KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent) { init(); registerHandler(id,receiver,sendf,emitf); } -KGamePropertyHandler::KGamePropertyHandler(QObject* parent) : QObject(parent) +KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent) { init(); } @@ -90,20 +90,20 @@ void KGamePropertyHandler::setId(int id) d->mId = id; } -void KGamePropertyHandler::registerHandler(int id,const QObject * receiver, const char * sendf, const char *emitf) +void KGamePropertyHandler::registerHandler(int id,const TQObject * receiver, const char * sendf, const char *emitf) { setId(id); if (receiver && sendf) { - kdDebug(11001) << "Connecting SLOT " << sendf << endl; - connect(this, SIGNAL(signalSendMessage(int, QDataStream &, bool*)), receiver, sendf); + kdDebug(11001) << "Connecting TQT_SLOT " << sendf << endl; + connect(this, TQT_SIGNAL(signalSendMessage(int, TQDataStream &, bool*)), receiver, sendf); } if (receiver && emitf) { - kdDebug(11001) << "Connecting SLOT " << emitf << endl; - connect(this, SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf); + kdDebug(11001) << "Connecting TQT_SLOT " << emitf << endl; + connect(this, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *)), receiver, emitf); } } -bool KGamePropertyHandler::processMessage(QDataStream &stream, int id, bool isSender) +bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isSender) { // kdDebug(11001) << k_funcinfo << ": id=" << id << " mId=" << d->mId << endl; if (id != d->mId) { @@ -148,7 +148,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data) return d->mIdDict.remove(data->id()); } -bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name) +bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) { //kdDebug(11001) << k_funcinfo << ": " << data->id() << endl; if (d->mIdDict.find(data->id())) { @@ -169,9 +169,9 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, QString name) return true; } -QString KGamePropertyHandler::propertyName(int id) const +TQString KGamePropertyHandler::propertyName(int id) const { - QString s; + TQString s; if (d->mIdDict.find(id)) { if (d->mNameMap.contains(id)) { s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id); @@ -185,7 +185,7 @@ QString KGamePropertyHandler::propertyName(int id) const return s; } -bool KGamePropertyHandler::load(QDataStream &stream) +bool KGamePropertyHandler::load(TQDataStream &stream) { // Prevent direct emmiting until all is loaded lockDirectEmit(); @@ -207,11 +207,11 @@ bool KGamePropertyHandler::load(QDataStream &stream) return true; } -bool KGamePropertyHandler::save(QDataStream &stream) +bool KGamePropertyHandler::save(TQDataStream &stream) { kdDebug(11001) << k_funcinfo << ": " << d->mIdDict.count() << " KGameProperty objects " << endl; stream << (uint)d->mIdDict.count(); - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { KGamePropertyBase *base=it.current(); if (base) { @@ -234,7 +234,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us // kdDebug(11001) << k_funcinfo << ": " << p << endl; d->mDefaultPolicy=p; d->mDefaultUserspace=userspace; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { if (!userspace || it.current()->id()>=KGamePropertyBase::IdUser) { it.current()->setPolicy((KGamePropertyBase::PropertyPolicy)p); @@ -245,7 +245,7 @@ void KGamePropertyHandler::setPolicy(KGamePropertyBase::PropertyPolicy p,bool us void KGamePropertyHandler::unlockProperties() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { it.current()->unlock(); ++it; @@ -254,7 +254,7 @@ void KGamePropertyHandler::unlockProperties() void KGamePropertyHandler::lockProperties() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { it.current()->lock(); ++it; @@ -268,7 +268,7 @@ int KGamePropertyHandler::uniquePropertyId() void KGamePropertyHandler::flush() { - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { if (it.current()->isDirty()) { it.current()->sendProperty(); @@ -319,7 +319,7 @@ void KGamePropertyHandler::emitSignal(KGamePropertyBase *prop) } } -bool KGamePropertyHandler::sendProperty(QDataStream &s) +bool KGamePropertyHandler::sendProperty(TQDataStream &s) { bool sent = false; emit signalSendMessage(id(), s, &sent); @@ -334,7 +334,7 @@ KGamePropertyBase *KGamePropertyHandler::find(int id) void KGamePropertyHandler::clear() { kdDebug(11001) << k_funcinfo << id() << endl; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.toFirst()) { KGamePropertyBase* p = it.toFirst(); p->unregisterData(); @@ -346,31 +346,31 @@ void KGamePropertyHandler::clear() } } -QIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const +TQIntDict<KGamePropertyBase>& KGamePropertyHandler::dict() const { return d->mIdDict; } -QString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) +TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop) { if (!prop) { return i18n("NULL pointer"); } int id = prop->id(); - QString name = propertyName(id); - QString value; + TQString name = propertyName(id); + TQString value; const type_info* t = prop->typeinfo(); if (*t == typeid(int)) { - value = QString::number(((KGamePropertyInt*)prop)->value()); + value = TQString::number(((KGamePropertyInt*)prop)->value()); } else if (*t == typeid(unsigned int)) { - value = QString::number(((KGamePropertyUInt *)prop)->value()); + value = TQString::number(((KGamePropertyUInt *)prop)->value()); } else if (*t == typeid(long int)) { - value = QString::number(((KGameProperty<long int> *)prop)->value()); + value = TQString::number(((KGameProperty<long int> *)prop)->value()); } else if (*t == typeid(unsigned long int)) { - value = QString::number(((KGameProperty<unsigned long int> *)prop)->value()); - } else if (*t == typeid(QString)) { + value = TQString::number(((KGameProperty<unsigned long int> *)prop)->value()); + } else if (*t == typeid(TQString)) { value = ((KGamePropertyQString*)prop)->value(); } else if (*t == typeid(Q_INT8)) { value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False"); @@ -390,7 +390,7 @@ void KGamePropertyHandler::Debug() kdDebug(11001) << "KGamePropertyHandler:: Debug this=" << this << endl; kdDebug(11001) << " Registered properties: (Policy,Lock,Emit,Optimized, Dirty)" << endl; - QIntDictIterator<KGamePropertyBase> it(d->mIdDict); + TQIntDictIterator<KGamePropertyBase> it(d->mIdDict); while (it.current()) { KGamePropertyBase *p=it.current(); kdDebug(11001) << " "<< p->id() << ": p=" << p->policy() |