summaryrefslogtreecommitdiffstats
path: root/kmail/kmkernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmkernel.cpp')
-rw-r--r--kmail/kmkernel.cpp400
1 files changed, 200 insertions, 200 deletions
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
index a686cffd6..9bff9a72c 100644
--- a/kmail/kmkernel.cpp
+++ b/kmail/kmkernel.cpp
@@ -72,10 +72,10 @@ using KWallet::Wallet;
#include "actionscheduler.h"
#include <qutf7codec.h>
-#include <qvbox.h>
-#include <qdir.h>
-#include <qwidgetlist.h>
-#include <qobjectlist.h>
+#include <tqvbox.h>
+#include <tqdir.h>
+#include <tqwidgetlist.h>
+#include <tqobjectlist.h>
#include <sys/types.h>
#include <dirent.h>
@@ -95,8 +95,8 @@ KMKernel *KMKernel::mySelf = 0;
/********************************************************************/
/* Constructor and destructor */
/********************************************************************/
-KMKernel::KMKernel (QObject *parent, const char *name) :
- DCOPObject("KMailIface"), QObject(parent, name),
+KMKernel::KMKernel (TQObject *parent, const char *name) :
+ DCOPObject("KMailIface"), TQObject(parent, name),
mIdentityManager(0), mConfigureDialog(0),
mContextMenuShown( false ), mWallet( 0 )
{
@@ -145,7 +145,7 @@ KMKernel::KMKernel (QObject *parent, const char *name) :
// register our own (libkdenetwork) utf-7 codec as long as Qt
// doesn't have it's own:
- if ( !QTextCodec::codecForName("utf-7") ) {
+ if ( !TQTextCodec::codecForName("utf-7") ) {
kdDebug(5006) << "No Qt-native utf-7 codec found; registering QUtf7Codec from libkdenetwork" << endl;
(void) new QUtf7Codec();
}
@@ -153,24 +153,24 @@ KMKernel::KMKernel (QObject *parent, const char *name) :
// In the case of Japan. Japanese locale name is "eucjp" but
// The Japanese mail systems normally used "iso-2022-jp" of locale name.
// We want to change locale name from eucjp to iso-2022-jp at KMail only.
- if ( QCString(QTextCodec::codecForLocale()->name()).lower() == "eucjp" )
+ if ( TQCString(TQTextCodec::codecForLocale()->name()).lower() == "eucjp" )
{
- netCodec = QTextCodec::codecForName("jis7");
- // QTextCodec *cdc = QTextCodec::codecForName("jis7");
- // QTextCodec::setCodecForLocale(cdc);
+ netCodec = TQTextCodec::codecForName("jis7");
+ // TQTextCodec *cdc = TQTextCodec::codecForName("jis7");
+ // TQTextCodec::setCodecForLocale(cdc);
// KGlobal::locale()->setEncoding(cdc->mibEnum());
} else {
- netCodec = QTextCodec::codecForLocale();
+ netCodec = TQTextCodec::codecForLocale();
}
mMailService = new MailServiceImpl();
- connectDCOPSignal( 0, 0, "kmailSelectFolder(QString)",
- "selectFolder(QString)", false );
+ connectDCOPSignal( 0, 0, "kmailSelectFolder(TQString)",
+ "selectFolder(TQString)", false );
}
KMKernel::~KMKernel ()
{
- QMap<KIO::Job*, putData>::Iterator it = mPutJobs.begin();
+ TQMap<KIO::Job*, putData>::Iterator it = mPutJobs.begin();
while ( it != mPutJobs.end() )
{
KIO::Job *job = it.key();
@@ -193,7 +193,7 @@ KMKernel::~KMKernel ()
bool KMKernel::handleCommandLine( bool noArgsOpensReader )
{
- QString to, cc, bcc, subj, body;
+ TQString to, cc, bcc, subj, body;
QCStringList customHeaders;
KURL messageFile;
KURL::List attachURLs;
@@ -206,7 +206,7 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->getOption("subject"))
{
- subj = QString::fromLocal8Bit(args->getOption("subject"));
+ subj = TQString::fromLocal8Bit(args->getOption("subject"));
// if kmail is called with 'kmail -session abc' then this doesn't mean
// that the user wants to send a message with subject "ession" but
// (most likely) that the user clicked on KMail's system tray applet
@@ -215,7 +215,7 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
// command line arguments and those include "-session ..." if
// kmail/kontact was restored by session management
if ( subj == "ession" ) {
- subj = QString::null;
+ subj = TQString::null;
calledWithSession = true;
}
else
@@ -225,25 +225,25 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
if (args->getOption("cc"))
{
mailto = true;
- cc = QString::fromLocal8Bit(args->getOption("cc"));
+ cc = TQString::fromLocal8Bit(args->getOption("cc"));
}
if (args->getOption("bcc"))
{
mailto = true;
- bcc = QString::fromLocal8Bit(args->getOption("bcc"));
+ bcc = TQString::fromLocal8Bit(args->getOption("bcc"));
}
if (args->getOption("msg"))
{
mailto = true;
- messageFile.setPath( QString::fromLocal8Bit(args->getOption("msg")) );
+ messageFile.setPath( TQString::fromLocal8Bit(args->getOption("msg")) );
}
if (args->getOption("body"))
{
mailto = true;
- body = QString::fromLocal8Bit(args->getOption("body"));
+ body = TQString::fromLocal8Bit(args->getOption("body"));
}
QCStringList attachList = args->getOptionList("attach");
@@ -252,7 +252,7 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
mailto = true;
for ( QCStringList::Iterator it = attachList.begin() ; it != attachList.end() ; ++it )
if ( !(*it).isEmpty() )
- attachURLs += KURL( QString::fromLocal8Bit( *it ) );
+ attachURLs += KURL( TQString::fromLocal8Bit( *it ) );
}
customHeaders = args->getOptionList("header");
@@ -265,8 +265,8 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
if ( args->getOption( "view" ) ) {
viewOnly = true;
- const QString filename =
- QString::fromLocal8Bit( args->getOption( "view" ) );
+ const TQString filename =
+ TQString::fromLocal8Bit( args->getOption( "view" ) );
messageFile = KURL::fromPathOrURL( filename );
if ( !messageFile.isValid() ) {
messageFile = KURL();
@@ -282,7 +282,7 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader )
if (strncasecmp(args->arg(i),"mailto:",7)==0)
to += args->url(i).path() + ", ";
else {
- QString tmpArg = QString::fromLocal8Bit( args->arg(i) );
+ TQString tmpArg = TQString::fromLocal8Bit( args->arg(i) );
KURL url( tmpArg );
if ( url.isValid() )
attachURLs += url;
@@ -319,12 +319,12 @@ void KMKernel::checkMail () //might create a new reader but won't show!!
kmkernel->acctMgr()->checkMail(false);
}
-QStringList KMKernel::accounts()
+TQStringList KMKernel::accounts()
{
return kmkernel->acctMgr()->getAccounts();
}
-void KMKernel::checkAccount (const QString &account) //might create a new reader but won't show!!
+void KMKernel::checkAccount (const TQString &account) //might create a new reader but won't show!!
{
kdDebug(5006) << "KMKernel::checkMail called" << endl;
@@ -333,11 +333,11 @@ void KMKernel::checkAccount (const QString &account) //might create a new reader
kmkernel->acctMgr()->singleCheckMail(acct, false);
}
-void KMKernel::loadProfile( const QString& )
+void KMKernel::loadProfile( const TQString& )
{
}
-void KMKernel::saveToProfile( const QString& ) const
+void KMKernel::saveToProfile( const TQString& ) const
{
}
@@ -374,9 +374,9 @@ void KMKernel::openReader( bool onlyCheck )
}
}
-int KMKernel::openComposer (const QString &to, const QString &cc,
- const QString &bcc, const QString &subject,
- const QString &body, int hidden,
+int KMKernel::openComposer (const TQString &to, const TQString &cc,
+ const TQString &bcc, const TQString &subject,
+ const TQString &body, int hidden,
const KURL &messageFile,
const KURL::List &attachURLs,
const QCStringList &customHeaders)
@@ -395,9 +395,9 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
msg->setBcc( KMMsgBase::decodeRFC2047String( bcc.latin1() ) );
if (!subject.isEmpty()) msg->setSubject(subject);
if (!messageFile.isEmpty() && messageFile.isLocalFile()) {
- QCString str = KPIM::kFileToString( messageFile.path(), true, false );
+ TQCString str = KPIM::kFileToString( messageFile.path(), true, false );
if( !str.isEmpty() ) {
- msg->setBody( QString::fromLocal8Bit( str ).utf8() );
+ msg->setBody( TQString::fromLocal8Bit( str ).utf8() );
} else {
TemplateParser parser( msg, TemplateParser::NewMessage,
"", false, false, false, false );
@@ -423,7 +423,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
const int pos = (*it).find( ':' );
if ( pos > 0 )
{
- QCString header, value;
+ TQCString header, value;
header = (*it).left( pos ).stripWhiteSpace();
value = (*it).mid( pos+1 ).stripWhiteSpace();
if ( !header.isEmpty() && !value.isEmpty() )
@@ -448,38 +448,38 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
}
-int KMKernel::openComposer (const QString &to, const QString &cc,
- const QString &bcc, const QString &subject,
- const QString &body, int hidden,
- const QString &attachName,
- const QCString &attachCte,
- const QCString &attachData,
- const QCString &attachType,
- const QCString &attachSubType,
- const QCString &attachParamAttr,
- const QString &attachParamValue,
- const QCString &attachContDisp )
+int KMKernel::openComposer (const TQString &to, const TQString &cc,
+ const TQString &bcc, const TQString &subject,
+ const TQString &body, int hidden,
+ const TQString &attachName,
+ const TQCString &attachCte,
+ const TQCString &attachData,
+ const TQCString &attachType,
+ const TQCString &attachSubType,
+ const TQCString &attachParamAttr,
+ const TQString &attachParamValue,
+ const TQCString &attachContDisp )
{
kdDebug(5006) << "KMKernel::openComposer called (deprecated version)" << endl;
return openComposer ( to, cc, bcc, subject, body, hidden,
attachName, attachCte, attachData,
attachType, attachSubType, attachParamAttr,
- attachParamValue, attachContDisp, QCString() );
-}
-
-int KMKernel::openComposer (const QString &to, const QString &cc,
- const QString &bcc, const QString &subject,
- const QString &body, int hidden,
- const QString &attachName,
- const QCString &attachCte,
- const QCString &attachData,
- const QCString &attachType,
- const QCString &attachSubType,
- const QCString &attachParamAttr,
- const QString &attachParamValue,
- const QCString &attachContDisp,
- const QCString &attachCharset )
+ attachParamValue, attachContDisp, TQCString() );
+}
+
+int KMKernel::openComposer (const TQString &to, const TQString &cc,
+ const TQString &bcc, const TQString &subject,
+ const TQString &body, int hidden,
+ const TQString &attachName,
+ const TQCString &attachCte,
+ const TQCString &attachData,
+ const TQCString &attachType,
+ const TQCString &attachSubType,
+ const TQCString &attachParamAttr,
+ const TQString &attachParamValue,
+ const TQCString &attachContDisp,
+ const TQCString &attachCharset )
{
kdDebug(5006) << "KMKernel::openComposer()" << endl;
@@ -516,7 +516,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
// KOrganizer invitation caught and to be sent as body instead
msg->setBody( attachData );
msg->setHeaderField( "Content-Type",
- QString( "text/calendar; method=%1; "
+ TQString( "text/calendar; method=%1; "
"charset=\"utf-8\"" ).
arg( attachParamValue ) );
@@ -572,10 +572,10 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
return 1;
}
-void KMKernel::setDefaultTransport( const QString & transport )
+void KMKernel::setDefaultTransport( const TQString & transport )
{
- QStringList availTransports = KMail::TransportManager::transportNames();
- QStringList::const_iterator it = availTransports.find( transport );
+ TQStringList availTransports = KMail::TransportManager::transportNames();
+ TQStringList::const_iterator it = availTransports.find( transport );
if ( it == availTransports.end() ) {
kdWarning() << "The transport you entered is not available" << endl;
return;
@@ -583,9 +583,9 @@ void KMKernel::setDefaultTransport( const QString & transport )
GlobalSettings::self()->setDefaultTransport( transport );
}
-DCOPRef KMKernel::openComposer(const QString &to, const QString &cc,
- const QString &bcc, const QString &subject,
- const QString &body,bool hidden)
+DCOPRef KMKernel::openComposer(const TQString &to, const TQString &cc,
+ const TQString &bcc, const TQString &subject,
+ const TQString &body,bool hidden)
{
KMMessage *msg = new KMMessage;
msg->initHeader();
@@ -616,9 +616,9 @@ DCOPRef KMKernel::openComposer(const QString &to, const QString &cc,
return DCOPRef( cWin->asMailComposerIFace() );
}
-DCOPRef KMKernel::newMessage(const QString &to,
- const QString &cc,
- const QString &bcc,
+DCOPRef KMKernel::newMessage(const TQString &to,
+ const TQString &cc,
+ const TQString &bcc,
bool hidden,
bool useFolderId,
const KURL & /*messageFile*/,
@@ -676,7 +676,7 @@ int KMKernel::viewMessage( const KURL & messageFile )
return 1;
}
-int KMKernel::sendCertificate( const QString& to, const QByteArray& certData )
+int KMKernel::sendCertificate( const TQString& to, const TQByteArray& certData )
{
KMMessage *msg = new KMMessage;
msg->initHeader();
@@ -704,7 +704,7 @@ int KMKernel::sendCertificate( const QString& to, const QByteArray& certData )
return 1;
}
-KMMsgStatus KMKernel::strToStatus(const QString &flags)
+KMMsgStatus KMKernel::strToStatus(const TQString &flags)
{
KMMsgStatus status = 0;
if (!flags.isEmpty()) {
@@ -769,14 +769,14 @@ KMMsgStatus KMKernel::strToStatus(const QString &flags)
return status;
}
-int KMKernel::dcopAddMessage( const QString & foldername, const QString & msgUrlString,
- const QString & MsgStatusFlags)
+int KMKernel::dcopAddMessage( const TQString & foldername, const TQString & msgUrlString,
+ const TQString & MsgStatusFlags)
{
return dcopAddMessage(foldername, KURL(msgUrlString), MsgStatusFlags);
}
-int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
- const QString & MsgStatusFlags)
+int KMKernel::dcopAddMessage( const TQString & foldername,const KURL & msgUrl,
+ const TQString & MsgStatusFlags)
{
kdDebug(5006) << "KMKernel::dcopAddMessage called" << endl;
@@ -785,7 +785,7 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
int retval;
bool readFolderMsgIds = false;
- QString _foldername = foldername.stripWhiteSpace();
+ TQString _foldername = foldername.stripWhiteSpace();
_foldername = _foldername.replace('\\',""); //try to prevent ESCAPE Sequences
if ( foldername != mAddMessageLastFolder ) {
@@ -799,11 +799,11 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
// This is a proposed change by Daniel Andor.
// He proposed to change from the fopen(blah)
// to a KPIM::kFileToString(blah).
- // Although it assigns a QString to a QString,
+ // Although it assigns a TQString to a TQString,
// because of the implicit sharing this poses
// no memory or performance penalty.
- const QCString messageText =
+ const TQCString messageText =
KPIM::kFileToString( msgUrl.path(), true, false );
if ( messageText.isEmpty() )
return -2;
@@ -813,15 +813,15 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
if (readFolderMsgIds) {
if ( foldername.contains("/")) {
- QString tmp_fname = "";
+ TQString tmp_fname = "";
KMFolder *folder = NULL;
KMFolderDir *subfolder;
bool root = true;
- QStringList subFList = QStringList::split("/",_foldername,false);
+ TQStringList subFList = TQStringList::split("/",_foldername,false);
- for ( QStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) {
- QString _newFolder = *it;
+ for ( TQStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) {
+ TQString _newFolder = *it;
if(_newFolder.startsWith(".")) return -1;
if(root) {
@@ -866,7 +866,7 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
// subject line + the date is only unique if the following
// return a correct unique value:
// time_t DT = mb->date();
- // QString dt = ctime(&DT);
+ // TQString dt = ctime(&DT);
// But if the datestring in the Header isn't RFC conform
// subject line + the date isn't unique.
//
@@ -879,7 +879,7 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
mAddMsgCurrentFolder->open("dcopadd");
for( i=0; i<mAddMsgCurrentFolder->count(); i++) {
KMMsgBase *mb = mAddMsgCurrentFolder->getMsgBase(i);
- QString id = mb->msgIdMD5();
+ TQString id = mb->msgIdMD5();
if ( id.isEmpty() ) {
id = mb->subject();
if ( id.isEmpty() )
@@ -898,7 +898,7 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
mAddMsgCurrentFolder->close("dcopadd");
}
- QString msgId = msg->msgIdMD5();
+ TQString msgId = msg->msgIdMD5();
if ( msgId.isEmpty()) {
msgId = msg->subject();
if ( msgId.isEmpty() )
@@ -947,19 +947,19 @@ int KMKernel::dcopAddMessage( const QString & foldername,const KURL & msgUrl,
void KMKernel::dcopResetAddMessage()
{
mAddMessageMsgIds.clear();
- mAddMessageLastFolder = QString();
+ mAddMessageLastFolder = TQString();
}
-int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
- const QString & msgUrlString,
- const QString & MsgStatusFlags)
+int KMKernel::dcopAddMessage_fastImport( const TQString & foldername,
+ const TQString & msgUrlString,
+ const TQString & MsgStatusFlags)
{
return dcopAddMessage_fastImport(foldername, KURL(msgUrlString), MsgStatusFlags);
}
-int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
+int KMKernel::dcopAddMessage_fastImport( const TQString & foldername,
const KURL & msgUrl,
- const QString & MsgStatusFlags)
+ const TQString & MsgStatusFlags)
{
// Use this function to import messages without
// search for already existing emails.
@@ -971,7 +971,7 @@ int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
int retval;
bool createNewFolder = false;
- QString _foldername = foldername.stripWhiteSpace();
+ TQString _foldername = foldername.stripWhiteSpace();
_foldername = _foldername.replace('\\',""); //try to prevent ESCAPE Sequences
if ( foldername != mAddMessageLastFolder ) {
@@ -981,7 +981,7 @@ int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
if ( !msgUrl.isEmpty() && msgUrl.isLocalFile() ) {
- const QCString messageText =
+ const TQCString messageText =
KPIM::kFileToString( msgUrl.path(), true, false );
if ( messageText.isEmpty() )
return -2;
@@ -991,15 +991,15 @@ int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
if (createNewFolder) {
if ( foldername.contains("/")) {
- QString tmp_fname = "";
+ TQString tmp_fname = "";
KMFolder *folder = NULL;
KMFolderDir *subfolder;
bool root = true;
- QStringList subFList = QStringList::split("/",_foldername,false);
+ TQStringList subFList = TQStringList::split("/",_foldername,false);
- for ( QStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) {
- QString _newFolder = *it;
+ for ( TQStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) {
+ TQString _newFolder = *it;
if(_newFolder.startsWith(".")) return -1;
if(root) {
@@ -1053,10 +1053,10 @@ int KMKernel::dcopAddMessage_fastImport( const QString & foldername,
return retval;
}
-QStringList KMKernel::folderList() const
+TQStringList KMKernel::folderList() const
{
- QStringList folders;
- const QString localPrefix = "/Local";
+ TQStringList folders;
+ const TQString localPrefix = "/Local";
folders << localPrefix;
the_folderMgr->getFolderURLS( folders, localPrefix );
the_imapFolderMgr->getFolderURLS( folders );
@@ -1064,9 +1064,9 @@ QStringList KMKernel::folderList() const
return folders;
}
-DCOPRef KMKernel::getFolder( const QString& vpath )
+DCOPRef KMKernel::getFolder( const TQString& vpath )
{
- const QString localPrefix = "/Local";
+ const TQString localPrefix = "/Local";
if ( the_folderMgr->getFolderByURL( vpath ) )
return DCOPRef( new FolderIface( vpath ) );
else if ( vpath.startsWith( localPrefix ) &&
@@ -1085,12 +1085,12 @@ void KMKernel::raise()
kmail.call( "newInstance" );
}
-bool KMKernel::showMail( Q_UINT32 serialNumber, QString /* messageId */ )
+bool KMKernel::showMail( Q_UINT32 serialNumber, TQString /* messageId */ )
{
KMMainWidget *mainWidget = 0;
if (KMainWindow::memberList) {
KMainWindow *win = 0;
- QObjectList *l;
+ TQObjectList *l;
// First look for a KMainWindow.
for (win = KMainWindow::memberList->first(); win;
@@ -1134,34 +1134,34 @@ bool KMKernel::showMail( Q_UINT32 serialNumber, QString /* messageId */ )
return false;
}
-QString KMKernel::getFrom( Q_UINT32 serialNumber )
+TQString KMKernel::getFrom( Q_UINT32 serialNumber )
{
int idx = -1;
KMFolder *folder = 0;
KMMsgDict::instance()->getLocation(serialNumber, &folder, &idx);
if (!folder || (idx == -1))
- return QString::null;
+ return TQString::null;
KMFolderOpener openFolder(folder, "getFrom");
KMMsgBase *msgBase = folder->getMsgBase(idx);
if (!msgBase)
- return QString::null;
+ return TQString::null;
bool unGet = !msgBase->isMessage();
KMMessage *msg = folder->getMsg(idx);
- QString result = msg->from();
+ TQString result = msg->from();
if (unGet)
folder->unGetMsg(idx);
return result;
}
-QString KMKernel::debugScheduler()
+TQString KMKernel::debugScheduler()
{
- QString res = KMail::ActionScheduler::debug();
+ TQString res = KMail::ActionScheduler::debug();
return res;
}
-QString KMKernel::debugSernum( Q_UINT32 serialNumber )
+TQString KMKernel::debugSernum( Q_UINT32 serialNumber )
{
- QString res;
+ TQString res;
if (serialNumber != 0) {
int idx = -1;
KMFolder *folder = 0;
@@ -1174,15 +1174,15 @@ QString KMKernel::debugSernum( Q_UINT32 serialNumber )
KMFolderOpener openFolder(folder, "debugser");
msg = folder->getMsgBase( idx );
if (msg) {
- res.append( QString( " subject %s,\n sender %s,\n date %s.\n" )
+ res.append( TQString( " subject %s,\n sender %s,\n date %s.\n" )
.arg( msg->subject() )
.arg( msg->fromStrip() )
.arg( msg->dateStr() ) );
} else {
- res.append( QString( "Invalid serial number." ) );
+ res.append( TQString( "Invalid serial number." ) );
}
} else {
- res.append( QString( "Invalid serial number." ) );
+ res.append( TQString( "Invalid serial number." ) );
}
}
return res;
@@ -1265,7 +1265,7 @@ void KMKernel::quit()
/* TODO later:
Asuming that:
- msgsender is nonblocking
- (our own, QSocketNotifier based. Pops up errors and sends signal
+ (our own, TQSocketNotifier based. Pops up errors and sends signal
senderFinished when done)
o If we are getting mail, stop it (but dont lose something!)
@@ -1310,14 +1310,14 @@ void KMKernel::slotSenderFinished()
/********************************************************************/
void KMKernel::testDir(const char *_name)
{
- QString foldersPath = QDir::homeDirPath() + QString( _name );
- QFileInfo info( foldersPath );
+ TQString foldersPath = TQDir::homeDirPath() + TQString( _name );
+ TQFileInfo info( foldersPath );
if ( !info.exists() ) {
- if ( ::mkdir( QFile::encodeName( foldersPath ) , S_IRWXU ) == -1 ) {
+ if ( ::mkdir( TQFile::encodeName( foldersPath ) , S_IRWXU ) == -1 ) {
KMessageBox::sorry(0, i18n("KMail could not create folder '%1';\n"
"please make sure that you can view and "
"modify the content of the folder '%2'.")
- .arg( foldersPath ).arg( QDir::homeDirPath() ) );
+ .arg( foldersPath ).arg( TQDir::homeDirPath() ) );
::exit(-1);
}
}
@@ -1336,8 +1336,8 @@ void KMKernel::testDir(const char *_name)
// Open a composer for each message found in the dead.letter folder
void KMKernel::recoverDeadLetters()
{
- const QString pathName = localDataPath();
- QDir dir( pathName );
+ const TQString pathName = localDataPath();
+ TQDir dir( pathName );
if ( !dir.exists( "autosave" ) )
return;
@@ -1363,7 +1363,7 @@ void KMKernel::recoverDeadLetters()
//-----------------------------------------------------------------------------
void KMKernel::initFolders(KConfig* cfg)
{
- QString name;
+ TQString name;
name = cfg->readEntry("inboxFolder");
@@ -1381,7 +1381,7 @@ void KMKernel::initFolders(KConfig* cfg)
the_inboxFolder->setSystemFolder(true);
if ( the_inboxFolder->userWhoField().isEmpty() )
- the_inboxFolder->setUserWhoField( QString::null );
+ the_inboxFolder->setUserWhoField( TQString::null );
// inboxFolder->open();
the_outboxFolder = the_folderMgr->findOrCreate(cfg->readEntry("outboxFolder", I18N_NOOP("outbox")));
@@ -1392,7 +1392,7 @@ void KMKernel::initFolders(KConfig* cfg)
the_outboxFolder->setSystemFolder(true);
if ( the_outboxFolder->userWhoField().isEmpty() )
- the_outboxFolder->setUserWhoField( QString::null );
+ the_outboxFolder->setUserWhoField( TQString::null );
/* Nuke the oubox's index file, to make sure that no ghost messages are in
* it from a previous crash. Ghost messages happen in the outbox because it
* the only folder where messages enter and leave within 5 seconds, which is
@@ -1400,7 +1400,7 @@ void KMKernel::initFolders(KConfig* cfg)
* this folder is expected to be very small, we can live with regenerating
* the index on each start to be on the save side. */
//if ( the_outboxFolder->folderType() == KMFolderTypeMaildir )
- // unlink( QFile::encodeName( the_outboxFolder->indexLocation() ) );
+ // unlink( TQFile::encodeName( the_outboxFolder->indexLocation() ) );
the_outboxFolder->open("kmkernel");
the_sentFolder = the_folderMgr->findOrCreate(cfg->readEntry("sentFolder", I18N_NOOP("sent-mail")));
@@ -1409,7 +1409,7 @@ void KMKernel::initFolders(KConfig* cfg)
}
the_sentFolder->setSystemFolder(true);
if ( the_sentFolder->userWhoField().isEmpty() )
- the_sentFolder->setUserWhoField( QString::null );
+ the_sentFolder->setUserWhoField( TQString::null );
// the_sentFolder->open();
the_trashFolder = the_folderMgr->findOrCreate(cfg->readEntry("trashFolder", I18N_NOOP("trash")));
@@ -1418,7 +1418,7 @@ void KMKernel::initFolders(KConfig* cfg)
}
the_trashFolder->setSystemFolder( true );
if ( the_trashFolder->userWhoField().isEmpty() )
- the_trashFolder->setUserWhoField( QString::null );
+ the_trashFolder->setUserWhoField( TQString::null );
// the_trashFolder->open();
the_draftsFolder = the_folderMgr->findOrCreate(cfg->readEntry("draftsFolder", I18N_NOOP("drafts")));
@@ -1427,7 +1427,7 @@ void KMKernel::initFolders(KConfig* cfg)
}
the_draftsFolder->setSystemFolder( true );
if ( the_draftsFolder->userWhoField().isEmpty() )
- the_draftsFolder->setUserWhoField( QString::null );
+ the_draftsFolder->setUserWhoField( TQString::null );
the_draftsFolder->open("kmkernel");
the_templatesFolder =
@@ -1438,7 +1438,7 @@ void KMKernel::initFolders(KConfig* cfg)
}
the_templatesFolder->setSystemFolder( true );
if ( the_templatesFolder->userWhoField().isEmpty() )
- the_templatesFolder->setUserWhoField( QString::null );
+ the_templatesFolder->setUserWhoField( TQString::null );
the_templatesFolder->open("kmkernel");
}
@@ -1450,14 +1450,14 @@ void KMKernel::init()
KConfig* cfg = KMKernel::config();
- QDir dir;
+ TQDir dir;
KConfigGroupSaver saver(cfg, "General");
the_firstStart = cfg->readBoolEntry("first-start", true);
cfg->writeEntry("first-start", false);
the_previousVersion = cfg->readEntry("previous-version");
cfg->writeEntry("previous-version", KMAIL_VERSION);
- QString foldersPath = cfg->readPathEntry( "folders" );
+ TQString foldersPath = cfg->readPathEntry( "folders" );
kdDebug(5006) << k_funcinfo << "foldersPath (from config): '" << foldersPath << "'" << endl;
if ( foldersPath.isEmpty() ) {
@@ -1517,17 +1517,17 @@ void KMKernel::init()
the_weaverLogger->attach (the_weaver);
//#endif
- connect( the_folderMgr, SIGNAL( folderRemoved(KMFolder*) ),
- this, SIGNAL( folderRemoved(KMFolder*) ) );
- connect( the_dimapFolderMgr, SIGNAL( folderRemoved(KMFolder*) ),
- this, SIGNAL( folderRemoved(KMFolder*) ) );
- connect( the_imapFolderMgr, SIGNAL( folderRemoved(KMFolder*) ),
- this, SIGNAL( folderRemoved(KMFolder*) ) );
- connect( the_searchFolderMgr, SIGNAL( folderRemoved(KMFolder*) ),
- this, SIGNAL( folderRemoved(KMFolder*) ) );
-
- mBackgroundTasksTimer = new QTimer( this, "mBackgroundTasksTimer" );
- connect( mBackgroundTasksTimer, SIGNAL( timeout() ), this, SLOT( slotRunBackgroundTasks() ) );
+ connect( the_folderMgr, TQT_SIGNAL( folderRemoved(KMFolder*) ),
+ this, TQT_SIGNAL( folderRemoved(KMFolder*) ) );
+ connect( the_dimapFolderMgr, TQT_SIGNAL( folderRemoved(KMFolder*) ),
+ this, TQT_SIGNAL( folderRemoved(KMFolder*) ) );
+ connect( the_imapFolderMgr, TQT_SIGNAL( folderRemoved(KMFolder*) ),
+ this, TQT_SIGNAL( folderRemoved(KMFolder*) ) );
+ connect( the_searchFolderMgr, TQT_SIGNAL( folderRemoved(KMFolder*) ),
+ this, TQT_SIGNAL( folderRemoved(KMFolder*) ) );
+
+ mBackgroundTasksTimer = new TQTimer( this, "mBackgroundTasksTimer" );
+ connect( mBackgroundTasksTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotRunBackgroundTasks() ) );
#ifdef DEBUG_SCHEDULER // for debugging, see jobscheduler.h
mBackgroundTasksTimer->start( 10000, true ); // 10s, singleshot
#else
@@ -1582,7 +1582,7 @@ void KMKernel::cleanupImapFolders()
if (acct->type() != "imap") continue;
fld = static_cast<KMFolderImap*>(the_imapFolderMgr
- ->findOrCreate(QString::number(acct->id()), false, acct->id())->storage());
+ ->findOrCreate(TQString::number(acct->id()), false, acct->id())->storage());
fld->setNoContent(true);
fld->folder()->setLabel(acct->name());
imapAcct = static_cast<KMAcctImap*>(acct);
@@ -1600,12 +1600,12 @@ void KMKernel::cleanupImapFolders()
if (acct->type() != "cachedimap" ) continue;
- KMFolder* fld = the_dimapFolderMgr->find(QString::number(acct->id()));
+ KMFolder* fld = the_dimapFolderMgr->find(TQString::number(acct->id()));
if( fld )
cfld = static_cast<KMFolderCachedImap*>( fld->storage() );
if (cfld == 0) {
// Folder doesn't exist yet
- cfld = static_cast<KMFolderCachedImap*>(the_dimapFolderMgr->createFolder(QString::number(acct->id()),
+ cfld = static_cast<KMFolderCachedImap*>(the_dimapFolderMgr->createFolder(TQString::number(acct->id()),
false, KMFolderTypeCachedImap)->storage());
if (!cfld) {
KMessageBox::error(0,(i18n("Cannot create file `%1' in %2.\nKMail cannot start without it.").arg(acct->name()).arg(the_dimapFolderMgr->basePath())));
@@ -1644,7 +1644,7 @@ bool KMKernel::doSessionManagement()
void KMKernel::closeAllKMailWindows()
{
if (!KMainWindow::memberList) return;
- QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
+ TQPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
KMainWindow *window = 0;
while ((window = it.current()) != 0) {
++it;
@@ -1694,8 +1694,8 @@ void KMKernel::cleanup(void)
mICalIface->cleanup();
- QValueList<QGuardedPtr<KMFolder> > folders;
- QStringList strList;
+ TQValueList<TQGuardedPtr<KMFolder> > folders;
+ TQStringList strList;
KMFolder *folder;
the_folderMgr->createFolderList(&strList, &folders);
for (int i = 0; folders.at(i) != folders.end(); i++)
@@ -1735,14 +1735,14 @@ void KMKernel::cleanup(void)
config->sync();
}
-bool KMKernel::transferMail( QString & destinationDir )
+bool KMKernel::transferMail( TQString & destinationDir )
{
- QString dir;
+ TQString dir;
// check whether the user has a ~/KMail folder
- QFileInfo fi( QDir::home(), "KMail" );
+ TQFileInfo fi( TQDir::home(), "KMail" );
if ( fi.exists() && fi.isDir() ) {
- dir = QDir::homeDirPath() + "/KMail";
+ dir = TQDir::homeDirPath() + "/KMail";
// the following two lines can be removed once moving mail is reactivated
destinationDir = dir;
return true;
@@ -1750,12 +1750,12 @@ bool KMKernel::transferMail( QString & destinationDir )
if ( dir.isEmpty() ) {
// check whether the user has a ~/Mail folder
- fi.setFile( QDir::home(), "Mail" );
+ fi.setFile( TQDir::home(), "Mail" );
if ( fi.exists() && fi.isDir() &&
- QFile::exists( QDir::homeDirPath() + "/Mail/.inbox.index" ) ) {
+ TQFile::exists( TQDir::homeDirPath() + "/Mail/.inbox.index" ) ) {
// there's a ~/Mail folder which seems to be used by KMail (because of the
// index file)
- dir = QDir::homeDirPath() + "/Mail";
+ dir = TQDir::homeDirPath() + "/Mail";
// the following two lines can be removed once moving mail is reactivated
destinationDir = dir;
return true;
@@ -1768,8 +1768,8 @@ bool KMKernel::transferMail( QString & destinationDir )
#if 0
// disabled for now since moving fails in certain cases (e.g. if symbolic links are involved)
- const QString kmailName = kapp->aboutData()->programName();
- QString msg;
+ const TQString kmailName = kapp->aboutData()->programName();
+ TQString msg;
if ( KIO::NetAccess::exists( destinationDir, true, 0 ) ) {
// if destinationDir exists, we need to warn about possible
// overwriting of files. otherwise, we don't have to
@@ -1795,8 +1795,8 @@ bool KMKernel::transferMail( QString & destinationDir )
.arg( kmailName, kmailName, kmailName )
.arg( dir, destinationDir, dir );
}
- QString title = i18n( "Migrate Mail Files?" );
- QString buttonText = i18n( "Move" );
+ TQString title = i18n( "Migrate Mail Files?" );
+ TQString buttonText = i18n( "Move" );
if ( KMessageBox::questionYesNo( 0, msg, title, buttonText, i18n("Do Not Move") ) ==
KMessageBox::No ) {
@@ -1820,7 +1820,7 @@ bool KMKernel::transferMail( QString & destinationDir )
void KMKernel::ungrabPtrKb(void)
{
if(!KMainWindow::memberList) return;
- QWidget* widg = KMainWindow::memberList->first();
+ TQWidget* widg = KMainWindow::memberList->first();
Display* dpy;
if (!widg) return;
@@ -1865,16 +1865,16 @@ void KMKernel::dumpDeadLetters()
if ( !KMainWindow::memberList )
return;
- for ( QPtrListIterator<KMainWindow> it(*KMainWindow::memberList) ; it.current() != 0; ++it )
+ for ( TQPtrListIterator<KMainWindow> it(*KMainWindow::memberList) ; it.current() != 0; ++it )
if ( KMail::Composer * win = ::qt_cast<KMail::Composer*>( it.current() ) )
win->autoSaveMessage();
}
-void KMKernel::action(bool mailto, bool check, const QString &to,
- const QString &cc, const QString &bcc,
- const QString &subj, const QString &body,
+void KMKernel::action(bool mailto, bool check, const TQString &to,
+ const TQString &cc, const TQString &bcc,
+ const TQString &subj, const TQString &body,
const KURL &messageFile,
const KURL::List &attachURLs,
const QCStringList &customHeaders)
@@ -1889,24 +1889,24 @@ void KMKernel::action(bool mailto, bool check, const QString &to,
//Anything else?
}
-void KMKernel::byteArrayToRemoteFile(const QByteArray &aData, const KURL &aURL,
+void KMKernel::byteArrayToRemoteFile(const TQByteArray &aData, const KURL &aURL,
bool overwrite)
{
// ## when KDE 3.3 is out: use KIO::storedPut to remove slotDataReq altogether
KIO::Job *job = KIO::put(aURL, -1, overwrite, false);
putData pd; pd.url = aURL; pd.data = aData; pd.offset = 0;
mPutJobs.insert(job, pd);
- connect(job, SIGNAL(dataReq(KIO::Job*,QByteArray&)),
- SLOT(slotDataReq(KIO::Job*,QByteArray&)));
- connect(job, SIGNAL(result(KIO::Job*)),
- SLOT(slotResult(KIO::Job*)));
+ connect(job, TQT_SIGNAL(dataReq(KIO::Job*,TQByteArray&)),
+ TQT_SLOT(slotDataReq(KIO::Job*,TQByteArray&)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotResult(KIO::Job*)));
}
-void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data)
+void KMKernel::slotDataReq(KIO::Job *job, TQByteArray &data)
{
// send the data in 64 KB chunks
const int MAX_CHUNK_SIZE = 64*1024;
- QMap<KIO::Job*, putData>::Iterator it = mPutJobs.find(job);
+ TQMap<KIO::Job*, putData>::Iterator it = mPutJobs.find(job);
assert(it != mPutJobs.end());
int remainingBytes = (*it).data.size() - (*it).offset;
if( remainingBytes > MAX_CHUNK_SIZE )
@@ -1921,7 +1921,7 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data)
{
// send the remaining bytes to the receiver (deep copy)
data.duplicate( (*it).data.data() + (*it).offset, remainingBytes );
- (*it).data = QByteArray();
+ (*it).data = TQByteArray();
(*it).offset = 0;
//kdDebug( 5006 ) << "Sending " << remainingBytes << " bytes\n";
}
@@ -1929,7 +1929,7 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data)
void KMKernel::slotResult(KIO::Job *job)
{
- QMap<KIO::Job*, putData>::Iterator it = mPutJobs.find(job);
+ TQMap<KIO::Job*, putData>::Iterator it = mPutJobs.find(job);
assert(it != mPutJobs.end());
if (job->error())
{
@@ -1955,8 +1955,8 @@ void KMKernel::slotShowConfigurationDialog()
{
if( !mConfigureDialog ) {
mConfigureDialog = new ConfigureDialog( 0, "configure", false );
- connect( mConfigureDialog, SIGNAL( configCommitted() ),
- this, SLOT( slotConfigChanged() ) );
+ connect( mConfigureDialog, TQT_SIGNAL( configCommitted() ),
+ this, TQT_SLOT( slotConfigChanged() ) );
}
if( KMKernel::getKMMainWidget() == 0 )
@@ -1982,7 +1982,7 @@ void KMKernel::slotConfigChanged()
//-------------------------------------------------------------------------------
//static
-QString KMKernel::localDataPath()
+TQString KMKernel::localDataPath()
{
return locateLocal( "data", "kmail/" );
}
@@ -2006,7 +2006,7 @@ bool KMKernel::registerSystemTrayApplet( const KSystemTray* applet )
bool KMKernel::unregisterSystemTrayApplet( const KSystemTray* applet )
{
- QValueList<const KSystemTray*>::iterator it =
+ TQValueList<const KSystemTray*>::iterator it =
systemTrayApplets.find( applet );
if ( it != systemTrayApplets.end() ) {
systemTrayApplets.remove( it );
@@ -2016,9 +2016,9 @@ bool KMKernel::unregisterSystemTrayApplet( const KSystemTray* applet )
return false;
}
-void KMKernel::emergencyExit( const QString& reason )
+void KMKernel::emergencyExit( const TQString& reason )
{
- QString mesg;
+ TQString mesg;
if ( reason.length() == 0 ) {
mesg = i18n("KMail encountered a fatal error and will terminate now");
} else {
@@ -2049,7 +2049,7 @@ bool KMKernel::folderIsDrafts(const KMFolder * folder)
if ( folder == the_draftsFolder )
return true;
- QString idString = folder->idString();
+ TQString idString = folder->idString();
if ( idString.isEmpty() )
return false;
@@ -2067,7 +2067,7 @@ bool KMKernel::folderIsTemplates( const KMFolder *folder )
if ( folder == the_templatesFolder )
return true;
- QString idString = folder->idString();
+ TQString idString = folder->idString();
if ( idString.isEmpty() )
return false;
@@ -2083,8 +2083,8 @@ bool KMKernel::folderIsTrash(KMFolder * folder)
{
assert(folder);
if (folder == the_trashFolder) return true;
- QStringList actList = acctMgr()->getAccounts();
- QStringList::Iterator it( actList.begin() );
+ TQStringList actList = acctMgr()->getAccounts();
+ TQStringList::Iterator it( actList.begin() );
for( ; it != actList.end() ; ++it ) {
KMAccount* act = acctMgr()->findByName( *it );
if ( act && ( act->trash() == folder->idString() ) )
@@ -2099,7 +2099,7 @@ bool KMKernel::folderIsSentMailFolder( const KMFolder * folder )
if ( folder == the_sentFolder )
return true;
- QString idString = folder->idString();
+ TQString idString = folder->idString();
if ( idString.isEmpty() ) return false;
// search the identities if the folder matches the sent-folder
@@ -2155,8 +2155,8 @@ KMainWindow* KMKernel::mainWin()
*/
void KMKernel::slotEmptyTrash()
{
- QString title = i18n("Empty Trash");
- QString text = i18n("Are you sure you want to empty the trash folders of all accounts?");
+ TQString title = i18n("Empty Trash");
+ TQString text = i18n("Are you sure you want to empty the trash folders of all accounts?");
if (KMessageBox::warningContinueCancel(0, text, title,
KStdGuiItem::cont(), "confirm_empty_trash")
!= KMessageBox::Continue)
@@ -2192,10 +2192,10 @@ KMailICalIfaceImpl& KMKernel::iCalIface()
return *mICalIface;
}
-void KMKernel::selectFolder( QString folderPath )
+void KMKernel::selectFolder( TQString folderPath )
{
kdDebug(5006)<<"Selecting a folder "<<folderPath<<endl;
- const QString localPrefix = "/Local";
+ const TQString localPrefix = "/Local";
KMFolder *folder = kmkernel->folderMgr()->getFolderByURL( folderPath );
if ( !folder && folderPath.startsWith( localPrefix ) )
folder = the_folderMgr->getFolderByURL( folderPath.mid( localPrefix.length() ) );
@@ -2218,13 +2218,13 @@ void KMKernel::selectFolder( QString folderPath )
KMMainWidget *KMKernel::getKMMainWidget()
{
//This could definitely use a speadup
- QWidgetList *l = kapp->topLevelWidgets();
- QWidgetListIt it( *l );
- QWidget *wid;
+ TQWidgetList *l = kapp->topLevelWidgets();
+ TQWidgetListIt it( *l );
+ TQWidget *wid;
while ( ( wid = it.current() ) != 0 ) {
++it;
- QObjectList *l2 = wid->topLevelWidget()->queryList( "KMMainWidget" );
+ TQObjectList *l2 = wid->topLevelWidget()->queryList( "KMMainWidget" );
if (l2 && l2->first()) {
KMMainWidget* kmmw = dynamic_cast<KMMainWidget *>( l2->first() );
Q_ASSERT( kmmw );
@@ -2280,7 +2280,7 @@ void KMKernel::compactAllFolders() // called by the GUI
the_dimapFolderMgr->compactAllFolders( true /*immediate*/ );
}
-KMFolder* KMKernel::findFolderById( const QString& idString )
+KMFolder* KMKernel::findFolderById( const TQString& idString )
{
KMFolder * folder = the_folderMgr->findIdString( idString );
if ( !folder )
@@ -2373,10 +2373,10 @@ Wallet *KMKernel::wallet() {
return mWallet;
}
-QValueList< QGuardedPtr<KMFolder> > KMKernel::allFolders()
+TQValueList< TQGuardedPtr<KMFolder> > KMKernel::allFolders()
{
- QStringList names;
- QValueList<QGuardedPtr<KMFolder> > folders;
+ TQStringList names;
+ TQValueList<TQGuardedPtr<KMFolder> > folders;
folderMgr()->createFolderList(&names, &folders);
imapFolderMgr()->createFolderList(&names, &folders);
dimapFolderMgr()->createFolderList(&names, &folders);