diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/store/KoStoreDevice.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/store/KoStoreDevice.h')
-rw-r--r-- | lib/store/KoStoreDevice.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/store/KoStoreDevice.h b/lib/store/KoStoreDevice.h index e76013bd..9d62b21c 100644 --- a/lib/store/KoStoreDevice.h +++ b/lib/store/KoStoreDevice.h @@ -23,11 +23,11 @@ #include <KoStore.h> /** - * This class implements a QIODevice around KoStore, so that - * it can be used to create a QDomDocument from it, to be written or read - * using QDataStream or to be written using QTextStream + * This class implements a TQIODevice around KoStore, so that + * it can be used to create a TQDomDocument from it, to be written or read + * using TQDataStream or to be written using TQTextStream */ -class KoStoreDevice : public QIODevice +class KoStoreDevice : public TQIODevice { public: /// Note: KoStore::open() should be called before calling this. @@ -46,17 +46,26 @@ public: void close() { } void flush() { } +#ifdef USE_QT4 + qint64 size() const { +#else // USE_QT4 Offset size() const { +#endif // USE_QT4 if ( m_store->mode() == KoStore::Read ) return m_store->size(); else return 0xffffffff; } - virtual Q_LONG readBlock( char *data, Q_ULONG maxlen ) { return m_store->read(data, maxlen); } - virtual Q_LONG writeBlock( const char *data, Q_ULONG len ) { return m_store->write( data, len ); } + virtual TQ_LONG readBlock( char *data, TQ_ULONG maxlen ) { return m_store->read(data, maxlen); } + virtual TQ_LONG writeBlock( const char *data, TQ_ULONG len ) { return m_store->write( data, len ); } // Not virtual, only to uncover shadow - Q_LONG writeBlock( const QByteArray& data ) { return QIODevice::writeBlock( data ); } + TQ_LONG writeBlock( const TQByteArray& data ) { return TQIODevice::writeBlock( data ); } + +#ifdef USE_QT4 + inline qint64 readData ( char * data, qint64 maxSize ) { return readBlock(data, maxSize); } + inline qint64 writeData ( const char * data, qint64 maxSize ) { return writeBlock(data, maxSize); } +#endif // USE_QT4 int getch() { char c[2]; @@ -76,7 +85,7 @@ public: } int ungetch( int ) { return -1; } // unsupported - // See QIODevice + // See TQIODevice virtual bool at( Offset pos ) { return m_store->at(pos); } virtual Offset at() const { return m_store->at(); } virtual bool atEnd() const { return m_store->atEnd(); } |