diff options
Diffstat (limited to 'libkdegames/kgame/kgamepropertyarray.h')
-rw-r--r-- | libkdegames/kgame/kgamepropertyarray.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/libkdegames/kgame/kgamepropertyarray.h b/libkdegames/kgame/kgamepropertyarray.h index f91bd75c..0bb1d1a1 100644 --- a/libkdegames/kgame/kgamepropertyarray.h +++ b/libkdegames/kgame/kgamepropertyarray.h @@ -21,7 +21,7 @@ #ifndef __KGAMEPROPERTYARRAY_H_ #define __KGAMEPROPERTYARRAY_H_ -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> #include "kgamemessage.h" @@ -30,10 +30,10 @@ template<class type> -class KGamePropertyArray : public QMemArray<type>, public KGamePropertyBase +class KGamePropertyArray : public TQMemArray<type>, public KGamePropertyBase { public: - KGamePropertyArray() :QMemArray<type>(), KGamePropertyBase() + KGamePropertyArray() :TQMemArray<type>(), KGamePropertyBase() { //kdDebug(11001) << "KGamePropertyArray init" << endl; } @@ -43,17 +43,17 @@ public: resize(size); } - KGamePropertyArray( const KGamePropertyArray<type> &a ) : QMemArray<type>(a) + KGamePropertyArray( const KGamePropertyArray<type> &a ) : TQMemArray<type>(a) { } bool resize( uint size ) { - if (size!=QMemArray<type>::size()) + if (size!=TQMemArray<type>::size()) { bool a=true; - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdResize); s << size ; if (policy()==PolicyClean || policy()==PolicyDirty) @@ -66,7 +66,7 @@ public: if (policy()==PolicyLocal || policy()==PolicyDirty) { extractProperty(b); -// a=QMemArray<type>::resize(size);// FIXME: return value! +// a=TQMemArray<type>::resize(size);// FIXME: return value! } return a; } @@ -75,8 +75,8 @@ public: void setAt(uint i,type data) { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdAt); s << i ; s << data; @@ -96,12 +96,12 @@ public: type at( uint i ) const { - return QMemArray<type>::at(i); + return TQMemArray<type>::at(i); } type operator[]( int i ) const { - return QMemArray<type>::at(i); + return TQMemArray<type>::at(i); } KGamePropertyArray<type> &operator=(const KGamePropertyArray<type> &a) @@ -117,8 +117,8 @@ public: bool fill( const type &data, int size = -1 ) { bool r=true; - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdFill); s << data; s << size ; @@ -132,7 +132,7 @@ public: if (policy()==PolicyLocal || policy()==PolicyDirty) { extractProperty(b); -// r=QMemArray<type>::fill(data,size);//FIXME: return value! +// r=TQMemArray<type>::fill(data,size);//FIXME: return value! } return r; } @@ -146,7 +146,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::assign(a); + TQMemArray<type>::assign(a); } return *this; } @@ -158,7 +158,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::assign(a,n); + TQMemArray<type>::assign(a,n); } return *this; } @@ -170,7 +170,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::duplicate(a); + TQMemArray<type>::duplicate(a); } return *this; } @@ -182,7 +182,7 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::duplicate(a,n); + TQMemArray<type>::duplicate(a,n); } return *this; } @@ -194,14 +194,14 @@ public: } if (policy()==PolicyLocal || policy()==PolicyDirty) { - QMemArray<type>::setRawData(a,n); + TQMemArray<type>::setRawData(a,n); } return *this; } void sort() { - QByteArray b; - QDataStream s(b, IO_WriteOnly); + TQByteArray b; + TQDataStream s(b, IO_WriteOnly); KGameMessage::createPropertyCommand(s,KGamePropertyBase::IdCommand,id(),CmdSort); if (policy()==PolicyLocal || policy()==PolicyDirty) { @@ -216,30 +216,30 @@ public: } } - void load(QDataStream& s) + void load(TQDataStream& s) { //kdDebug(11001) << "KGamePropertyArray load " << id() << endl; type data; - for (unsigned int i=0; i<QMemArray<type>::size(); i++) + for (unsigned int i=0; i<TQMemArray<type>::size(); i++) { s >> data; - QMemArray<type>::at(i)=data; + TQMemArray<type>::at(i)=data; } if (isEmittingSignal()) { emitSignal(); } } - void save(QDataStream &s) + void save(TQDataStream &s) { //kdDebug(11001) << "KGamePropertyArray save "<<id() << endl; - for (unsigned int i=0; i<QMemArray<type>::size(); i++) + for (unsigned int i=0; i<TQMemArray<type>::size(); i++) { s << at(i); } } - void command(QDataStream &s,int cmd,bool) + void command(TQDataStream &s,int cmd,bool) { KGamePropertyBase::command(s, cmd); //kdDebug(11001) << "Array id="<<id()<<" got command ("<<cmd<<") !!!" <<endl; @@ -250,7 +250,7 @@ public: uint i; type data; s >> i >> data; - QMemArray<type>::at(i)=data; + TQMemArray<type>::at(i)=data; //kdDebug(11001) << "CmdAt:id="<<id()<<" i="<<i<<" data="<<data <<endl; if (isEmittingSignal()) { @@ -262,10 +262,10 @@ public: { uint size; s >> size; - //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<QMemArray<type>::size()<<" newsize="<<size <<endl; - if (QMemArray<type>::size() != size) + //kdDebug(11001) << "CmdResize:id="<<id()<<" oldsize="<<TQMemArray<type>::size()<<" newsize="<<size <<endl; + if (TQMemArray<type>::size() != size) { - QMemArray<type>::resize(size); + TQMemArray<type>::resize(size); } break; } @@ -275,7 +275,7 @@ public: type data; s >> data >> size; //kdDebug(11001) << "CmdFill:id="<<id()<<"size="<<size <<endl; - QMemArray<type>::fill(data,size); + TQMemArray<type>::fill(data,size); if (isEmittingSignal()) { emitSignal(); @@ -285,7 +285,7 @@ public: case CmdSort: { //kdDebug(11001) << "CmdSort:id="<<id()<<endl; - QMemArray<type>::sort(); + TQMemArray<type>::sort(); break; } default: @@ -294,9 +294,9 @@ public: } } protected: - void extractProperty(const QByteArray& b) + void extractProperty(const TQByteArray& b) { - QDataStream s(b, IO_ReadOnly); + TQDataStream s(b, IO_ReadOnly); int cmd; int propId; KGameMessage::extractPropertyHeader(s, propId); |