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/KoDirectoryStore.cpp | |
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/KoDirectoryStore.cpp')
-rw-r--r-- | lib/store/KoDirectoryStore.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/store/KoDirectoryStore.cpp b/lib/store/KoDirectoryStore.cpp index d5b698f0..8cf30788 100644 --- a/lib/store/KoDirectoryStore.cpp +++ b/lib/store/KoDirectoryStore.cpp @@ -18,16 +18,16 @@ */ #include "KoDirectoryStore.h" -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> #include <kdebug.h> -// HMMM... I used QFile and QDir.... but maybe this should be made network transparent? +// HMMM... I used TQFile and TQDir.... but maybe this should be made network transparent? -KoDirectoryStore::KoDirectoryStore( const QString& path, Mode _mode ) +KoDirectoryStore::KoDirectoryStore( const TQString& path, Mode _mode ) : m_basePath( path ) { - const int pos = path.findRev( '/' ); + const int pos = path.tqfindRev( '/' ); // The parameter must include "maindoc.xml" or "content.xml" if ( pos != -1 && pos != (int)m_basePath.length()-1 ) m_basePath = m_basePath.left( pos ); @@ -45,10 +45,10 @@ KoDirectoryStore::~KoDirectoryStore() bool KoDirectoryStore::init( Mode _mode ) { KoStore::init( _mode ); - QDir dir( m_basePath ); + TQDir dir( m_basePath ); if ( dir.exists() ) return true; - dir = QDir::current(); + dir = TQDir::current(); // Dir doesn't exist. If reading -> error. If writing -> create. if ( _mode == Write && dir.mkdir( m_basePath ) ) { kdDebug(s_area) << "KoDirectoryStore::init Directory created: " << m_basePath << endl; @@ -57,22 +57,22 @@ bool KoDirectoryStore::init( Mode _mode ) return false; } -bool KoDirectoryStore::openReadOrWrite( const QString& name, int iomode ) +bool KoDirectoryStore::openReadOrWrite( const TQString& name, int iomode ) { //kdDebug(s_area) << "KoDirectoryStore::openReadOrWrite m_currentPath=" << m_currentPath << " name=" << name << endl; - int pos = name.findRev('/'); + int pos = name.tqfindRev('/'); if ( pos != -1 ) // there are subdirs in the name -> maybe need to create them, when writing { pushDirectory(); // remember where we were - enterAbsoluteDirectory( QString::null ); + enterAbsoluteDirectory( TQString() ); //kdDebug(s_area) << "KoDirectoryStore::openReadOrWrite entering " << name.left(pos) << endl; bool ret = enterDirectory( name.left( pos ) ); popDirectory(); if ( !ret ) return false; } - m_stream = new QFile( m_basePath + name ); - if ( !m_stream->open( iomode ) ) + m_stream = TQT_TQIODEVICE(new TQFile( m_basePath + name )); + if ( !m_stream->tqopen( iomode ) ) { delete m_stream; m_stream = 0L; @@ -83,14 +83,14 @@ bool KoDirectoryStore::openReadOrWrite( const QString& name, int iomode ) return true; } -bool KoDirectoryStore::enterRelativeDirectory( const QString& dirName ) +bool KoDirectoryStore::enterRelativeDirectory( const TQString& dirName ) { - QDir origDir( m_currentPath ); + TQDir origDir( m_currentPath ); m_currentPath += dirName; if ( !m_currentPath.endsWith("/") ) m_currentPath += '/'; //kdDebug(s_area) << "KoDirectoryStore::enterRelativeDirectory m_currentPath now " << m_currentPath << endl; - QDir newDir( m_currentPath ); + TQDir newDir( m_currentPath ); if ( newDir.exists() ) return true; // Dir doesn't exist. If reading -> error. If writing -> create. @@ -101,17 +101,17 @@ bool KoDirectoryStore::enterRelativeDirectory( const QString& dirName ) return false; } -bool KoDirectoryStore::enterAbsoluteDirectory( const QString& path ) +bool KoDirectoryStore::enterAbsoluteDirectory( const TQString& path ) { m_currentPath = m_basePath + path; //kdDebug(s_area) << "KoDirectoryStore::enterAbsoluteDirectory " << m_currentPath << endl; - QDir newDir( m_currentPath ); + TQDir newDir( m_currentPath ); Q_ASSERT( newDir.exists() ); // We've been there before, therefore it must exist. return newDir.exists(); } -bool KoDirectoryStore::fileExists( const QString& absPath ) const +bool KoDirectoryStore::fileExists( const TQString& absPath ) const { kdDebug(s_area) << "KoDirectoryStore::fileExists " << m_basePath+absPath << endl; - return QFile::exists( m_basePath + absPath ); + return TQFile::exists( m_basePath + absPath ); } |