@ -37,6 +37,7 @@ using KPIM::RecentAddresses;
# include "configuredialog.h"
# include "kmcommands.h"
# include "kmsystemtray.h"
# include "importarchivedialog.h"
# include <mailtransport/transport.h>
# include <mailtransport/transportmanager.h>
@ -98,7 +99,7 @@ KMKernel::KMKernel (QObject *parent, const char *name) :
mIdentityManager ( 0 ) , mConfigureDialog ( 0 ) , mICalIface ( 0 ) , mMailService ( 0 ) ,
mContextMenuShown ( false ) , mWallet ( 0 )
{
kDebug ( 5006 ) ;
kDebug ( ) ;
setObjectName ( name ) ;
mySelf = this ;
the_startingUp = true ;
@ -189,7 +190,7 @@ KMKernel::~KMKernel ()
delete mWallet ;
mWallet = 0 ;
mySelf = 0 ;
kDebug ( 5006 ) ;
kDebug ( ) ;
}
void KMKernel : : setupDBus ( )
@ -348,7 +349,7 @@ QStringList KMKernel::accounts()
void KMKernel : : checkAccount ( const QString & account ) //might create a new reader but won't show!!
{
kDebug ( 5006 ) ;
kDebug ( ) ;
if ( account . isEmpty ( ) )
checkMail ( ) ;
else {
@ -370,7 +371,7 @@ void KMKernel::openReader( bool onlyCheck )
{
mWin = 0 ;
KMainWindow * ktmw = 0 ;
kDebug ( 5006 ) ;
kDebug ( ) ;
foreach ( KMainWindow * window , KMainWindow : : memberList ( ) )
{
@ -410,7 +411,7 @@ int KMKernel::openComposer( const QString &to, const QString &cc,
const QStringList & attachmentPaths ,
const QStringList & customHeaders )
{
kDebug ( 5006 ) ;
kDebug ( ) ;
KMMessage * msg = new KMMessage ;
msg - > initHeader ( ) ;
msg - > setCharset ( " utf-8 " ) ;
@ -493,7 +494,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
const QByteArray & attachCharset ,
unsigned int identity )
{
kDebug ( 5006 ) ;
kDebug ( ) ;
KMMessage * msg = new KMMessage ;
KMMessagePart * msgPart = 0 ;
@ -548,7 +549,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
msgPart - > setContentDisposition ( attachContDisp ) ;
}
if ( ! attachCharset . isEmpty ( ) ) {
// kDebug(5006 ) << "Set attachCharset to" << attachCharset;
// kDebug() << "Set attachCharset to" << attachCharset;
msgPart - > setCharset ( attachCharset ) ;
}
// Don't show the composer window if the automatic sending is checked
@ -595,7 +596,7 @@ void KMKernel::setDefaultTransport( const QString & transport )
{
MailTransport : : Transport * t = MailTransport : : TransportManager : : self ( ) - > transportByName ( transport , false ) ;
if ( ! t ) {
kWarning ( 5006 ) < < " The transport you entered is not available " ;
kWarning ( ) < < " The transport you entered is not available " ;
return ;
}
MailTransport : : TransportManager : : self ( ) - > setDefaultTransport ( t - > id ( ) ) ;
@ -731,7 +732,7 @@ int KMKernel::dbusAddMessage( const QString & foldername,
const QString & MsgStatusFlags )
{
// FIXME: Remove code duplication between this method and dbusAddMessage_fastImport()!
kDebug ( 5006 ) ;
kDebug ( ) ;
if ( foldername . isEmpty ( ) | | foldername . startsWith ( ' . ' ) )
return - 1 ;
@ -764,7 +765,7 @@ int KMKernel::dbusAddMessage( const QString & foldername,
KMFolderDir * subfolder ;
bool root = true ;
QStringList subFList = _foldername . split ( " / " , QString : : SkipEmptyParts ) ;
QStringList subFList = _foldername . split ( ' / ' , QString : : SkipEmptyParts ) ;
for ( QStringList : : Iterator it = subFList . begin ( ) ; it ! = subFList . end ( ) ; + + it ) {
QString _newFolder = * it ;
@ -905,7 +906,7 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername,
{
// Use this function to import messages without
// search for already existing emails.
kDebug ( 5006 ) ;
kDebug ( ) ;
if ( foldername . isEmpty ( ) | | foldername . startsWith ( ' . ' ) )
return - 1 ;
@ -932,7 +933,7 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername,
KMFolderDir * subfolder ;
bool root = true ;
QStringList subFList = _foldername . split ( " / " , QString : : SkipEmptyParts ) ;
QStringList subFList = _foldername . split ( ' / ' , QString : : SkipEmptyParts ) ;
for ( QStringList : : Iterator it = subFList . begin ( ) ; it ! = subFList . end ( ) ; + + it ) {
QString _newFolder = * it ;
@ -991,6 +992,14 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername,
return retval ;
}
void KMKernel : : showImportArchiveDialog ( )
{
KMMainWidget * mainWidget = getKMMainWidget ( ) ;
KMail : : ImportArchiveDialog * importDialog = new KMail : : ImportArchiveDialog ( mainWidget , Qt : : WDestructiveClose ) ;
importDialog - > setFolder ( mainWidget - > folderTree ( ) - > currentFolder ( ) ) ;
importDialog - > show ( ) ;
}
QStringList KMKernel : : folderList ( ) const
{
QStringList folders ;
@ -1024,7 +1033,7 @@ QString KMKernel::getFolder( const QString& vpath )
folderAdaptor = new KMail : : FolderAdaptor ( adaptorName ) ;
return vpath ;
}
kWarning ( 5006 ) < < " Folder not found: " < < vpath ;
kWarning ( ) < < " Folder not found: " < < vpath ;
return QString ( ) ;
}
@ -1689,7 +1698,7 @@ void KMKernel::cleanup(void)
the_folderMgr - > createFolderList ( & strList , & folders ) ;
QList < QPointer < KMFolder > > : : const_iterator it ;
for ( it = folders . begin ( ) ; it ! = folders . end ( ) ; it + + ) {
for ( it = folders . begin ( ) ; it ! = folders . end ( ) ; + + it ) {
folder = * it ;
if ( ! folder | | folder - > isDir ( ) ) {
continue ;
@ -1699,7 +1708,7 @@ void KMKernel::cleanup(void)
strList . clear ( ) ;
folders . clear ( ) ;
the_searchFolderMgr - > createFolderList ( & strList , & folders ) ;
for ( it = folders . begin ( ) ; it ! = folders . end ( ) ; it + + ) {
for ( it = folders . begin ( ) ; it ! = folders . end ( ) ; + + it ) {
folder = * it ;
if ( ! folder | | folder - > isDir ( ) ) {
continue ;
@ -1802,8 +1811,8 @@ bool KMKernel::transferMail( QString & destinationDir )
}
if ( ! KIO : : NetAccess : : move ( dir , destinationDir ) ) {
kDebug ( 5006 ) < < " Moving " < < dir < < " to " < < destinationDir < < " failed: " < < KIO : : NetAccess : : lastErrorString ( ) ;
kDebug ( 5006 ) < < " Deleting " < < destinationDir ;
kDebug ( ) < < " Moving " < < dir < < " to " < < destinationDir < < " failed: " < < KIO : : NetAccess : : lastErrorString ( ) ;
kDebug ( ) < < " Deleting " < < destinationDir ;
KIO : : NetAccess : : del ( destinationDir , 0 ) ;
destinationDir = dir ;
return false ;
@ -1880,8 +1889,8 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data)
// send MAX_CHUNK_SIZE bytes to the receiver (deep copy)
data = QByteArray ( ( * it ) . data . data ( ) + ( * it ) . offset , MAX_CHUNK_SIZE ) ;
( * it ) . offset + = MAX_CHUNK_SIZE ;
//kDebug( 5006 ) <<"Sending" << MAX_CHUNK_SIZE <<" bytes ("
// << remainingBytes - MAX_CHUNK_SIZE << " bytes remain)\n";
//kDebug() <<"Sending" << MAX_CHUNK_SIZE <<" bytes ("
// << remainingBytes - MAX_CHUNK_SIZE << " bytes remain)\n";
}
else
{
@ -1889,7 +1898,7 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data)
data = QByteArray ( ( * it ) . data . data ( ) + ( * it ) . offset , remainingBytes ) ;
( * it ) . data = QByteArray ( ) ;
( * it ) . offset = 0 ;
//kDebug( 5006 ) <<"Sending" << remainingBytes <<" bytes";
//kDebug() <<"Sending" << remainingBytes <<" bytes";
}
}
@ -1991,7 +2000,7 @@ void KMKernel::emergencyExit( const QString& reason )
" terminate now. \n The error was: \n %1 " , reason ) ;
}
kWarning ( 5006 ) < < mesg ;
kWarning ( ) < < mesg ;
KMessageBox : : error ( 0 , mesg ) ;
: : exit ( 1 ) ;
@ -2072,7 +2081,7 @@ bool KMKernel::folderIsSentMailFolder( const KMFolder * folder )
KPIMIdentities : : IdentityManager * KMKernel : : identityManager ( ) {
if ( ! mIdentityManager ) {
kDebug ( 5006 ) ;
kDebug ( ) ;
mIdentityManager = new KPIMIdentities : : IdentityManager ( false , this , " mIdentityManager " ) ;
}
return mIdentityManager ;
@ -2154,7 +2163,7 @@ KMailICalIfaceImpl& KMKernel::iCalIface()
void KMKernel : : selectFolder ( const QString & folderPath )
{
kDebug ( 5006 ) < < " Selecting a folder " < < folderPath ;
kDebug ( ) < < " Selecting a folder " < < folderPath ;
const QString localPrefix = " /Local " ;
KMFolder * folder = kmkernel - > folderMgr ( ) - > getFolderByURL ( folderPath ) ;
if ( ! folder & & folderPath . startsWith ( localPrefix ) )