Bug 330261

Summary: New Message from Template only uses default identity
Product: [Applications] kmail2 Reporter: Styopa Semenukha <semenukha+kdebugs>
Component: UIAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: montel, winter
Priority: NOR    
Version: 4.11.3   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Styopa Semenukha 2014-01-21 18:43:32 UTC
The submenu under File -> New… -> Message from template only lists templates from default identity. In default configuration this is the folder "KMail folders/templates".
If you configure your default identity's template folder to be any other folder, its contents will be listed in the said submenu (correct).
If you configure your non-default identity's template folder to be any other folder, its contents will sometimes (see below) be ignored, even if you're currently using that identity (e.g. Ctrl+N will correctly compose a message using that identity).

Reproducible: Always

Steps to Reproduce:
1. Create two identities: Work and Home. Make Home identity default.
2. Create two folders: Work/Templates and Home/Templates.
3. Configure each folder from step 2 to be the template folder of the respective identity. Use Settings -> Configure Kmail -> Identities -> [each identity] -> Modify -> Advanced -> Templates folder: [this identity]/Templates.
4. Create two messages: WorkMessage in Work/Templates and HomeMessage in Home/Templates.
5. Optionally restart KMail.
6. Open File -> New -> Message from template.
Actual Results:  
Submenu will be empty in most cases.

Expected Results:  
1. Submenu must contain the command "WorkMessage" if Work identity is active and "HomeMessage" if Home is active.
-or-
2. Submenu must contain both commands "WorkMessage" and "HomeMessage".

The app will show the expected result #1, if you select the identity root folder (e.g. Work or Home) in the folder tree view.
However, if you select any subfolder (e.g. Home/Inbox), it will only list "HomeMessage". If you select Work/Inbox, it will be empty.
Comment 1 Laurent Montel 2014-02-21 07:24:16 UTC
I confirm there is some problem in this feature
Comment 2 Laurent Montel 2014-02-21 07:27:37 UTC
    if ( mCurrentFolder ) {
        const KPIMIdentities::Identity & ident =
                kmkernel->identityManager()->identityForUoidOrDefault( mCurrentFolder->identity() );
        mTemplateFolder = CommonKernel->collectionFromId( ident.templates().toLongLong() );
    }

Finally it works.
It looks at identity configurate in folder.
You need to define identity in configure folder and it works fine.
Comment 3 Denis Kurz 2016-09-24 17:55:14 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 4 Styopa Semenukha 2016-10-13 03:11:23 UTC
(In reply to Denis Kurz from comment #3)
> This bug has only been reported for versions before 4.14, which have been
> unsupported for at least two years now. Can anyone tell if this bug still
> present?
> 
> If noone confirms this bug for a Framework-based version of kmail2 (version
> 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in
> about three months.

I can't reproduce it anymore in 5.2.3 (KF 5.25.0). Kindly go ahead and mark as resolved. Thanks!