From 90579ed74bf91277a6bf49171ca532bc15beb834 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 9 Feb 2007 18:30:57 +0000 Subject: [PATCH 01/10] Fix crash in cachedimap mailcheck after modifying a cachedimap account; had to make the code a bit more like in 3.5. svn path=/branches/kdepim/proko2/kdepim/; revision=632005 --- configuredialog.cpp | 21 +++++++++++++++++++++ configuredialog_p.h | 3 ++- kmaccount.cpp | 12 ++++++------ kmaccount.h | 3 ++- kmacctmgr.cpp | 1 + 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/configuredialog.cpp b/configuredialog.cpp index 66f101b51..bc5c093fc 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -1138,6 +1138,27 @@ NetworkPageReceivingTab::NetworkPageReceivingTab( QWidget * parent, const char * this, SLOT(slotEditNotifications()) ); } +NetworkPageReceivingTab::~NetworkPageReceivingTab() +{ + // When hitting Cancel or closing the dialog with the window-manager-button, + // we have a number of things to clean up: + + // The newly created accounts + QValueList< QGuardedPtr >::Iterator it; + for (it = mNewAccounts.begin(); it != mNewAccounts.end(); ++it ) { + delete (*it); + } + mNewAccounts.clear(); + + // The modified accounts + QValueList::Iterator j; + for ( j = mModifiedAccounts.begin() ; j != mModifiedAccounts.end() ; ++j ) { + delete (*j)->newAccount; + delete (*j); + } + mModifiedAccounts.clear(); + +} void NetworkPage::ReceivingTab::slotAccountSelected() { diff --git a/configuredialog_p.h b/configuredialog_p.h index 44f0d6fea..84b3dee4b 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -324,6 +324,7 @@ class NetworkPageReceivingTab : public ConfigModuleTab { Q_OBJECT public: NetworkPageReceivingTab( QWidget * parent=0, const char * name=0 ); + ~NetworkPageReceivingTab(); QString helpAnchor() const; void load(); void save(); @@ -357,7 +358,7 @@ protected: QGuardedPtr< KMAccount > oldAccount; QGuardedPtr< KMAccount > newAccount; }; - // ### make this a qptrlist: + // ### make this value-based: QValueList< ModifiedAccountsType* > mModifiedAccounts; }; diff --git a/kmaccount.cpp b/kmaccount.cpp index bd3479d3a..02170cd0f 100644 --- a/kmaccount.cpp +++ b/kmaccount.cpp @@ -152,6 +152,11 @@ void KMAccount::readConfig(KConfig& config) { setFolder(kmkernel->folderMgr()->findIdString(folderName), true); } + + if (mInterval == 0) + deinstallTimer(); + else + installTimer(); } @@ -280,15 +285,10 @@ if( fileD0.open( IO_WriteOnly ) ) { void KMAccount::setCheckInterval(int aInterval) { if (aInterval <= 0) - { mInterval = 0; - deinstallTimer(); - } else - { mInterval = aInterval; - installTimer(); - } + // Don't call installTimer from here! See #117935. } //---------------------------------------------------------------------------- diff --git a/kmaccount.h b/kmaccount.h index 773b2ba80..0d68251b1 100644 --- a/kmaccount.h +++ b/kmaccount.h @@ -254,12 +254,14 @@ protected: */ virtual void sendReceipt(KMMessage* msg); +public: /** * Install/deinstall automatic new-mail checker timer. */ virtual void installTimer(); virtual void deinstallTimer(); +protected: /** * Call this to increase the number of new messages in a folder for * messages which are _not_ processed with processNewMsg(). @@ -268,7 +270,6 @@ protected: */ void addToNewInFolder( QString folderId, int num ); -protected: QString mPrecommand; QString mTrash; KMAcctMgr* mOwner; diff --git a/kmacctmgr.cpp b/kmacctmgr.cpp index fe05bb14f..5b7a81889 100644 --- a/kmacctmgr.cpp +++ b/kmacctmgr.cpp @@ -273,6 +273,7 @@ void KMAcctMgr::add(KMAccount *account) if (account) { mAcctList.append( account ); emit accountAdded( account ); + account->installTimer(); } } From 7af0c145392bd57c17a9e90e0480d6dc37084c91 Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Thu, 22 Feb 2007 09:06:29 +0000 Subject: [PATCH 02/10] kolab/issue 1533 - minor change in action text. svn path=/branches/kdepim/proko2/kdepim/; revision=636180 --- kmmainwidget.cpp | 5 ++++- kmreadermainwin.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index e28321e30..f376835a3 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2247,7 +2247,10 @@ void KMMainWidget::setupActions() mSelectAllTextAction = new KAction( i18n("Select Message &Text"), CTRL+SHIFT+Key_A, mMsgView, SLOT(selectAll()), actionCollection(), "mark_all_text" ); - mCopyMsgTextAction = KStdAction::copy( messageView(), SLOT(slotCopySelectedText()), actionCollection(), "kmail_copy"); + mCopyMsgTextAction = new KAction( i18n("Copy Text"), + "editcopy", CTRL + Key_C, mMsgView, + SLOT(slotCopySelectedText()), actionCollection(), + "kmail_copy" ); //----- Folder Menu (void) new KAction( i18n("&New Folder..."), "folder_new", 0, mFolderTree, diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index 0d341e163..41d6696bd 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -267,7 +267,10 @@ void KMReaderMainWin::setupAccel() mSelectAllTextAction = new KAction( i18n("Select Message &Text"), CTRL+SHIFT+Key_A, mReaderWin, SLOT(selectAll()), actionCollection(), "mark_all_text" ); - mCopyMsgTextAction = KStdAction::copy( mReaderWin, SLOT(slotCopySelectedText()), actionCollection(), "kmail_copy"); + mCopyMsgTextAction = new KAction( i18n("Copy Text"), + "editcopy", CTRL + Key_C, mReaderWin, + SLOT(slotCopySelectedText()), actionCollection(), + "kmail_copy" ); createGUI( "kmreadermainwin.rc" ); //menuBar()->hide(); From b7ef88d6de17dda2cba82ca05a8d4331d7d90d59 Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Mon, 19 Mar 2007 07:50:21 +0000 Subject: [PATCH 03/10] kolab/issue 1658 - Adding a warning for empty To : field. Now if the To : field is empty it gives you KMessageBox::QuestionYesNo warning. If user presses Yes, the mail is sent anyway. But if the user selects No the focus is set on To: field. Earlier cases work like they used to before the change. Allen, would you like this feature in branch/pim? I have tested it, its not so intrusive as well. I can port it if you think it would be a nice thing to add. I checked with my 3.5/kubuntu vanilla and enterprise kmail. It does send emails without any warning even if there is a empty To: field. CCMAIL:winterz@kde.org svn path=/branches/kdepim/proko2/kdepim/; revision=644062 --- kmcomposewin.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 5efb279ad..92d2b258a 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -3344,13 +3344,26 @@ void KMComposeWin::doSend(int aSendNow, bool saveInDrafts) "not have to enter it for each message.") ); return; } - if (to().isEmpty() && cc().isEmpty() && bcc().isEmpty()) + if ( to().isEmpty() ) { - mEdtTo->setFocus(); - KMessageBox::information( this, + if ( cc().isEmpty() && bcc().isEmpty()) { + mEdtTo->setFocus(); + KMessageBox::information( this, i18n("You must specify at least one receiver," "either in the To: field or as CC or as BCC.") ); - return; + return; + } + else { + mEdtTo->setFocus(); + int rc = + KMessageBox::questionYesNo( this, + i18n("To field is missing." + "Send message anyway?"), + i18n("No To: specified") ); + if ( rc == KMessageBox::No ){ + return; + } + } } if (subject().isEmpty()) From dbc3e986b26859de81c4ca64ae2e33e00cf18be6 Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Fri, 23 Mar 2007 06:38:40 +0000 Subject: [PATCH 04/10] Back port of Allen's crash gaurds. svn path=/branches/kdepim/proko2/kdepim/; revision=645626 --- kmcomposewin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 92d2b258a..0ca56cbef 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -3347,14 +3347,14 @@ void KMComposeWin::doSend(int aSendNow, bool saveInDrafts) if ( to().isEmpty() ) { if ( cc().isEmpty() && bcc().isEmpty()) { - mEdtTo->setFocus(); + if ( mEdtTo ) mEdtTo->setFocus(); KMessageBox::information( this, i18n("You must specify at least one receiver," "either in the To: field or as CC or as BCC.") ); return; } else { - mEdtTo->setFocus(); + if ( mEdtTo ) mEdtTo->setFocus(); int rc = KMessageBox::questionYesNo( this, i18n("To field is missing." From 650e6286d0f1af17b302608888086095454abc8e Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Fri, 23 Mar 2007 06:45:59 +0000 Subject: [PATCH 05/10] Backport KMMsgBase::extractRFC2231HeaderField() required for the issue/1583. Backport port of ... SVN commit 645625 by pradeepto: kolab/issue1583 - Fixing OL compatibility with attachments that have umlauts in the filename. Volker's patch worked really awesome. Thanks Volker. svn path=/branches/kdepim/proko2/kdepim/; revision=645630 --- kmmessage.cpp | 19 ++++++++++++++++--- kmmsgbase.cpp | 36 ++++++++++++++++++++++++++++++++++++ kmmsgbase.h | 6 ++++++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/kmmessage.cpp b/kmmessage.cpp index 3b42e6b36..a6cd5ffce 100644 --- a/kmmessage.cpp +++ b/kmmessage.cpp @@ -4532,10 +4532,23 @@ void KMMessage::updateAttachmentState( DwBodyPart* part ) return; } + bool filenameEmpty = true; + if ( part->hasHeaders() ) { + if ( part->Headers().HasContentDisposition() ) { + DwDispositionType cd = part->Headers().ContentDisposition(); + filenameEmpty = cd.Filename().empty(); + if ( filenameEmpty ) { + // let's try if it is rfc 2231 encoded which mimelib can't handle + filenameEmpty = KMMsgBase::decodeRFC2231String( KMMsgBase::extractRFC2231HeaderField( cd.AsString().c_str(), "filename" ) ).isEmpty(); + } + } + } + if ( part->hasHeaders() && - part->Headers().HasContentDisposition() && - !part->Headers().ContentDisposition().Filename().empty() && - 0 != qstricmp(part->Headers().ContentDisposition().Filename().c_str(), cSMIMEData )) + ( ( part->Headers().HasContentDisposition() && + !part->Headers().ContentDisposition().Filename().empty() && + 0 != qstricmp(part->Headers().ContentDisposition().Filename().c_str(), cSMIMEData )) || + ( part->Headers().HasContentType() && !filenameEmpty ) ) ) { setStatus( KMMsgStatusHasAttach ); return; diff --git a/kmmsgbase.cpp b/kmmsgbase.cpp index 5e100e499..259e14ffe 100644 --- a/kmmsgbase.cpp +++ b/kmmsgbase.cpp @@ -927,6 +927,42 @@ QString KMMsgBase::decodeRFC2231String(const QCString& _str) return codec->toUnicode( st ); } +QCString KMMsgBase::extractRFC2231HeaderField( const QCString &aStr, const QCString &field ) +{ + int n=-1; + QCString str; + bool found = false; + while ( n<=0 || found ) { + QString pattern( field ); + pattern += "[*]"; // match a literal * after the fieldname, as defined by RFC 2231 + if ( n>=0 ) { // If n<0, check for fieldname*=..., otherwise for fieldname*n= + pattern += QString::number(n) + "[*]?"; + } + pattern += "="; + + QRegExp fnamePart( pattern, FALSE ); + int startPart = fnamePart.search( aStr ); + int endPart; + found = ( startPart >= 0 ); + if ( found ) { + startPart += fnamePart.matchedLength(); + // Quoted values end at the ending quote + if ( aStr[startPart] == '"' ) { + startPart++; // the double quote isn't part of the filename + endPart = aStr.find('"', startPart) - 1; + } + else { + endPart = aStr.find(';', startPart) - 1; + } + if (endPart < 0) + endPart = 32767; + str += aStr.mid( startPart, endPart-startPart+1).stripWhiteSpace(); + } + n++; + } + return str; +} + QString KMMsgBase::base64EncodedMD5( const QString & s, bool utf8 ) { if (s.stripWhiteSpace().isEmpty()) return ""; if ( utf8 ) diff --git a/kmmsgbase.h b/kmmsgbase.h index 27e332e28..5d65fb892 100644 --- a/kmmsgbase.h +++ b/kmmsgbase.h @@ -336,6 +336,12 @@ public: /** Decode given string as described in RFC2231 */ static QString decodeRFC2231String(const QCString& aStr); + /** Extract a given param from the RFC2231-encoded header field, in particular + concatenate possibly multiple entries, which are given as paramname*0=..; + paramname*1=..; ... or paramname*0*=..; paramname*1*=..; ... and return + their value as one string. That string will still be encoded */ + static QCString extractRFC2231HeaderField( const QCString &aStr, const QCString &field ); + /** Calculate the base64 encoded md5sum (sans the trailing equal signs). If @p utf8 is false, uses QString::latin1() to calculate the md5sum of, else uses QString::utf8() */ From dc63437298392a59b10ebd9f7b1f77a1b8583971 Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Wed, 11 Apr 2007 06:46:22 +0000 Subject: [PATCH 06/10] Backport of SVN commit 652140 by pradeepto: Issue/1530 - make preferred form of forwarding configurable. Right now, works only with the context menu from the header view. Needs more work if the same is need for readerwin and mainwidget. (+ changed the name of the actions to keep them in sync with enterprise) svn path=/branches/kdepim/proko2/kdepim/; revision=652490 --- kmail.kcfg | 4 ++++ kmmainwidget.cpp | 29 +++++++++++++++++++---------- kmmainwidget.h | 4 ++-- kmreadermainwin.cpp | 26 ++++++++++++++++++-------- kmreadermainwin.h | 2 +- 5 files changed, 44 insertions(+), 21 deletions(-) diff --git a/kmail.kcfg b/kmail.kcfg index 7b1e7a32f..331c1df6b 100644 --- a/kmail.kcfg +++ b/kmail.kcfg @@ -266,6 +266,10 @@ + + true + + true diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index f376835a3..a7fc95f52 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2302,16 +2302,25 @@ void KMMainWidget::setupActions() connect( mForwardActionMenu, SIGNAL(activated()), this, SLOT(slotForwardAttachedMsg()) ); - mForwardAttachedAction = new KAction( i18n("Message->Forward->","As &Attachment..."), - "mail_forward", Key_F, this, - SLOT(slotForwardAttachedMsg()), actionCollection(), - "message_forward_as_attachment" ); - mForwardActionMenu->insert( forwardAttachedAction() ); - mForwardAction = new KAction( i18n("&Inline..."), "mail_forward", - SHIFT+Key_F, this, SLOT(slotForwardMsg()), - actionCollection(), "message_forward_inline" ); + mForwardInlineAction = new KAction( i18n("&Inline..."), + "mail_forward", SHIFT+Key_F, this, + SLOT(slotForwardInlineMsg()), + actionCollection(), + "message_forward_inline" ); - mForwardActionMenu->insert( forwardAction() ); + mForwardAttachedAction = new KAction( i18n("Message->Forward->","As &Attachment..."), + "mail_forward", Key_F, this, + SLOT(slotForwardAttachedMsg()), + actionCollection(), + "message_forward_as_attachment" ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insert( mForwardInlineAction ); + mForwardActionMenu->insert( mForwardAttachedAction ); + } else { + mForwardActionMenu->insert( mForwardAttachedAction ); + mForwardActionMenu->insert( mForwardInlineAction ); + } mSendAgainAction = new KAction( i18n("Send A&gain..."), 0, this, SLOT(slotResendMsg()), actionCollection(), "send_again" ); @@ -2926,7 +2935,7 @@ void KMMainWidget::updateMessageActions() mTrashAction->setEnabled( mass_actions && !mFolder->isReadOnly() ); mDeleteAction->setEnabled( mass_actions && !mFolder->isReadOnly() ); mFindInMessageAction->setEnabled( mass_actions ); - mForwardAction->setEnabled( mass_actions ); + mForwardInlineAction->setEnabled( mass_actions ); mForwardAttachedAction->setEnabled( mass_actions ); forwardMenu()->setEnabled( mass_actions ); diff --git a/kmmainwidget.h b/kmmainwidget.h index 98581c887..39504bd62 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -102,7 +102,7 @@ public: KAction *replyListAction() const { return mReplyListAction; } KActionMenu * replyMenu() const { return mReplyActionMenu; } KActionMenu *forwardMenu() const { return mForwardActionMenu; } - KAction *forwardAction() const { return mForwardAction; } + KAction *forwardInlineAction() const { return mForwardInlineAction; } KAction *forwardAttachedAction() const { return mForwardAttachedAction; } KAction *redirectAction() const { return mRedirectAction; } KAction *bounceAction() const { return mBounceAction; } @@ -402,7 +402,7 @@ private: // Composition actions KAction *mPrintAction, *mReplyAction, *mReplyAllAction, *mReplyAuthorAction, *mReplyListAction, - *mForwardAction, *mForwardAttachedAction, *mRedirectAction, + *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction, *mBounceAction, *mNoQuoteReplyAction; KActionMenu *mReplyActionMenu; KActionMenu *mForwardActionMenu; diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index 41d6696bd..7df29d27d 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -30,6 +30,7 @@ #include //for saveMainWindowSettings() applyMainWindowSettings() #include #include +#include "globalsettings.h" #include "kmreadermainwin.h" #include "kmreadermainwin.moc" @@ -212,16 +213,25 @@ void KMReaderMainWin::setupAccel() connect( mForwardActionMenu, SIGNAL( activated() ), this, SLOT( slotForwardAttachedMsg() ) ); - mForwardAction = new KAction( i18n("&Inline..."), "mail_forward", - SHIFT+Key_F, this, SLOT(slotForwardMsg()), - actionCollection(), "message_forward_inline" ); - mForwardActionMenu->insert( mForwardAction ); + mForwardInlineAction = new KAction( i18n("&Inline..."), + "mail_forward", SHIFT+Key_F, this, + SLOT(slotForwardInlineMsg()), + actionCollection(), + "message_forward_inline" ); mForwardAttachedAction = new KAction( i18n("Message->Forward->","As &Attachment..."), - "mail_forward", Key_F, this, - SLOT(slotForwardAttachedMsg()), actionCollection(), - "message_forward_as_attachment" ); - mForwardActionMenu->insert( mForwardAttachedAction ); + "mail_forward", Key_F, this, + SLOT(slotForwardAttachedMsg()), + actionCollection(), + "message_forward_as_attachment" ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insert( mForwardInlineAction ); + mForwardActionMenu->insert( mForwardAttachedAction ); + } else { + mForwardActionMenu->insert( mForwardAttachedAction ); + mForwardActionMenu->insert( mForwardInlineAction ); + } mRedirectAction = new KAction( i18n("Message->Forward->","&Redirect..."), Key_E, this, SLOT(slotRedirectMsg()), diff --git a/kmreadermainwin.h b/kmreadermainwin.h index f3a7f8190..ebbd92352 100644 --- a/kmreadermainwin.h +++ b/kmreadermainwin.h @@ -61,7 +61,7 @@ private: QMap mMenuToFolder; // a few actions duplicated from kmmainwidget KAction *mPrintAction, *mReplyAction, *mReplyAllAction, *mReplyAuthorAction, - *mReplyListAction, *mForwardAction, + *mReplyListAction, *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction, *mBounceAction; KAction *mCopyMsgTextAction, *mSelectAllTextAction; KActionMenu *mReplyActionMenu; From f6b4b673c216536868bc42023af16f26238b8110 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 12 Apr 2007 10:43:19 +0000 Subject: [PATCH 07/10] kiosk-like setting for admins to prevent a too small imap mailcheck interval. proko2 issue 1640. svn path=/branches/kdepim/proko2/kdepim/; revision=652934 --- accountdialog.cpp | 5 ++++- kmail.kcfg | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/accountdialog.cpp b/accountdialog.cpp index 619180b66..325d3d28f 100644 --- a/accountdialog.cpp +++ b/accountdialog.cpp @@ -57,6 +57,8 @@ using KMail::SieveConfigEditor; #include "kmfoldermgr.h" #include "kmservertest.h" #include "protocols.h" +#include "globalsettings.h" + #include #include @@ -918,7 +920,8 @@ void AccountDialog::makeImapAccountPage( bool connected ) mImap.intervalLabel = new QLabel( i18n("Check inter&val:"), page1 ); grid->addWidget( mImap.intervalLabel, row, 0 ); mImap.intervalSpin = new KIntNumInput( page1 ); - mImap.intervalSpin->setRange( 1, 60, 1, FALSE ); + const int kioskMinimumImapCheckInterval = GlobalSettings::minimumImapCheckInterval(); + mImap.intervalSpin->setRange( kioskMinimumImapCheckInterval, 60, 1, FALSE ); mImap.intervalSpin->setValue( 1 ); mImap.intervalSpin->setSuffix( i18n( " min" ) ); mImap.intervalLabel->setBuddy( mImap.intervalSpin ); diff --git a/kmail.kcfg b/kmail.kcfg index 331c1df6b..cb2e73cba 100644 --- a/kmail.kcfg +++ b/kmail.kcfg @@ -63,6 +63,14 @@ + + + 1 + This setting allows administrators to set a minimum delay between two mail checks." + "The user will not be able to choose a value smaller than the value set here. + + + inbox From cf1f4cbe1d3b30b6566de3328ffc4ab9211b9485 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 23 Apr 2007 22:16:39 +0000 Subject: [PATCH 08/10] Link our own stuff first, then kdelibs stuff. Otherwise the rpath gets mixed up when kdepim and kdelibs are installed in different prefixes [and things crash when the kdelibs prefix holds another version of kdepim] svn path=/branches/kdepim/proko2/kdepim/; revision=657384 --- Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index b9bd5bc91..64b3da54d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,12 +15,13 @@ INCLUDES = -I$(top_srcdir)/libkdenetwork \ lib_LTLIBRARIES = libkmailprivate.la libkmailprivate_la_LDFLAGS = $(all_libraries) -version-info 0:0:0 -no-undefined -libkmailprivate_la_LIBADD = $(LIB_KHTML) $(LIB_KSPELL) $(LIB_KABC) \ +libkmailprivate_la_LIBADD = \ ../libkdenetwork/libkdenetwork.la ../libkdepim/libkdepim.la \ ../libkpimidentities/libkpimidentities.la ../mimelib/libmimelib.la \ ../libksieve/libksieve.la \ ../certmanager/lib/libkleopatra.la \ - ../libkcal/libkcal.la + ../libkcal/libkcal.la \ + $(LIB_KHTML) $(LIB_KSPELL) $(LIB_KABC) kde_module_LTLIBRARIES = kcm_kmail.la libkmailpart.la libkmail_bodypartformatter_application_octetstream.la libkmailpart_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -version-info 1:0 -no-undefined From 7bebda750867136c745be3a30c76efc5aff0d169 Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Tue, 1 May 2007 12:07:36 +0000 Subject: [PATCH 09/10] Backport of Issue/1530 - make preferred form of forwarding configurable. svn path=/branches/kdepim/proko2/kdepim/; revision=660053 --- kmail.kcfg | 2 +- kmail_part.cpp | 1 + kmmainwidget.cpp | 44 ++++++++++++++++++++++++++++++++++++-------- kmmainwidget.h | 5 +++++ kmmainwin.cpp | 2 ++ kmmainwin.rc | 6 ++---- kmreadermainwin.cpp | 34 +++++++++++++++++++++++++++++++--- kmreadermainwin.h | 5 +++++ kmreadermainwin.rc | 6 ++---- 9 files changed, 85 insertions(+), 20 deletions(-) diff --git a/kmail.kcfg b/kmail.kcfg index cb2e73cba..d3633e693 100644 --- a/kmail.kcfg +++ b/kmail.kcfg @@ -275,7 +275,7 @@ - true + false diff --git a/kmail_part.cpp b/kmail_part.cpp index 93fb91481..6b680968e 100644 --- a/kmail_part.cpp +++ b/kmail_part.cpp @@ -220,6 +220,7 @@ void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) kdDebug(5006) << "KMailPart::guiActivateEvent" << endl; KParts::ReadOnlyPart::guiActivateEvent(e); mainWidget->initializeFilterActions(); + mainWidget->setupForwardingActionsList(); } void KMailPart::exit() diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index a7fc95f52..d6ad383ee 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2299,28 +2299,43 @@ void KMMainWidget::setupActions() mForwardActionMenu = new KActionMenu( i18n("Message->","&Forward"), "mail_forward", actionCollection(), "message_forward" ); + connect( mForwardActionMenu, SIGNAL(activated()), this, - SLOT(slotForwardAttachedMsg()) ); + SLOT(slotForwardAttachedMsg()) ); mForwardInlineAction = new KAction( i18n("&Inline..."), - "mail_forward", SHIFT+Key_F, this, + "mail_forward", 0, this, SLOT(slotForwardInlineMsg()), actionCollection(), "message_forward_inline" ); mForwardAttachedAction = new KAction( i18n("Message->Forward->","As &Attachment..."), - "mail_forward", Key_F, this, + "mail_forward", 0, this, SLOT(slotForwardAttachedMsg()), actionCollection(), "message_forward_as_attachment" ); + mRedirectAction = new KAction( i18n("Message->Forward->","&Redirect..."), + Key_E, this, SLOT(slotRedirectMsg()), + actionCollection(), "message_forward_redirect" ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { mForwardActionMenu->insert( mForwardInlineAction ); mForwardActionMenu->insert( mForwardAttachedAction ); + mForwardInlineAction->setShortcut( Key_F ); + mForwardAttachedAction->setShortcut( SHIFT+Key_F ); + connect( mForwardActionMenu, SIGNAL(activated()), this, + SLOT(slotForwardInlineMsg()) ); + } else { mForwardActionMenu->insert( mForwardAttachedAction ); mForwardActionMenu->insert( mForwardInlineAction ); + mForwardInlineAction->setShortcut( SHIFT+Key_F ); + mForwardAttachedAction->setShortcut( Key_F ); + connect( mForwardActionMenu, SIGNAL(activated()), this, + SLOT(slotForwardAttachedMsg()) ); } + mForwardActionMenu->insert( mRedirectAction ); mSendAgainAction = new KAction( i18n("Send A&gain..."), 0, this, SLOT(slotResendMsg()), actionCollection(), "send_again" ); @@ -2352,11 +2367,6 @@ void KMMainWidget::setupActions() "reply_list" ); mReplyActionMenu->insert( mReplyListAction ); - mRedirectAction = new KAction( i18n("Message->Forward->","&Redirect..."), - Key_E, this, SLOT(slotRedirectMsg()), - actionCollection(), "message_forward_redirect" ); - mForwardActionMenu->insert( redirectAction() ); - mNoQuoteReplyAction = new KAction( i18n("Reply Without &Quote..."), SHIFT+Key_R, this, SLOT(slotNoQuoteReplyToMsg()), actionCollection(), "noquotereply" ); @@ -2767,6 +2777,24 @@ void KMMainWidget::setupActions() updateMessageActions(); } +void KMMainWidget::setupForwardingActionsList() +{ + QPtrList mForwardActionList; + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mGUIClient->unplugActionList( "forward_action_list" ); + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mRedirectAction ); + mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); + } else { + mGUIClient->unplugActionList( "forward_action_list" ); + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mRedirectAction ); + mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); + } +} + //----------------------------------------------------------------------------- void KMMainWidget::slotEditNotifications() { diff --git a/kmmainwidget.h b/kmmainwidget.h index 39504bd62..b0dc84389 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -144,6 +144,11 @@ public: void modifyFolder( KMFolderTreeItem* folderItem ); + /** + * Sets up action list for forward menu. + */ + void setupForwardingActionsList(); + public slots: void slotMoveMsgToFolder( KMFolder *dest); void slotTrashMsg(); // move to trash diff --git a/kmmainwin.cpp b/kmmainwin.cpp index df166a265..9c56e32d5 100644 --- a/kmmainwin.cpp +++ b/kmmainwin.cpp @@ -55,6 +55,8 @@ KMMainWin::KMMainWin(QWidget *) // Don't use conserveMemory() because this renders dynamic plugging // of actions unusable! + mKMMainWidget->setupForwardingActionsList(); + applyMainWindowSettings(KMKernel::config(), "Main Window"); connect( KPIM::BroadcastStatus::instance(), SIGNAL( statusMsg( const QString& ) ), diff --git a/kmmainwin.rc b/kmmainwin.rc index c8c93ac42..f0c322d84 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -97,9 +97,7 @@ &Forward - - - + diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index 7df29d27d..ca6b8acc1 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -225,19 +225,29 @@ void KMReaderMainWin::setupAccel() actionCollection(), "message_forward_as_attachment" ); + mRedirectAction = new KAction( i18n("Message->Forward->","&Redirect..."), + Key_E, this, SLOT(slotRedirectMsg()), + actionCollection(), "message_forward_redirect" ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { mForwardActionMenu->insert( mForwardInlineAction ); mForwardActionMenu->insert( mForwardAttachedAction ); + mForwardInlineAction->setShortcut( Key_F ); + mForwardAttachedAction->setShortcut( SHIFT+Key_F ); + connect( mForwardActionMenu, SIGNAL(activated()), this, + SLOT(slotForwardInlineMsg()) ); } else { mForwardActionMenu->insert( mForwardAttachedAction ); mForwardActionMenu->insert( mForwardInlineAction ); + mForwardInlineAction->setShortcut( SHIFT+Key_F ); + mForwardAttachedAction->setShortcut( Key_F ); + connect( mForwardActionMenu, SIGNAL(activated()), this, + SLOT(slotForwardAttachedMsg()) ); } - mRedirectAction = new KAction( i18n("Message->Forward->","&Redirect..."), - Key_E, this, SLOT(slotRedirectMsg()), - actionCollection(), "message_forward_redirect" ); mForwardActionMenu->insert( mRedirectAction ); + mBounceAction = new KAction( i18n("&Bounce..."), 0, this, SLOT(slotBounceMsg()), actionCollection(), "bounce" ); @@ -283,10 +293,28 @@ void KMReaderMainWin::setupAccel() "kmail_copy" ); createGUI( "kmreadermainwin.rc" ); + setupForwardingActionsList(); //menuBar()->hide(); //toolBar( "mainToolBar" )->hide(); } +void KMReaderMainWin::setupForwardingActionsList() +{ + QPtrList mForwardActionList; + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + unplugActionList( "forward_action_list" ); + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mRedirectAction ); + plugActionList( "forward_action_list", mForwardActionList ); + } else { + unplugActionList( "forward_action_list" ); + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mRedirectAction ); + plugActionList( "forward_action_list", mForwardActionList ); + } +} void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoint& aPoint) { diff --git a/kmreadermainwin.h b/kmreadermainwin.h index ebbd92352..d0bcebd1e 100644 --- a/kmreadermainwin.h +++ b/kmreadermainwin.h @@ -29,6 +29,11 @@ public: // take ownership of and show @param msg void showMsg( const QString & encoding, KMMessage *msg ); + /** + * Sets up action list for forward menu. + */ + void setupForwardingActionsList(); + private slots: void slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoint& aPoint); diff --git a/kmreadermainwin.rc b/kmreadermainwin.rc index 6f724b1c1..dee974202 100644 --- a/kmreadermainwin.rc +++ b/kmreadermainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -37,9 +37,7 @@ &Forward - - - + From 3aa25ebfa872095e84bb282e080caa22cb8a11aa Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 2 May 2007 13:48:30 +0000 Subject: [PATCH 10/10] Fix and simplify forwarding inline by default option. Kolab issue 1530. svn path=/branches/kdepim/proko2/kdepim/; revision=660368 --- kmail_part.cpp | 1 - kmmainwidget.cpp | 25 ++----------------------- kmmainwidget.h | 5 ----- kmmainwin.cpp | 2 -- kmmainwin.rc | 7 ++----- kmreadermainwin.cpp | 25 ++----------------------- kmreadermainwin.h | 5 ----- kmreadermainwin.rc | 7 ++----- 8 files changed, 8 insertions(+), 69 deletions(-) diff --git a/kmail_part.cpp b/kmail_part.cpp index 6b680968e..93fb91481 100644 --- a/kmail_part.cpp +++ b/kmail_part.cpp @@ -220,7 +220,6 @@ void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) kdDebug(5006) << "KMailPart::guiActivateEvent" << endl; KParts::ReadOnlyPart::guiActivateEvent(e); mainWidget->initializeFilterActions(); - mainWidget->setupForwardingActionsList(); } void KMailPart::exit() diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index d6ad383ee..804eec7e8 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -2300,12 +2300,9 @@ void KMMainWidget::setupActions() "mail_forward", actionCollection(), "message_forward" ); - connect( mForwardActionMenu, SIGNAL(activated()), this, - SLOT(slotForwardAttachedMsg()) ); - mForwardInlineAction = new KAction( i18n("&Inline..."), "mail_forward", 0, this, - SLOT(slotForwardInlineMsg()), + SLOT(slotForwardMsg()), actionCollection(), "message_forward_inline" ); @@ -2325,7 +2322,7 @@ void KMMainWidget::setupActions() mForwardInlineAction->setShortcut( Key_F ); mForwardAttachedAction->setShortcut( SHIFT+Key_F ); connect( mForwardActionMenu, SIGNAL(activated()), this, - SLOT(slotForwardInlineMsg()) ); + SLOT(slotForwardMsg()) ); } else { mForwardActionMenu->insert( mForwardAttachedAction ); @@ -2777,24 +2774,6 @@ void KMMainWidget::setupActions() updateMessageActions(); } -void KMMainWidget::setupForwardingActionsList() -{ - QPtrList mForwardActionList; - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mGUIClient->unplugActionList( "forward_action_list" ); - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mRedirectAction ); - mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); - } else { - mGUIClient->unplugActionList( "forward_action_list" ); - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mRedirectAction ); - mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); - } -} - //----------------------------------------------------------------------------- void KMMainWidget::slotEditNotifications() { diff --git a/kmmainwidget.h b/kmmainwidget.h index b0dc84389..39504bd62 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -144,11 +144,6 @@ public: void modifyFolder( KMFolderTreeItem* folderItem ); - /** - * Sets up action list for forward menu. - */ - void setupForwardingActionsList(); - public slots: void slotMoveMsgToFolder( KMFolder *dest); void slotTrashMsg(); // move to trash diff --git a/kmmainwin.cpp b/kmmainwin.cpp index 9c56e32d5..df166a265 100644 --- a/kmmainwin.cpp +++ b/kmmainwin.cpp @@ -55,8 +55,6 @@ KMMainWin::KMMainWin(QWidget *) // Don't use conserveMemory() because this renders dynamic plugging // of actions unusable! - mKMMainWidget->setupForwardingActionsList(); - applyMainWindowSettings(KMKernel::config(), "Main Window"); connect( KPIM::BroadcastStatus::instance(), SIGNAL( statusMsg( const QString& ) ), diff --git a/kmmainwin.rc b/kmmainwin.rc index f0c322d84..29fddb165 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -95,10 +95,7 @@ - - &Forward - - + diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index ca6b8acc1..e863069af 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -210,12 +210,10 @@ void KMReaderMainWin::setupAccel() mForwardActionMenu = new KActionMenu( i18n("Message->","&Forward"), "mail_forward", actionCollection(), "message_forward" ); - connect( mForwardActionMenu, SIGNAL( activated() ), this, - SLOT( slotForwardAttachedMsg() ) ); mForwardInlineAction = new KAction( i18n("&Inline..."), "mail_forward", SHIFT+Key_F, this, - SLOT(slotForwardInlineMsg()), + SLOT(slotForwardMsg()), actionCollection(), "message_forward_inline" ); @@ -235,7 +233,7 @@ void KMReaderMainWin::setupAccel() mForwardInlineAction->setShortcut( Key_F ); mForwardAttachedAction->setShortcut( SHIFT+Key_F ); connect( mForwardActionMenu, SIGNAL(activated()), this, - SLOT(slotForwardInlineMsg()) ); + SLOT(slotForwardMsg()) ); } else { mForwardActionMenu->insert( mForwardAttachedAction ); mForwardActionMenu->insert( mForwardInlineAction ); @@ -293,29 +291,10 @@ void KMReaderMainWin::setupAccel() "kmail_copy" ); createGUI( "kmreadermainwin.rc" ); - setupForwardingActionsList(); //menuBar()->hide(); //toolBar( "mainToolBar" )->hide(); } -void KMReaderMainWin::setupForwardingActionsList() -{ - QPtrList mForwardActionList; - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - unplugActionList( "forward_action_list" ); - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mRedirectAction ); - plugActionList( "forward_action_list", mForwardActionList ); - } else { - unplugActionList( "forward_action_list" ); - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mRedirectAction ); - plugActionList( "forward_action_list", mForwardActionList ); - } -} - void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoint& aPoint) { KPopupMenu * menu = new KPopupMenu; diff --git a/kmreadermainwin.h b/kmreadermainwin.h index d0bcebd1e..ebbd92352 100644 --- a/kmreadermainwin.h +++ b/kmreadermainwin.h @@ -29,11 +29,6 @@ public: // take ownership of and show @param msg void showMsg( const QString & encoding, KMMessage *msg ); - /** - * Sets up action list for forward menu. - */ - void setupForwardingActionsList(); - private slots: void slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoint& aPoint); diff --git a/kmreadermainwin.rc b/kmreadermainwin.rc index dee974202..97dd59882 100644 --- a/kmreadermainwin.rc +++ b/kmreadermainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -35,10 +35,7 @@ - - &Forward - - + &Settings