diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmfolder.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmfolder.cpp')
-rw-r--r-- | kmail/kmfolder.cpp | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/kmail/kmfolder.cpp b/kmail/kmfolder.cpp index 71b9cfc89..cae870710 100644 --- a/kmail/kmfolder.cpp +++ b/kmail/kmfolder.cpp @@ -41,11 +41,11 @@ #include <klocale.h> #include <kshortcut.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qfileinfo.h> +#include <tqfile.h> +#include <tqfileinfo.h> -KMFolder::KMFolder( KMFolderDir* aParent, const QString& aFolderName, +KMFolder::KMFolder( KMFolderDir* aParent, const TQString& aFolderName, KMFolderType aFolderType, bool withIndex, bool exportedSernums ) : KMFolderNode( aParent, aFolderName ), mStorage(0), mChild( 0 ), @@ -76,60 +76,60 @@ KMFolder::KMFolder( KMFolderDir* aParent, const QString& aFolderName, assert( mStorage ); - QFileInfo dirinfo; + TQFileInfo dirinfo; dirinfo.setFile( mStorage->location() ); if ( !dirinfo.exists() ) { int rc = mStorage->create(); - QString msg = i18n("<qt>Error while creating file <b>%1</b>:<br>%2</qt>").arg(aFolderName).arg(strerror(rc)); + TQString msg = i18n("<qt>Error while creating file <b>%1</b>:<br>%2</qt>").arg(aFolderName).arg(strerror(rc)); if ( rc ) { KMessageBox::information(0, msg); } } if ( aParent ) { - connect( mStorage, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ), - aParent->manager(), SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) ); - connect( mStorage, SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ), - parent()->manager(), SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ) ); - connect( this, SIGNAL( msgChanged( KMFolder*, Q_UINT32, int ) ), - parent()->manager(), SIGNAL( msgChanged( KMFolder*, Q_UINT32, int ) ) ); - connect( this, SIGNAL( msgHeaderChanged( KMFolder*, int ) ), - parent()->manager(), SIGNAL( msgHeaderChanged( KMFolder*, int ) ) ); - connect( mStorage, SIGNAL( invalidated( KMFolder* ) ), - parent()->manager(), SIGNAL( folderInvalidated( KMFolder* ) ) ); + connect( mStorage, TQT_SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ), + aParent->manager(), TQT_SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) ); + connect( mStorage, TQT_SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ), + parent()->manager(), TQT_SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ) ); + connect( this, TQT_SIGNAL( msgChanged( KMFolder*, Q_UINT32, int ) ), + parent()->manager(), TQT_SIGNAL( msgChanged( KMFolder*, Q_UINT32, int ) ) ); + connect( this, TQT_SIGNAL( msgHeaderChanged( KMFolder*, int ) ), + parent()->manager(), TQT_SIGNAL( msgHeaderChanged( KMFolder*, int ) ) ); + connect( mStorage, TQT_SIGNAL( invalidated( KMFolder* ) ), + parent()->manager(), TQT_SIGNAL( folderInvalidated( KMFolder* ) ) ); } // Resend all mStorage signals - connect( mStorage, SIGNAL( changed() ), SIGNAL( changed() ) ); - connect( mStorage, SIGNAL( cleared() ), SIGNAL( cleared() ) ); - connect( mStorage, SIGNAL( expunged( KMFolder* ) ), - SIGNAL( expunged( KMFolder* ) ) ); - connect( mStorage, SIGNAL( nameChanged() ), SIGNAL( nameChanged() ) ); - connect( mStorage, SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ), - SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ) ); - connect( mStorage, SIGNAL( msgRemoved( int, QString ) ), - SIGNAL( msgRemoved( int, QString ) ) ); - connect( mStorage, SIGNAL( msgRemoved( KMFolder* ) ), - SIGNAL( msgRemoved( KMFolder* ) ) ); - connect( mStorage, SIGNAL( msgAdded( int ) ), SIGNAL( msgAdded( int ) ) ); - connect( mStorage, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ), - SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) ); - connect( mStorage, SIGNAL( msgChanged( KMFolder*, Q_UINT32 , int ) ), - SIGNAL( msgChanged( KMFolder*, Q_UINT32 , int ) ) ); - connect( mStorage, SIGNAL( msgHeaderChanged( KMFolder*, int ) ), - SIGNAL( msgHeaderChanged( KMFolder*, int ) ) ); - connect( mStorage, SIGNAL( statusMsg( const QString& ) ), - SIGNAL( statusMsg( const QString& ) ) ); - connect( mStorage, SIGNAL( numUnreadMsgsChanged( KMFolder* ) ), - SIGNAL( numUnreadMsgsChanged( KMFolder* ) ) ); - connect( mStorage, SIGNAL( removed( KMFolder*, bool ) ), - SIGNAL( removed( KMFolder*, bool ) ) ); - - connect( mStorage, SIGNAL( contentsTypeChanged( KMail::FolderContentsType ) ), - this, SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) ); - - connect( mStorage, SIGNAL( folderSizeChanged() ), - this, SLOT( slotFolderSizeChanged() ) ); + connect( mStorage, TQT_SIGNAL( changed() ), TQT_SIGNAL( changed() ) ); + connect( mStorage, TQT_SIGNAL( cleared() ), TQT_SIGNAL( cleared() ) ); + connect( mStorage, TQT_SIGNAL( expunged( KMFolder* ) ), + TQT_SIGNAL( expunged( KMFolder* ) ) ); + connect( mStorage, TQT_SIGNAL( nameChanged() ), TQT_SIGNAL( nameChanged() ) ); + connect( mStorage, TQT_SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ), + TQT_SIGNAL( msgRemoved( KMFolder*, Q_UINT32 ) ) ); + connect( mStorage, TQT_SIGNAL( msgRemoved( int, TQString ) ), + TQT_SIGNAL( msgRemoved( int, TQString ) ) ); + connect( mStorage, TQT_SIGNAL( msgRemoved( KMFolder* ) ), + TQT_SIGNAL( msgRemoved( KMFolder* ) ) ); + connect( mStorage, TQT_SIGNAL( msgAdded( int ) ), TQT_SIGNAL( msgAdded( int ) ) ); + connect( mStorage, TQT_SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ), + TQT_SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) ); + connect( mStorage, TQT_SIGNAL( msgChanged( KMFolder*, Q_UINT32 , int ) ), + TQT_SIGNAL( msgChanged( KMFolder*, Q_UINT32 , int ) ) ); + connect( mStorage, TQT_SIGNAL( msgHeaderChanged( KMFolder*, int ) ), + TQT_SIGNAL( msgHeaderChanged( KMFolder*, int ) ) ); + connect( mStorage, TQT_SIGNAL( statusMsg( const TQString& ) ), + TQT_SIGNAL( statusMsg( const TQString& ) ) ); + connect( mStorage, TQT_SIGNAL( numUnreadMsgsChanged( KMFolder* ) ), + TQT_SIGNAL( numUnreadMsgsChanged( KMFolder* ) ) ); + connect( mStorage, TQT_SIGNAL( removed( KMFolder*, bool ) ), + TQT_SIGNAL( removed( KMFolder*, bool ) ) ); + + connect( mStorage, TQT_SIGNAL( contentsTypeChanged( KMail::FolderContentsType ) ), + this, TQT_SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) ); + + connect( mStorage, TQT_SIGNAL( folderSizeChanged() ), + this, TQT_SLOT( slotFolderSizeChanged() ) ); //FIXME: Centralize all the readConfig calls somehow - Zack // Meanwhile, readConfig must be done before registerWithMessageDict, since @@ -186,7 +186,7 @@ void KMFolder::readConfig( KConfig* config ) if ( mUseCustomIcons ) emit iconsChanged(); - QString shortcut( config->readEntry( "Shortcut" ) ); + TQString shortcut( config->readEntry( "Shortcut" ) ); if ( !shortcut.isEmpty() ) { KShortcut sc( shortcut ); setShortcut( sc ); @@ -231,24 +231,24 @@ KMFolderType KMFolder::folderType() const return mStorage ? mStorage->folderType() : KMFolderTypeUnknown; } -QString KMFolder::fileName() const +TQString KMFolder::fileName() const { - return mStorage ? mStorage->fileName() : QString::null; + return mStorage ? mStorage->fileName() : TQString::null; } -QString KMFolder::location() const +TQString KMFolder::location() const { - return mStorage ? mStorage->location() : QString::null; + return mStorage ? mStorage->location() : TQString::null; } -QString KMFolder::indexLocation() const +TQString KMFolder::indexLocation() const { - return mStorage ? mStorage->indexLocation() : QString::null; + return mStorage ? mStorage->indexLocation() : TQString::null; } -QString KMFolder::subdirLocation() const +TQString KMFolder::subdirLocation() const { - QString sLocation( path() ); + TQString sLocation( path() ); if( !sLocation.isEmpty() ) sLocation += '/'; @@ -262,13 +262,13 @@ KMFolderDir* KMFolder::createChildFolder() if( mChild ) return mChild; - QString childName = "." + fileName() + ".directory"; - QString childDir = path() + "/" + childName; - if (access(QFile::encodeName(childDir), W_OK) != 0) // Not there or not writable + TQString childName = "." + fileName() + ".directory"; + TQString childDir = path() + "/" + childName; + if (access(TQFile::encodeName(childDir), W_OK) != 0) // Not there or not writable { - if (mkdir(QFile::encodeName(childDir), S_IRWXU) != 0 - && chmod(QFile::encodeName(childDir), S_IRWXU) != 0) { - QString wmsg = QString(" '%1': %2").arg(childDir).arg(strerror(errno)); + if (mkdir(TQFile::encodeName(childDir), S_IRWXU) != 0 + && chmod(TQFile::encodeName(childDir), S_IRWXU) != 0) { + TQString wmsg = TQString(" '%1': %2").arg(childDir).arg(strerror(errno)); KMessageBox::information(0,i18n("Failed to create folder") + wmsg); return 0; } @@ -340,14 +340,14 @@ void KMFolder::ignoreJobsForMessage( KMMessage* m ) } FolderJob* KMFolder::createJob( KMMessage *msg, FolderJob::JobType jt, - KMFolder *folder, QString partSpecifier, + KMFolder *folder, TQString partSpecifier, const AttachmentStrategy *as ) const { return mStorage->createJob( msg, jt, folder, partSpecifier, as ); } -FolderJob* KMFolder::createJob( QPtrList<KMMessage>& msgList, - const QString& sets, +FolderJob* KMFolder::createJob( TQPtrList<KMMessage>& msgList, + const TQString& sets, FolderJob::JobType jt, KMFolder *folder ) const { return mStorage->createJob( msgList, sets, jt, folder ); @@ -378,7 +378,7 @@ KMMessage* KMFolder::take( int idx ) return mStorage->take( idx ); } -void KMFolder::take( QPtrList<KMMessage> msgList ) // TODO const ref +void KMFolder::take( TQPtrList<KMMessage> msgList ) // TODO const ref { mStorage->take( msgList ); } @@ -393,7 +393,7 @@ int KMFolder::addMsgKeepUID( KMMessage* msg, int* index_return ) return mStorage->addMsgKeepUID( msg, index_return ); } -int KMFolder::addMsg( QPtrList<KMMessage>& list, QValueList<int>& index_return ) +int KMFolder::addMsg( TQPtrList<KMMessage>& list, TQValueList<int>& index_return ) { return mStorage->addMsg( list, index_return ); } @@ -408,7 +408,7 @@ void KMFolder::removeMsg( int i, bool imapQuiet ) mStorage->removeMsg( i, imapQuiet ); } -void KMFolder::removeMsg( QPtrList<KMMessage> msgList, bool imapQuiet ) // TODO const ref +void KMFolder::removeMsg( TQPtrList<KMMessage> msgList, bool imapQuiet ) // TODO const ref { mStorage->removeMsg( msgList, imapQuiet ); } @@ -423,7 +423,7 @@ int KMFolder::moveMsg( KMMessage* msg, int* index_return ) return mStorage->moveMsg( msg, index_return ); } -int KMFolder::moveMsg(QPtrList<KMMessage> q, int* index_return ) +int KMFolder::moveMsg(TQPtrList<KMMessage> q, int* index_return ) { return mStorage->moveMsg( q, index_return ); } @@ -456,7 +456,7 @@ int KMFolder::countUnreadRecursive() if (!dir) return count; - QPtrListIterator<KMFolderNode> it(*dir); + TQPtrListIterator<KMFolderNode> it(*dir); for ( ; it.current(); ++it ) if (!it.current()->isDir()) { folder = static_cast<KMFolder*>(it.current()); @@ -524,7 +524,7 @@ int KMFolder::expunge() return mStorage->expunge(); } -int KMFolder::rename( const QString& newName, KMFolderDir *aParent ) +int KMFolder::rename( const TQString& newName, KMFolderDir *aParent ) { return mStorage->rename( newName, aParent ); } @@ -559,7 +559,7 @@ bool KMFolder::isReadOnly() const return mStorage->isReadOnly(); } -QString KMFolder::label() const +TQString KMFolder::label() const { if ( !mSystemLabel.isEmpty() ) return mSystemLabel; @@ -571,9 +571,9 @@ QString KMFolder::label() const } //----------------------------------------------------------------------------- -QString KMFolder::prettyURL() const +TQString KMFolder::prettyURL() const { - QString parentUrl; + TQString parentUrl; if ( parent() ) parentUrl = parent()->prettyURL(); if ( !parentUrl.isEmpty() ) @@ -583,7 +583,7 @@ QString KMFolder::prettyURL() const } //-------------------------------------------------------------------------- -QString KMFolder::mailingListPostAddress() const +TQString KMFolder::mailingListPostAddress() const { if ( mMailingList.features() & MailingList::Post ) { KURL::List::const_iterator it; @@ -595,7 +595,7 @@ QString KMFolder::mailingListPostAddress() const return (*it).path(); } } - return QString::null; + return TQString::null; } void KMFolder::setMailingListEnabled( bool enabled ) @@ -626,7 +626,7 @@ uint KMFolder::identity() const return mIdentity; } -void KMFolder::setWhoField(const QString& aWhoField ) +void KMFolder::setWhoField(const TQString& aWhoField ) { mWhoField = aWhoField; #if 0 @@ -635,7 +635,7 @@ void KMFolder::setWhoField(const QString& aWhoField ) #endif } -void KMFolder::setUserWhoField( const QString& whoField, bool writeConfig ) +void KMFolder::setUserWhoField( const TQString& whoField, bool writeConfig ) { if ( mUserWhoField == whoField ) return; @@ -683,19 +683,19 @@ void KMFolder::correctUnreadMsgsCount() mStorage->correctUnreadMsgsCount(); } -QString KMFolder::idString() const +TQString KMFolder::idString() const { KMFolderNode* folderNode = parent(); if (!folderNode) return ""; while ( folderNode->parent() ) folderNode = folderNode->parent(); - QString myPath = path(); + TQString myPath = path(); int pathLen = myPath.length() - folderNode->path().length(); - QString relativePath = myPath.right( pathLen ); + TQString relativePath = myPath.right( pathLen ); if (!relativePath.isEmpty()) relativePath = relativePath.right( relativePath.length() - 1 ) + "/"; - QString escapedName = name(); + TQString escapedName = name(); /* Escape [ and ] as they are disallowed for kconfig sections and that is what the idString is primarily used for. */ escapedName.replace( "[", "%(" ); @@ -750,7 +750,7 @@ void KMFolder::setExpireAction( ExpireAction a ) } } -void KMFolder::setExpireToFolderId( const QString& id ) +void KMFolder::setExpireToFolderId( const TQString& id ) { if ( id != mExpireToFolderId ) { mExpireToFolderId = id; @@ -814,14 +814,14 @@ void KMFolder::setStatus( int idx, KMMsgStatus status, bool toggle ) mStorage->setStatus( idx, status, toggle ); } -void KMFolder::setStatus( QValueList<int>& ids, KMMsgStatus status, +void KMFolder::setStatus( TQValueList<int>& ids, KMMsgStatus status, bool toggle ) { mStorage->setStatus( ids, status, toggle); } -void KMFolder::setIconPaths( const QString &normalPath, - const QString &unreadPath ) +void KMFolder::setIconPaths( const TQString &normalPath, + const TQString &unreadPath ) { mNormalIconPath = normalPath; mUnreadIconPath = unreadPath; |