diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:59:03 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:59:03 -0500 |
commit | 9c02dbb59ce57c68dc177d9294b980bf114a3e11 (patch) | |
tree | b1b40423c9be9a42a97cd0e8f3af3139aefb6fa0 /kshowmail/configelem.cpp | |
parent | 0b875800e452c97b1a3f25aba5f029a8c33a4b93 (diff) | |
download | kshowmail-9c02dbb59ce57c68dc177d9294b980bf114a3e11.tar.gz kshowmail-9c02dbb59ce57c68dc177d9294b980bf114a3e11.zip |
Update to TDE R14 API
Diffstat (limited to 'kshowmail/configelem.cpp')
-rw-r--r-- | kshowmail/configelem.cpp | 256 |
1 files changed, 128 insertions, 128 deletions
diff --git a/kshowmail/configelem.cpp b/kshowmail/configelem.cpp index 9941c75..356e726 100644 --- a/kshowmail/configelem.cpp +++ b/kshowmail/configelem.cpp @@ -21,7 +21,7 @@ int const ConfigElem::continueShowHeaders( 0 ); int const ConfigElem::cancelShowHeaders( 1 ); -ConfigElem::ConfigElem( ) : QObject() +ConfigElem::ConfigElem( ) : TQObject() { //initialize account init(); @@ -34,7 +34,7 @@ ConfigElem::ConfigElem( ) : QObject() m_strAccount = ""; } -ConfigElem::ConfigElem( ConfigList* config ) : QObject() +ConfigElem::ConfigElem( ConfigList* config ) : TQObject() { //initialize account init(); @@ -48,7 +48,7 @@ ConfigElem::ConfigElem( ConfigList* config ) : QObject() } -ConfigElem::ConfigElem( ConfigElem* pElem ) : QObject() +ConfigElem::ConfigElem( ConfigElem* pElem ) : TQObject() { //initialize account init(); @@ -64,7 +64,7 @@ ConfigElem::ConfigElem( ConfigElem* pElem ) : QObject() } -ConfigElem::ConfigElem( ConfigList* config, const QString& account ) : QObject() +ConfigElem::ConfigElem( ConfigList* config, const TQString& account ) : TQObject() { //initialize account init(); @@ -82,7 +82,7 @@ ConfigElem::ConfigElem( ConfigList* config, const QString& account ) : QObject() void ConfigElem::init( ) { //initialize timeout timer - pop3Timer = new QTimer( this ); + pop3Timer = new TQTimer( this ); connect( pop3Timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); //state is idle @@ -116,10 +116,10 @@ ConfigElem::~ConfigElem() // do not delete m_pshowrecord here } -void ConfigElem::saveOptions( QDomDocument& doc, QDomElement& parent ) +void ConfigElem::saveOptions( TQDomDocument& doc, TQDomElement& parent ) { //get application config - KConfig* config = KApplication::kApplication()->config(); + TDEConfig* config = TDEApplication::kApplication()->config(); //save the active state config->setGroup( getAccountName() ); @@ -131,7 +131,7 @@ void ConfigElem::saveOptions( QDomDocument& doc, QDomElement& parent ) m_pshowrecord->saveOptions( doc, parent ); } -void ConfigElem::readStoredMails( QDomElement& parent ) +void ConfigElem::readStoredMails( TQDomElement& parent ) { //get mails m_pshowrecord->readStoredMails( parent ); @@ -153,23 +153,23 @@ void ConfigElem::setActive( bool active ) m_bActive = active; } -QString ConfigElem::getAccountName( ) const +TQString ConfigElem::getAccountName( ) const { return m_strAccount; } -void ConfigElem::setAccountName( QString name ) +void ConfigElem::setAccountName( TQString name ) { if( name != NULL ) m_strAccount = name; } -QString ConfigElem::getPassword( ) const +TQString ConfigElem::getPassword( ) const { return m_url.pass(); } -void ConfigElem::setPassword( const QString& password ) +void ConfigElem::setPassword( const TQString& password ) { m_url.setPass( password ); } @@ -184,12 +184,12 @@ bool ConfigElem::hasPassword( ) const return m_url.hasPass(); } -void ConfigElem::setListViewItem( QListViewItem* item ) +void ConfigElem::setListViewItem( TQListViewItem* item ) { m_pViewItem = item; } -QListViewItem * ConfigElem::getListViewItem( ) +TQListViewItem * ConfigElem::getListViewItem( ) { return m_pViewItem; } @@ -215,12 +215,12 @@ void ConfigElem::clearMailList( ) m_pshowrecord->clear(); } -void ConfigElem::setHost( const QString& host ) +void ConfigElem::setHost( const TQString& host ) { m_url.setHost( host ); } -void ConfigElem::setProtocol( const QString& protocol ) +void ConfigElem::setProtocol( const TQString& protocol ) { m_url.setProtocol( protocol ); } @@ -230,17 +230,17 @@ void ConfigElem::setPort( unsigned short int port ) m_url.setPort( port ); } -void ConfigElem::setUser( const QString & user ) +void ConfigElem::setUser( const TQString & user ) { m_url.setUser( user ); } -QString ConfigElem::getUser( ) const +TQString ConfigElem::getUser( ) const { return m_url.user(); } -QString ConfigElem::getHost( ) const +TQString ConfigElem::getHost( ) const { return m_url.host(); } @@ -287,14 +287,14 @@ bool ConfigElem::assertPassword( bool force ) { //no password found, we will ask the user! //set normal cursor - while( QApplication::overrideCursor() ) - QApplication::restoreOverrideCursor(); + while( TQApplication::overrideCursor() ) + TQApplication::restoreOverrideCursor(); - QCString password; //for the password dialog to store the password + TQCString password; //for the password dialog to store the password int result = KPasswordDialog::getPassword( password, i18n( "Please type in the password for %1" ).arg( getAccountName() ) ); //set waiting cursor - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); //let's look, what the user has done :o) if( result == KPasswordDialog::Accepted ) @@ -304,13 +304,13 @@ bool ConfigElem::assertPassword( bool force ) setPassword( password ); //save password in file or KWallet - KConfig* config = KApplication::kApplication()->config(); + TDEConfig* config = TDEApplication::kApplication()->config(); config->setGroup( getAccountName() ); if( PasswordStorage == CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE ) config->writeEntry( CONFIG_ENTRY_ACCOUNT_PASSWORD, crypt( m_url ) ); else - config->writeEntry( CONFIG_ENTRY_ACCOUNT_PASSWORD, QString::null ); + config->writeEntry( CONFIG_ENTRY_ACCOUNT_PASSWORD, TQString::null ); if( PasswordStorage == CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_KWALLET ) KWalletAccess::savePassword( getAccountName(), m_url.pass() ); @@ -350,11 +350,11 @@ void ConfigElem::deleteNextMail( ) } //start job - startKIOJob( QString( "/remove/%1" ).arg( *MailsToDelete.begin() ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotMailDeleted( KIO::Job* ) ) ); + startKIOJob( TQString( "/remove/%1" ).arg( *MailsToDelete.begin() ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotMailDeleted( TDEIO::Job* ) ) ); } -void ConfigElem::slotMailDeleted( KIO::Job* job ) +void ConfigElem::slotMailDeleted( TDEIO::Job* job ) { //stop timeout timer pop3Timer->stop(); @@ -362,7 +362,7 @@ void ConfigElem::slotMailDeleted( KIO::Job* job ) //check for errors //if an error is occured, the deletion will be canceled //or will ask for a new password - if( job->error() == KIO::ERR_COULD_NOT_LOGIN ) + if( job->error() == TDEIO::ERR_COULD_NOT_LOGIN ) { //login failed, ask for a new password job->showErrorDialog(); @@ -426,7 +426,7 @@ void ConfigElem::slotMailDeleted( KIO::Job* job ) } -void ConfigElem::slotFinalizeDeletion( KIO::Job* ) +void ConfigElem::slotFinalizeDeletion( TDEIO::Job* ) { //stop timeout time pop3Timer->stop(); @@ -438,9 +438,9 @@ void ConfigElem::slotFinalizeDeletion( KIO::Job* ) emit sigDeleteReady( m_strAccount ); } -void ConfigElem::startKIOJob( const QString & path ) +void ConfigElem::startKIOJob( const TQString & path ) { - KIO::MetaData options; //options for the pop3 job + TDEIO::MetaData options; //options for the pop3 job //set options options.insert( "progress", "off" ); @@ -452,7 +452,7 @@ void ConfigElem::startKIOJob( const QString & path ) options.insert( "tls", "off" ); //Where is secure login? - //I have decided against a configurable secure login because the used POP3 kioslave + //I have decided against a configurable secure login because the used POP3 tdeioslave //always tries to login with APOP, if the server has sent a timestap (inside of the greeting string) for this authentification type. //It just follows the auth-metadata, if the server doesn't support APOP (no timestamp inside of the greeting string). //But I think, there is no server, which support a SASL authentification without also provide APOP. @@ -465,7 +465,7 @@ void ConfigElem::startKIOJob( const QString & path ) kdDebug() << "ConfigElem::startKIOJob: start KIO job on URL " << m_url.url() << endl; //start the job and get handle to it - pop3Job = KIO::get( m_url, false, false ); + pop3Job = TDEIO::get( m_url, false, false ); //put options to the job pop3Job->addMetaData( options ); @@ -482,8 +482,8 @@ Types::AccountState_Type ConfigElem::getState( ) void ConfigElem::commitDeletion( ) { //start job to commit - startKIOJob( QString( "/commit" ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotFinalizeDeletion( KIO::Job* ) ) ); + startKIOJob( TQString( "/commit" ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotFinalizeDeletion( TDEIO::Job* ) ) ); } unsigned int ConfigElem::getTimeoutTime( ) @@ -512,7 +512,7 @@ void ConfigElem::slotTimeout( ) kdError() << "Timeout error!" << endl; if( state != AccountRefreshing || appConfig->showConnectionErrors() ) - KMessageBox::error( NULL, QString( i18n( "Time out on %1. The operation could not be finished on time" ) ).arg( m_strAccount ), i18n( "Time Out" ) ); + KMessageBox::error( NULL, TQString( i18n( "Time out on %1. The operation could not be finished on time" ) ).arg( m_strAccount ), i18n( "Time Out" ) ); //call the appropriate finalize methode switch( state ) @@ -526,7 +526,7 @@ void ConfigElem::slotTimeout( ) } } -QStringList ConfigElem::getSelectedSubjects( ) const +TQStringList ConfigElem::getSelectedSubjects( ) const { return m_pshowrecord->getSelectedSubjects(); } @@ -585,13 +585,13 @@ void ConfigElem::showNextMail( ) mailbody.resize( 0 ); //start job - startKIOJob( QString( "/download/%1" ).arg( *MailsToShow.begin() ) ); - connect( pop3Job, SIGNAL( data( KIO::Job*, const QByteArray & ) ), SLOT( slotDataMailBody( KIO::Job*, const QByteArray & ) ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotBodyDownloaded( KIO::Job* ) ) ); + startKIOJob( TQString( "/download/%1" ).arg( *MailsToShow.begin() ) ); + connect( pop3Job, SIGNAL( data( TDEIO::Job*, const TQByteArray & ) ), SLOT( slotDataMailBody( TDEIO::Job*, const TQByteArray & ) ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotBodyDownloaded( TDEIO::Job* ) ) ); } -void ConfigElem::slotBodyDownloaded( KIO::Job * job ) +void ConfigElem::slotBodyDownloaded( TDEIO::Job * job ) { //stop timeout timer pop3Timer->stop(); @@ -599,7 +599,7 @@ void ConfigElem::slotBodyDownloaded( KIO::Job * job ) //check for errors //if an error has occured, the download will be canceled //or will ask for a new password - if( job->error() == KIO::ERR_COULD_NOT_LOGIN ) + if( job->error() == TDEIO::ERR_COULD_NOT_LOGIN ) { //login failed, ask for a new password job->showErrorDialog(); @@ -623,11 +623,11 @@ void ConfigElem::slotBodyDownloaded( KIO::Job * job ) //succesful download //show mail int currentMail = *MailsToShow.begin(); - QString tsender = m_pshowrecord->getSenderOf( currentMail ); - QString tdate = m_pshowrecord->getDateOf( currentMail ); - QString tsize = m_pshowrecord->getSizeOf( currentMail ); - QString tsubject = m_pshowrecord->getSubjectOf( currentMail ); - QString tmailbody( m_pshowrecord->decodeMailBody( mailbody, currentMail, appConfig->allowHTML() ) ); + TQString tsender = m_pshowrecord->getSenderOf( currentMail ); + TQString tdate = m_pshowrecord->getDateOf( currentMail ); + TQString tsize = m_pshowrecord->getSizeOf( currentMail ); + TQString tsubject = m_pshowrecord->getSubjectOf( currentMail ); + TQString tmailbody( m_pshowrecord->decodeMailBody( mailbody, currentMail, appConfig->allowHTML() ) ); //emit signal to notify the opening of a window emit sigMessageWindowOpened(); @@ -663,7 +663,7 @@ void ConfigElem::slotBodyDownloaded( KIO::Job * job ) showNextMail(); } -void ConfigElem::slotFinalizeShowMail( KIO::Job* ) +void ConfigElem::slotFinalizeShowMail( TDEIO::Job* ) { //stop timeout time pop3Timer->stop(); @@ -675,7 +675,7 @@ void ConfigElem::slotFinalizeShowMail( KIO::Job* ) emit sigShowBodiesReady( m_strAccount ); } -void ConfigElem::slotDataMailBody( KIO::Job *, const QByteArray & datas ) +void ConfigElem::slotDataMailBody( TDEIO::Job *, const TQByteArray & datas ) { if( !datas.isEmpty() ) { @@ -691,8 +691,8 @@ void ConfigElem::slotDataMailBody( KIO::Job *, const QByteArray & datas ) void ConfigElem::commitDownloading( ) { //start job to commit - startKIOJob( QString( "/commit" ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotFinalizeShowMail( KIO::Job* ) ) ); + startKIOJob( TQString( "/commit" ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotFinalizeShowMail( TDEIO::Job* ) ) ); } void ConfigElem::refreshMailList( FilterLog* log ) @@ -739,32 +739,32 @@ void ConfigElem::refreshMailList( FilterLog* log ) void ConfigElem::getUIDs( ) { - //clears the QString list, which contains all received UIDs + //clears the TQString list, which contains all received UIDs receivedUIDs.clear(); //start job - startKIOJob( QString( "/uidl" ) ); - connect( pop3Job, SIGNAL( data( KIO::Job*, const QByteArray & ) ), SLOT( slotReceiveUID( KIO::Job*, const QByteArray & ) ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotUIDsReceived( KIO::Job* ) ) ); + startKIOJob( TQString( "/uidl" ) ); + connect( pop3Job, SIGNAL( data( TDEIO::Job*, const TQByteArray & ) ), SLOT( slotReceiveUID( TDEIO::Job*, const TQByteArray & ) ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotUIDsReceived( TDEIO::Job* ) ) ); } -void ConfigElem::slotReceiveUID( KIO::Job*, const QByteArray& data ) +void ConfigElem::slotReceiveUID( TDEIO::Job*, const TQByteArray& data ) { //return, when data is empty if( data.isEmpty() ) return; - //cast the data to QString - QString uid( data ); + //cast the data to TQString + TQString uid( data ); //insert the uid at the end of the UID list receivedUIDs.append( uid ); } -void ConfigElem::slotUIDsReceived( KIO::Job * job ) +void ConfigElem::slotUIDsReceived( TDEIO::Job * job ) { int number; //an extracted mail number - QString uid; //an extracted uid + TQString uid; //an extracted uid bool corruptData = false; //set to TRUE, if a data is corrupt bool isNew = false; //state of the received mail @@ -774,7 +774,7 @@ void ConfigElem::slotUIDsReceived( KIO::Job * job ) //check for errors //if an error has occured, the refresh will be canceled //or will ask for a new password - if( job->error() == KIO::ERR_COULD_NOT_LOGIN ) + if( job->error() == TDEIO::ERR_COULD_NOT_LOGIN ) { //login failed, ask for a new password job->showErrorDialog(); @@ -805,9 +805,9 @@ void ConfigElem::slotUIDsReceived( KIO::Job * job ) if( !receivedUIDs.isEmpty() ) { //iterate over all UIDs in the list - for ( QStringList::Iterator it = receivedUIDs.begin(); it != receivedUIDs.end(); ++it ) + for ( TQStringList::Iterator it = receivedUIDs.begin(); it != receivedUIDs.end(); ++it ) { - QString line = *it; + TQString line = *it; //every line has the format "number UID", e.g.: 1 bf10d38018de7c1d628d65288d722f6a //get the position of the separating space @@ -816,7 +816,7 @@ void ConfigElem::slotUIDsReceived( KIO::Job * job ) //if no space was found, the line is corrupt if( positionOfSpace == -1 ) { - kdError() << "ConfigElem::slotUIDsReceived: get a corrupt UID from " << dynamic_cast<KIO::SimpleJob*>(job)->url().host() << ". No space. : " << line << endl; + kdError() << "ConfigElem::slotUIDsReceived: get a corrupt UID from " << dynamic_cast<TDEIO::SimpleJob*>(job)->url().host() << ". No space. : " << line << endl; corruptData = true; } else @@ -828,7 +828,7 @@ void ConfigElem::slotUIDsReceived( KIO::Job * job ) if( !isNumber ) { //the first part is not a number - kdError() << "ConfigElem::slotUIDsReceived: get a corrupt UID from " << dynamic_cast<KIO::SimpleJob*>(job)->url().host() << ". No number found at begin. : " << line << endl; + kdError() << "ConfigElem::slotUIDsReceived: get a corrupt UID from " << dynamic_cast<TDEIO::SimpleJob*>(job)->url().host() << ". No number found at begin. : " << line << endl; corruptData = true; } else @@ -896,7 +896,7 @@ void ConfigElem::cancelRefresh() //we don't need an error message, because the KIO job has shown one } -void ConfigElem::slotFinalizeRefresh( KIO::Job* ) +void ConfigElem::slotFinalizeRefresh( TDEIO::Job* ) { //stop timeout time pop3Timer->stop(); @@ -916,23 +916,23 @@ void ConfigElem::slotFinalizeRefresh( KIO::Job* ) void ConfigElem::commitRefresh( ) { //start job to commit - startKIOJob( QString( "/commit" ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotFinalizeRefresh( KIO::Job* ) ) ); + startKIOJob( TQString( "/commit" ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotFinalizeRefresh( TDEIO::Job* ) ) ); } void ConfigElem::getSizes( ) { - //clears the QString list, which contains all received UIDs + //clears the TQString list, which contains all received UIDs receivedSizes.clear(); //start job - startKIOJob( QString( "/index" ) ); - connect( pop3Job, SIGNAL( data( KIO::Job*, const QByteArray & ) ), SLOT( slotReceiveSize( KIO::Job*, const QByteArray & ) ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotSizesReceived( KIO::Job* ) ) ); + startKIOJob( TQString( "/index" ) ); + connect( pop3Job, SIGNAL( data( TDEIO::Job*, const TQByteArray & ) ), SLOT( slotReceiveSize( TDEIO::Job*, const TQByteArray & ) ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotSizesReceived( TDEIO::Job* ) ) ); } -void ConfigElem::slotSizesReceived( KIO::Job * job ) +void ConfigElem::slotSizesReceived( TDEIO::Job * job ) { int number; //an extracted mail number long size; //an extracted size @@ -956,9 +956,9 @@ void ConfigElem::slotSizesReceived( KIO::Job * job ) if( !receivedSizes.isEmpty() ) { //iterate over all sizes in the list - for ( QStringList::Iterator it = receivedSizes.begin(); it != receivedSizes.end(); ++it ) + for ( TQStringList::Iterator it = receivedSizes.begin(); it != receivedSizes.end(); ++it ) { - QString line = *it; + TQString line = *it; //every line has the format "number size", e.g.: 1 1234 //get the position of the separating space @@ -967,7 +967,7 @@ void ConfigElem::slotSizesReceived( KIO::Job * job ) //if no space was found, the line is corrupt if( positionOfSpace == -1 ) { - kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<KIO::SimpleJob*>(job)->url().host() << ". No space. : " << line << endl; + kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<TDEIO::SimpleJob*>(job)->url().host() << ". No space. : " << line << endl; corruptData = true; } else @@ -979,7 +979,7 @@ void ConfigElem::slotSizesReceived( KIO::Job * job ) if( !isNumber ) { //the first part is not a number - kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<KIO::SimpleJob*>(job)->url().host() << ". No number found at begin. : " << line << endl; + kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<TDEIO::SimpleJob*>(job)->url().host() << ". No number found at begin. : " << line << endl; corruptData = true; } else @@ -991,7 +991,7 @@ void ConfigElem::slotSizesReceived( KIO::Job * job ) if( !isNumber ) { //the second part of the string is not a number - kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<KIO::SimpleJob*>(job)->url().host() << ". No size found at end. : " << line << endl; + kdError() << "ConfigElem::slotSizesReceived: get a corrupt size from " << dynamic_cast<TDEIO::SimpleJob*>(job)->url().host() << ". No size found at end. : " << line << endl; corruptData = true; } else @@ -1013,13 +1013,13 @@ void ConfigElem::slotSizesReceived( KIO::Job * job ) } } -void ConfigElem::slotReceiveSize( KIO::Job *, const QByteArray & data ) +void ConfigElem::slotReceiveSize( TDEIO::Job *, const TQByteArray & data ) { //return, when data is empty if( data.isEmpty() ) return; - //cast the data to QString - QString size( data ); + //cast the data to TQString + TQString size( data ); //insert the uid at the end of the sizes list receivedSizes.append( size ); @@ -1054,13 +1054,13 @@ void ConfigElem::getNextHeader( ) receivedHeader.resize( 0 ); //start job - startKIOJob( QString( "/headers/%1" ).arg( *newMails.begin() ) ); - connect( pop3Job, SIGNAL( data( KIO::Job*, const QByteArray & ) ), this, SLOT( slotReceiveHeader( KIO::Job*, const QByteArray & ) ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotHeaderDownloaded( KIO::Job* ) ) ); + startKIOJob( TQString( "/headers/%1" ).arg( *newMails.begin() ) ); + connect( pop3Job, SIGNAL( data( TDEIO::Job*, const TQByteArray & ) ), this, SLOT( slotReceiveHeader( TDEIO::Job*, const TQByteArray & ) ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotHeaderDownloaded( TDEIO::Job* ) ) ); } -void ConfigElem::slotHeaderDownloaded( KIO::Job * job ) +void ConfigElem::slotHeaderDownloaded( TDEIO::Job * job ) { //stop timeout timer pop3Timer->stop(); @@ -1078,7 +1078,7 @@ void ConfigElem::slotHeaderDownloaded( KIO::Job * job ) } //store header - tempMailList->setHeader( *newMails.begin(), QString( receivedHeader ) ); + tempMailList->setHeader( *newMails.begin(), TQString( receivedHeader ) ); //remove the first item of the list of new mails newMails.remove( newMails.begin() ); @@ -1097,14 +1097,14 @@ void ConfigElem::slotHeaderDownloaded( KIO::Job * job ) void ConfigElem::copyHeaders( ) { //get the UIDs of the old mails in the temporary mail list - QStringList UIDs = tempMailList->getUIDsOfOldMails(); + TQStringList UIDs = tempMailList->getUIDsOfOldMails(); //iterate over all members of the list, //get the header from the old list and store it in the new one - QStringList::iterator it; + TQStringList::iterator it; for ( it = UIDs.begin(); it != UIDs.end(); ++it ) { - QString header = m_pshowrecord->getHeaderOf( *it ); + TQString header = m_pshowrecord->getHeaderOf( *it ); tempMailList->setHeader( *it, header ); } @@ -1112,7 +1112,7 @@ void ConfigElem::copyHeaders( ) swapMailLists(); } -void ConfigElem::slotReceiveHeader( KIO::Job *, const QByteArray & data ) +void ConfigElem::slotReceiveHeader( TDEIO::Job *, const TQByteArray & data ) { if( !data.isEmpty() ) { @@ -1151,13 +1151,13 @@ void ConfigElem::refreshAccountListItem( ) { if( isActive() ) { - m_pViewItem->setText( 4, QString( "%1" ).arg( getNumberMails(), 3 ) ); - m_pViewItem->setText( 5, QString( "%1" ).arg( getTotalSize(), 8 ) ); + m_pViewItem->setText( 4, TQString( "%1" ).arg( getNumberMails(), 3 ) ); + m_pViewItem->setText( 5, TQString( "%1" ).arg( getTotalSize(), 8 ) ); } else { - m_pViewItem->setText( 4, QString( "???" ) ); - m_pViewItem->setText( 5, QString( "???" ) ); + m_pViewItem->setText( 4, TQString( "???" ) ); + m_pViewItem->setText( 5, TQString( "???" ) ); } } } @@ -1239,7 +1239,7 @@ int ConfigElem::getPasswordStorage( ) const return PasswordStorage; } -QString ConfigElem::getProtocol( bool upperCase ) const +TQString ConfigElem::getProtocol( bool upperCase ) const { if( upperCase ) return m_url.protocol().upper(); @@ -1377,65 +1377,65 @@ void ConfigElem::applyFiltersDeleted( ) } -bool ConfigElem::writeToMailBox( const QString & mail, const QString & box ) +bool ConfigElem::writeToMailBox( const TQString & mail, const TQString & box ) { - QDir mailDir( box ); + TQDir mailDir( box ); //check whether the given path is a maildir if( !isMailDir( mailDir ) ) { //show an error message - KMessageBox::error( NULL, i18n( QString( "%1 is not a mailbox." ).arg( box ) ) ); + KMessageBox::error( NULL, i18n( TQString( "%1 is not a mailbox." ).arg( box ) ) ); return false; } //create unique file name according http://cr.yp.to/proto/maildir.html - QString partTime = QString::number( time( NULL ) ); //left part, output of time() + TQString partTime = TQString::number( time( NULL ) ); //left part, output of time() char hname[256]; //right part, the hostname - QString partHostname; + TQString partHostname; if( gethostname( hname, 255 ) == 0 ) - partHostname = QString( hname ); + partHostname = TQString( hname ); else { //the hostname is not readable //show an error message and exit - KMessageBox::error( NULL, i18n( QString( "Can't read the hostname of your computer. But KShowmail need it to write a mail into the mailbox." ) ) ); + KMessageBox::error( NULL, i18n( TQString( "Can't read the hostname of your computer. But KShowmail need it to write a mail into the mailbox." ) ) ); return false; } - QString partPID = QString::number( getpid() ); //middle part, the PID + TQString partPID = TQString::number( getpid() ); //middle part, the PID - QString partCounter = QString::number( moveCounter++ ); + TQString partCounter = TQString::number( moveCounter++ ); - QString uniqueName( partTime + "." + partPID + partCounter + "." + partHostname ); + TQString uniqueName( partTime + "." + partPID + partCounter + "." + partHostname ); //build absolute path mailDir.cd( "tmp" ); - QString absFile = mailDir.filePath( uniqueName ); + TQString absFile = mailDir.filePath( uniqueName ); //and writing! - QFile file( absFile ); + TQFile file( absFile ); if( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << mail << endl; file.close(); } else { - KMessageBox::detailedError( NULL, i18n( QString( "Could not file a mail to %1." ) ).arg( box ), i18n( file.errorString() ) ); + KMessageBox::detailedError( NULL, i18n( TQString( "Could not file a mail to %1." ) ).arg( box ), i18n( file.errorString() ) ); return false; } //now we move it to the "new" subdirectory mailDir.cdUp(); mailDir.cd( "new" ); - QString absNewFile = mailDir.filePath( uniqueName ); + TQString absNewFile = mailDir.filePath( uniqueName ); if( rename( absFile.ascii(), absNewFile.ascii() ) == -1 ) { - KMessageBox::error( NULL, i18n( QString( "Could not move a mail from %1 to %2." ) ).arg( absFile ).arg( absNewFile ) ); + KMessageBox::error( NULL, i18n( TQString( "Could not move a mail from %1 to %2." ) ).arg( absFile ).arg( absNewFile ) ); return false; } @@ -1449,10 +1449,10 @@ void ConfigElem::doDownloadActions() getNextMailForDownloadActions(); } -bool ConfigElem::isMailDir( const QDir & path ) +bool ConfigElem::isMailDir( const TQDir & path ) { //get a list of all subdirectories in this directory - const QStringList entries = path.entryList( QDir::Dirs | QDir::Readable | QDir::Writable | QDir::Hidden, QDir::Name | QDir::IgnoreCase | QDir::LocaleAware ); + const TQStringList entries = path.entryList( TQDir::Dirs | TQDir::Readable | TQDir::Writable | TQDir::Hidden, TQDir::Name | TQDir::IgnoreCase | TQDir::LocaleAware ); //a maildir folder must contains the folders "cur", "new" and "tmp" bool curFound = false; @@ -1460,7 +1460,7 @@ bool ConfigElem::isMailDir( const QDir & path ) bool tmpFound = false; //iterate over all directories and look for the three necessary dirs - QStringList::const_iterator it = entries.begin(); + TQStringList::const_iterator it = entries.begin(); while( it != entries.end() && !( curFound && newFound && tmpFound ) ) { if( *it == "tmp" ) @@ -1489,13 +1489,13 @@ void ConfigElem::getNextMailForDownloadActions() mailbody.resize( 0 ); //start job - startKIOJob( QString( "/download/%1" ).arg( MailsToDownload.begin().key() ) ); - connect( pop3Job, SIGNAL( data( KIO::Job*, const QByteArray & ) ), SLOT( slotDataMailBody( KIO::Job*, const QByteArray & ) ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotMailDownloadedForAction( KIO::Job* ) ) ); + startKIOJob( TQString( "/download/%1" ).arg( MailsToDownload.begin().key() ) ); + connect( pop3Job, SIGNAL( data( TDEIO::Job*, const TQByteArray & ) ), SLOT( slotDataMailBody( TDEIO::Job*, const TQByteArray & ) ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotMailDownloadedForAction( TDEIO::Job* ) ) ); } -void ConfigElem::slotMailDownloadedForAction(KIO::Job * job) +void ConfigElem::slotMailDownloadedForAction(TDEIO::Job * job) { //stop timeout timer pop3Timer->stop(); @@ -1503,7 +1503,7 @@ void ConfigElem::slotMailDownloadedForAction(KIO::Job * job) //check for errors //if an error has occured, the download will be canceled //or will ask for a new password - if( job->error() == KIO::ERR_COULD_NOT_LOGIN ) + if( job->error() == TDEIO::ERR_COULD_NOT_LOGIN ) { //login failed, ask for a new password job->showErrorDialog(); @@ -1528,8 +1528,8 @@ void ConfigElem::slotMailDownloadedForAction(KIO::Job * job) //do action MailToDownloadMap_Type::Iterator firstMail = MailsToDownload.begin(); int currentMailNumber = firstMail.key(); //get mail number - QString currentMailBox( firstMail.data().mailbox ); //get mailbox - QString mail( mailbody ); //convert mailtext + TQString currentMailBox( firstMail.data().mailbox ); //get mailbox + TQString mail( mailbody ); //convert mailtext FilterAction_Type action = firstMail.data().action; //get action bool resultMove = false; //TRUE - mail is written into the mailbox @@ -1644,7 +1644,7 @@ void ConfigElem::slotMailDownloadedForAction(KIO::Job * job) getNextMailForDownloadActions(); } -bool ConfigElem::isSpam( QByteArray mail ) const +bool ConfigElem::isSpam( TQByteArray mail ) const { //check for a running spamassassin if( !isSpamAssassinRunning() ) @@ -1701,7 +1701,7 @@ bool ConfigElem::isSpamAssassinRunning( ) const while( chars_read > 0 ) { buffer[ chars_read - 1 ] = '\0'; - QString output( buffer ); + TQString output( buffer ); found = output.contains( NAME_SPAMASSASSIN_DAEMON ) > 0; chars_read = fread( buffer, sizeof( char ), BUFSIZ, read_fp ); } @@ -1736,7 +1736,7 @@ int ConfigElem::numberIgnoredMails( ) return nmbIgnoredMails; } -QStringList ConfigElem::getSelectedSenders( ) const +TQStringList ConfigElem::getSelectedSenders( ) const { return m_pshowrecord->getSelectedSenders(); } @@ -1747,12 +1747,12 @@ QStringList ConfigElem::getSelectedSenders( ) const void ConfigElem::commitBeforeRefresh() { //start job to commit - startKIOJob( QString( "/commit" ) ); - connect( pop3Job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotCommitBeforeRefreshDone( KIO::Job* ) ) ); + startKIOJob( TQString( "/commit" ) ); + connect( pop3Job, SIGNAL( result( TDEIO::Job* ) ), this, SLOT( slotCommitBeforeRefreshDone( TDEIO::Job* ) ) ); } -void ConfigElem::slotCommitBeforeRefreshDone(KIO::Job *) +void ConfigElem::slotCommitBeforeRefreshDone(TDEIO::Job *) { //after a commit was send, we start a new refresh cyle refreshMailList(); |