Bug 259082 - [regression] Special folder icons do not show
Summary: [regression] Special folder icons do not show
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: folders (show other bugs)
Version: 2.0.89
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 259594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-07 09:49 UTC by Thiago Macieira
Modified: 2011-01-26 06:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Macieira 2010-12-07 09:49:50 UTC
Version:           2.0.89 (using Devel) 
OS:                Linux

If you configure a folder to be special (sent mail, trash, templates, drafts), the special icon should appear next to the folder name. However, this doesn't happen for most cases.

Reproducible: Sometimes

Steps to Reproduce:
1. Settings > Configure KMail
2. Identity, select an account, Modify
3. In the Advanced tab, click on one of the folder selection icons and select a folder

or
1. Settings > Configure KMail
2. Accounts, select an account, click Modify
3. In the Advanced tab, click the folder selection icon and select a folder for trash


Actual Results:  
The folder icon does not change in the folder view.

Expected Results:  
The folder should get a special icon indicating its purpose.

OS: Linux (i686) release 2.6.35.2-server-1mnb
Compiler: gcc

One of my three trash folders has the proper icon. None of the other special folders has special icons.
Comment 1 Laurent Montel 2010-12-09 14:02:58 UTC
I confirm this bug.
I tried to fix it in imap resource but don't understand why it doesn't work
Index: setupserver.cpp
===================================================================
--- setupserver.cpp     (révision 1204707)
+++ setupserver.cpp     (copie de travail)
@@ -48,6 +48,7 @@
 #include <akonadi/kmime/specialmailcollections.h>
 #include <akonadi/kmime/specialmailcollectionsrequestjob.h>
 #include <akonadi/resourcesettings.h>
+#include <akonadi/entitydisplayattribute.h>
 #include <kemailsettings.h>
 #include <klocale.h>
 #include <kpushbutton.h>
@@ -277,7 +278,14 @@
   Settings::self()->setSieveVacationFilename( m_vacationFileName );
 
   Settings::self()->setTrashCollection( m_ui->folderRequester->collection().id() );
+  Akonadi::EntityDisplayAttribute *attribute =  m_ui->folderRequester->collection().attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
+  attribute->setIconName( QLatin1String( "user-trash" ) );
+  Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( m_ui->folderRequester->collection() );
+  job->start();
Comment 2 Volker Krause 2010-12-10 09:10:17 UTC
The patch looks like the right approach, but you are modifying a temporary copy of the collection (Akonadi::Collection is implicitly shared), so the ItemModifyJob will not actually change anything. Try something like:
Akonadi::Collection trash = m_ui->folderRequester->collection();
Akonadi::EntityDisplayAttribute *attribute = trash.attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
attribute->setIconName( QLatin1String( "user-trash" ) );
new Akonadi::CollectionModifyJob( trash );

(Akonadi::Job sub-classes are auto-started, so no need to explicitly call start() btw).
Comment 3 Laurent Montel 2010-12-10 09:50:54 UTC
Ok works fine now that we don't use temporary copy thanks
Comment 4 Laurent Montel 2010-12-10 09:52:28 UTC
SVN commit 1205151 by mlaurent:

Fix Special folder icons do not show bug #259082
Fix for trash icons.
Will look at for other special folder type
CCBUG: 259082


 M  +7 -0      setupserver.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1205151
Comment 5 m.wege 2010-12-15 10:23:16 UTC
*** Bug 259594 has been marked as a duplicate of this bug. ***