summaryrefslogtreecommitdiffstats
path: root/kshowmail/configlist.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 15:59:03 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 15:59:03 -0500
commit9c02dbb59ce57c68dc177d9294b980bf114a3e11 (patch)
treeb1b40423c9be9a42a97cd0e8f3af3139aefb6fa0 /kshowmail/configlist.cpp
parent0b875800e452c97b1a3f25aba5f029a8c33a4b93 (diff)
downloadkshowmail-9c02dbb59ce57c68dc177d9294b980bf114a3e11.tar.gz
kshowmail-9c02dbb59ce57c68dc177d9294b980bf114a3e11.zip
Update to TDE R14 API
Diffstat (limited to 'kshowmail/configlist.cpp')
-rw-r--r--kshowmail/configlist.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kshowmail/configlist.cpp b/kshowmail/configlist.cpp
index 0098550..c435d01 100644
--- a/kshowmail/configlist.cpp
+++ b/kshowmail/configlist.cpp
@@ -19,18 +19,18 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qfile.h>
+#include <ntqfile.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
#include <ksavefile.h>
-#include <kapplication.h>
+#include <tdeapplication.h>
#include <kstandarddirs.h>
#include <kaudioplayer.h>
#include <kdebug.h>
#include "configlist.h"
-ConfigList::ConfigList() : QObject()
+ConfigList::ConfigList() : TQObject()
{
setAutoDelete (true);
@@ -59,7 +59,7 @@ ConfigList::ConfigList() : QObject()
}
-int ConfigList::compareItems( QCollection::Item item1, QCollection::Item item2 )
+int ConfigList::compareItems( TQCollection::Item item1, TQCollection::Item item2 )
{
ConfigElem* p1 = (ConfigElem*)item1;
ConfigElem* p2 = (ConfigElem*)item2;
@@ -67,7 +67,7 @@ int ConfigList::compareItems( QCollection::Item item1, QCollection::Item item2 )
return strcmp( p1->getAccountName(), p2->getAccountName() );
}
-QCollection::Item ConfigList::newItem( QCollection::Item item )
+TQCollection::Item ConfigList::newItem( TQCollection::Item item )
{
return new ConfigElem( (ConfigElem*)item );
}
@@ -77,17 +77,17 @@ void ConfigList::saveOptions ()
kdDebug () << "ConfigList::saveOptions" << endl;
//create XML document
- QDomDocument doc( "KShowmail" );
+ TQDomDocument doc( "KShowmail" );
//create root element
- QDomElement accounts = doc.createElement( ROOT_ELEMENT );
+ TQDomElement accounts = doc.createElement( ROOT_ELEMENT );
//create for every account an element
//the account saves its mails into this element
//after that the element will be appended to the root element
int i = 0;
ConfigElem* account = NULL; //current processed account
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
//iterate over all accounts
while( ( account = it.current() ) != NULL )
@@ -96,7 +96,7 @@ void ConfigList::saveOptions ()
++it;
//save mails
- QDomElement accElem = doc.createElement( QString( ACCOUNT_ELEMENT ) + QString( "%1" ).arg( i++ ) );
+ TQDomElement accElem = doc.createElement( TQString( ACCOUNT_ELEMENT ) + TQString( "%1" ).arg( i++ ) );
account->saveOptions( doc, accElem ); //account saves the mails into given XML document and the setup into the application config file
accounts.appendChild( accElem );
@@ -106,8 +106,8 @@ void ConfigList::saveOptions ()
doc.appendChild( accounts );
//save XML document
- QCString str = doc.toCString(); //convert XML document to a string
- QString cachefilename = locateLocal( "config", MAIL_FILE ); //get file path
+ TQCString str = doc.toCString(); //convert XML document to a string
+ TQString cachefilename = locateLocal( "config", MAIL_FILE ); //get file path
KSaveFile file( cachefilename, 0600 ); //create file
if( file.status() != 0 )
@@ -128,15 +128,15 @@ void ConfigList::saveOptions ()
}
-void ConfigList::setList (QListView* list)
+void ConfigList::setList (TQListView* list)
{
- QPixmap pix (::locate ("data", "kshowmail/pics/ok.png"));
+ TQPixmap pix (::locate ("data", "kshowmail/pics/ok.png"));
list->clear ();
int nIndex = at ();
- QListViewItem* last = NULL;
+ TQListViewItem* last = NULL;
for (ConfigElem* pElem = first(); pElem; pElem = next())
{
- last = new QListViewItem (list, last, "", pElem->getAccountName(), pElem->getURL().host(), pElem->getURL().user(), "?");
+ last = new TQListViewItem (list, last, "", pElem->getAccountName(), pElem->getURL().host(), pElem->getURL().user(), "?");
pElem->setListViewItem( last );
if (pElem->isActive())
pElem->getListViewItem()->setPixmap (0, pix);
@@ -278,7 +278,7 @@ ConfigElem* ConfigList::getSelectedAccount( )
void ConfigList::deleteSelectedMails( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//clear the map, which contains the names of the accounts,
@@ -317,7 +317,7 @@ void ConfigList::slotAccountConfigChanged( )
emit sigConfigChanged();
}
-void ConfigList::slotCheckDeletionState( QString account )
+void ConfigList::slotCheckDeletionState( TQString account )
{
bool accountDeleting = false; //set to TRUE if an account is still deleting
AccountTaskMap_Type::Iterator it; //iterator over the account deletion map
@@ -340,7 +340,7 @@ void ConfigList::slotCheckDeletionState( QString account )
void ConfigList::connectAccounts( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to connect
while( ( account = it.current() ) != NULL )
@@ -350,11 +350,11 @@ void ConfigList::connectAccounts( )
//connect
connect( account, SIGNAL( sigConfigChanged() ), this, SLOT( slotAccountConfigChanged() ) );
- connect( account, SIGNAL( sigDeleteReady( QString ) ), this, SLOT( slotCheckDeletionState( QString ) ) );
- connect( account, SIGNAL( sigShowBodiesReady( QString ) ), this, SLOT( slotCheckShowBodiesState( QString ) ) );
+ connect( account, SIGNAL( sigDeleteReady( TQString ) ), this, SLOT( slotCheckDeletionState( TQString ) ) );
+ connect( account, SIGNAL( sigShowBodiesReady( TQString ) ), this, SLOT( slotCheckShowBodiesState( TQString ) ) );
connect( account, SIGNAL( sigMessageWindowOpened() ), this, SLOT( slotMessageWindowOpened() ) );
connect( account, SIGNAL( sigMessageWindowClosed() ), this, SLOT( slotMessageWindowClosed() ) );
- connect( account, SIGNAL( sigRefreshReady( QString ) ), this, SLOT( slotCheckRefreshState( QString ) ) );
+ connect( account, SIGNAL( sigRefreshReady( TQString ) ), this, SLOT( slotCheckRefreshState( TQString ) ) );
//get next account
++it;
@@ -371,10 +371,10 @@ bool ConfigList::confirmDeletion( )
return m_bConfirmDelete;
}
-QStringList ConfigList::getSelectedSubjects( ) const
+TQStringList ConfigList::getSelectedSubjects( ) const
{
- QStringList subjects; //contains all subjects
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQStringList subjects; //contains all subjects
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //current account
while( ( account = it.current() ) != NULL )
@@ -392,7 +392,7 @@ QStringList ConfigList::getSelectedSubjects( ) const
bool ConfigList::hasSelectedMails( )
{
bool foundSelected = false; //set to TRUE, when an account with selected mails was found
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //current account
while( ( account = it.current() ) != NULL && !foundSelected )
@@ -409,7 +409,7 @@ bool ConfigList::hasSelectedMails( )
void ConfigList::showSelectedMails( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//clear the map, which contains the names of the accounts,
@@ -444,7 +444,7 @@ void ConfigList::showSelectedMails( )
}
-void ConfigList::slotCheckShowBodiesState( QString account )
+void ConfigList::slotCheckShowBodiesState( TQString account )
{
bool accountDownloading = false; //set to TRUE if an account is downloading mail body yet
AccountTaskMap_Type::Iterator it; //iterator over the account map
@@ -506,7 +506,7 @@ void ConfigList::slotMessageWindowClosed( )
void ConfigList::refreshMailLists( FilterLog* log )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//return, if no accounts available
@@ -548,7 +548,7 @@ void ConfigList::refreshMailLists( FilterLog* log )
}
-void ConfigList::slotCheckRefreshState( QString account )
+void ConfigList::slotCheckRefreshState( TQString account )
{
bool accountRefreshing = false; //set to TRUE if an account is still refreshing
AccountTaskMap_Type::Iterator it; //iterator over the account map
@@ -574,7 +574,7 @@ void ConfigList::slotCheckRefreshState( QString account )
int ConfigList::getNumberNewMails( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
int number = 0; //number of new mails
@@ -593,7 +593,7 @@ int ConfigList::getNumberNewMails( )
int ConfigList::getNumberMails( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
int number = 0; //number of mails
@@ -612,7 +612,7 @@ int ConfigList::getNumberMails( )
long ConfigList::getTotalSize( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
long size = 0; //total size of all mails
@@ -631,7 +631,7 @@ long ConfigList::getTotalSize( )
void ConfigList::fillMailListView( KshowmailView * view )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//iterate over all accounts and order the active accounts to fill their mails
@@ -687,7 +687,7 @@ bool ConfigList::hasInitTime( )
void ConfigList::refreshAccountList( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//iterate over all accounts and order the account to refresh its
@@ -704,7 +704,7 @@ void ConfigList::refreshAccountList( )
void ConfigList::killPOP3Jobs( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
//iterate over all accounts and order the account to kill
@@ -720,7 +720,7 @@ void ConfigList::killPOP3Jobs( )
void ConfigList::showSelectedHeaders( )
{
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //account to process
int showNextHeader = ConfigElem::continueShowHeaders; //return value of ConfigElem::showSelectedHeaders
@@ -736,10 +736,10 @@ void ConfigList::showSelectedHeaders( )
}
}
-void ConfigList::refreshSetup( KListView* view )
+void ConfigList::refreshSetup( TDEListView* view )
{
//get application config object (kshowmailrc)
- config = KApplication::kApplication()->config();
+ config = TDEApplication::kApplication()->config();
//read actions group
config->setGroup( CONFIG_GROUP_ACTIONS );
@@ -802,12 +802,12 @@ void ConfigList::refreshSetup( KListView* view )
//get account names from the config file
config->setGroup( CONFIG_GROUP_ACCOUNTS );
- QStringList accounts = config->readListEntry( CONFIG_ENTRY_ACCOUNTS_LIST, QStringList() );
+ TQStringList accounts = config->readListEntry( CONFIG_ENTRY_ACCOUNTS_LIST, TQStringList() );
//remove deleted accounts from the account list
//accounts are deleted, if the are in ConfigList yet, but not in the list of the config file (accounts)
ConfigElem* accountDel = NULL; //current processed account
- QPtrListIterator<ConfigElem> iter( *this ); //iterator for the account list (ConfigList)
+ TQPtrListIterator<ConfigElem> iter( *this ); //iterator for the account list (ConfigList)
//iterate over all accounts (ConfigList)
while( ( accountDel = iter.current() ) != NULL )
@@ -816,7 +816,7 @@ void ConfigList::refreshSetup( KListView* view )
++iter;
//search for the current account in the account list of the config file
- QStringList::Iterator foundAccount = accounts.find( accountDel->getAccountName() );
+ TQStringList::Iterator foundAccount = accounts.find( accountDel->getAccountName() );
//remove account from ConfigList, if it is not in the list of the config file
if( foundAccount == accounts.end() )
@@ -826,7 +826,7 @@ void ConfigList::refreshSetup( KListView* view )
//add or edit accounts
ConfigElem* acc;
//iterate over all items of the account list of the config file
- for( QStringList::Iterator it = accounts.begin(); it != accounts.end(); ++it )
+ for( TQStringList::Iterator it = accounts.begin(); it != accounts.end(); ++it )
{
//create a new account, if it is not in the list yet (ConfigList)
//or get the account
@@ -851,7 +851,7 @@ void ConfigList::refreshSetup( KListView* view )
//set protocol and security
//if the read protocol is POP3 and SSL is enabled, the account protocol will set to "pop3s"
- QString proto = config->readEntry( CONFIG_ENTRY_ACCOUNT_PROTOCOL, DEFAULT_ACCOUNT_PROTOCOL ).lower();
+ TQString proto = config->readEntry( CONFIG_ENTRY_ACCOUNT_PROTOCOL, DEFAULT_ACCOUNT_PROTOCOL ).lower();
int secureTransfer = config->readNumEntry( CONFIG_ENTRY_ACCOUNT_SECTRANSFER, DEFAULT_ACCOUNT_SECTRANSFER );
if( proto == "pop3" && secureTransfer == CONFIG_VALUE_ACCOUNT_SECTRANSFER_SSL )
@@ -878,7 +878,7 @@ void ConfigList::refreshSetup( KListView* view )
{
case CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE:
acc->setPasswordStorage( CONFIG_VALUE_ACCOUNT_PASSWORD_DONT_SAVE );
- acc->setPassword( QString::null );
+ acc->setPassword( TQString::null );
break;
case CONFIG_VALUE_ACCOUNT_PASSWORD_SAVE_FILE:
@@ -893,7 +893,7 @@ void ConfigList::refreshSetup( KListView* view )
default:
acc->setPasswordStorage( DEFAULT_ACCOUNT_PASSWORD_STORAGE );
- acc->setPassword( QString::null );
+ acc->setPassword( TQString::null );
}
//order the account to reloads its filter setup
@@ -911,7 +911,7 @@ void ConfigList::executeNewMailCommand( )
{
if( m_bCommand )
{
- if( m_strCommandPath != QString::null && m_strCommandPath != "" )
+ if( m_strCommandPath != TQString::null && m_strCommandPath != "" )
{
KShellProcess proc; //process handler to execute the binary
@@ -952,11 +952,11 @@ bool ConfigList::showConnectionErrors( ) const
return m_bShowConnectionErrors;
}
-bool ConfigList::hasAccount( const QString & name ) const
+bool ConfigList::hasAccount( const TQString & name ) const
{
bool found = false; //TRUE if we have found the given account
ConfigElem* account; //account from which we want to get its name
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
//iterate over all accounts
while( ( account = it.current() ) != NULL && !found )
@@ -972,11 +972,11 @@ bool ConfigList::hasAccount( const QString & name ) const
return found;
}
-ConfigElem * ConfigList::getAccount( const QString & name ) const
+ConfigElem * ConfigList::getAccount( const TQString & name ) const
{
bool found = false; //TRUE if we have found the given account
ConfigElem* account = NULL; //account from which we want to get its name
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
ConfigElem* returnValue = NULL;
//iterate over all accounts
@@ -999,7 +999,7 @@ ConfigElem * ConfigList::getAccount( const QString & name ) const
void ConfigList::printSetup( )
{
ConfigElem* account = NULL; //account from which we want to print the setup
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
//iterate over all accounts
while( ( account = it.current() ) != NULL )
@@ -1015,8 +1015,8 @@ void ConfigList::printSetup( )
void ConfigList::readStoredMails( )
{
//open file
- QString MailFileName = locateLocal( "config", MAIL_FILE );
- QFile file( MailFileName );
+ TQString MailFileName = locateLocal( "config", MAIL_FILE );
+ TQFile file( MailFileName );
bool fileOpen = file.open( IO_ReadOnly );
//return, if the file could not be opened
@@ -1027,8 +1027,8 @@ void ConfigList::readStoredMails( )
}
//create DOM document with the content read from the file
- QDomDocument doc( MAIL_FILE_DOCTYPE );
- QString* errorMsg = new QString();
+ TQDomDocument doc( MAIL_FILE_DOCTYPE );
+ TQString* errorMsg = new TQString();
bool success = doc.setContent( &file );
if( !success )
@@ -1037,19 +1037,19 @@ void ConfigList::readStoredMails( )
}
//get the root element
- QDomElement accounts = doc.namedItem ( ROOT_ELEMENT ).toElement();
+ TQDomElement accounts = doc.namedItem ( ROOT_ELEMENT ).toElement();
//get the first account element
- QDomNode accNode = accounts.firstChild();
+ TQDomNode accNode = accounts.firstChild();
//get all account elements
while( !accNode.isNull() )
{
//convert account node to DOM element
- QDomElement accElem = accNode.toElement();
+ TQDomElement accElem = accNode.toElement();
//get the account name
- QString accName = accElem.attribute( ATTRIBUTE_ACCOUNT_NAME );
+ TQString accName = accElem.attribute( ATTRIBUTE_ACCOUNT_NAME );
//get the proper account object
ConfigElem* account = getAccount( accName );
@@ -1070,7 +1070,7 @@ FilterAction_Type ConfigList::getSpamAction( )
return spamAction;
}
-QString ConfigList::getSpamMailbox( )
+TQString ConfigList::getSpamMailbox( )
{
return spamMailbox;
}
@@ -1078,7 +1078,7 @@ QString ConfigList::getSpamMailbox( )
int ConfigList::numberDeletedMailsLastRefresh( )
{
ConfigElem* account = NULL;
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
int number = 0;
//iterate over all accounts
@@ -1096,7 +1096,7 @@ int ConfigList::numberDeletedMailsLastRefresh( )
int ConfigList::numberDeletedMailsStart( )
{
ConfigElem* account = NULL;
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
int number = 0;
//iterate over all accounts
@@ -1114,7 +1114,7 @@ int ConfigList::numberDeletedMailsStart( )
int ConfigList::numberMovedMailsLastRefresh( )
{
ConfigElem* account = NULL;
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
int number = 0;
//iterate over all accounts
@@ -1132,7 +1132,7 @@ int ConfigList::numberMovedMailsLastRefresh( )
int ConfigList::numberMovedMailsStart( )
{
ConfigElem* account = NULL;
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
int number = 0;
//iterate over all accounts
@@ -1150,7 +1150,7 @@ int ConfigList::numberMovedMailsStart( )
int ConfigList::numberIgnoredMails( )
{
ConfigElem* account = NULL;
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
int number = 0;
//iterate over all accounts
@@ -1165,10 +1165,10 @@ int ConfigList::numberIgnoredMails( )
return number;
}
-QStringList ConfigList::getSelectedSenders( ) const
+TQStringList ConfigList::getSelectedSenders( ) const
{
- QStringList senders; //contains all senders
- QPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
+ TQStringList senders; //contains all senders
+ TQPtrListIterator<ConfigElem> it( *this ); //to iterate over all accounts
ConfigElem* account; //current account
while( ( account = it.current() ) != NULL )
@@ -1186,7 +1186,7 @@ QStringList ConfigList::getSelectedSenders( ) const
void ConfigList::refreshFilterSetup( )
{
ConfigElem* account; //account
- QPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
+ TQPtrListIterator<ConfigElem> it( *this ); //iterator for the account list
//iterate over all accounts
while( ( account = it.current() ) != NULL )