[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim-runtime/KDE/4.10] resources: Keep custom name/icon of resource collection on collection sync
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2013-03-03 17:33:56
Message-ID: 20130303173356.655A5A604F () git ! kde ! org
[Download RAW message or body]

Git commit 88b4257c716bc31cecc7ff4c7904b1f924d66f1f by Tobias Koenig.
Committed on 03/03/2013 at 18:32.
Pushed by tokoe into branch 'KDE/4.10'.

Keep custom name/icon of resource collection on collection sync

To ensure that the user modifies the display name of the resource
collection and not the collection name itself, we have to preset
the display name in the EntityDisplayAttribute already.

Additionally the clearCache() call must be removed, it's not needed
if we use the directory path as remoteId, because then the collection
sync algorithm will cleanup the collection with the old remoteId.

BUG: 314446
FIXED-IN: 4.10.2

M  +2    -2    resources/icaldir/icaldirresource.cpp
M  +2    -2    resources/vcarddir/vcarddirresource.cpp

http://commits.kde.org/kdepim-runtime/88b4257c716bc31cecc7ff4c7904b1f924d66f1f

diff --git a/resources/icaldir/icaldirresource.cpp b/resources/icaldir/icaldirresource.cpp
index d653220..154c254 100644
--- a/resources/icaldir/icaldirresource.cpp
+++ b/resources/icaldir/icaldirresource.cpp
@@ -101,7 +101,6 @@ void ICalDirResource::configure( WId windowId )
   SettingsDialog dlg( windowId );
   dlg.setWindowIcon( KIcon( "text-calendar" ) );
   if ( dlg.exec() ) {
-    clearCache();
     initializeICalDirectory();
     loadIncidences();
 
@@ -233,7 +232,7 @@ void ICalDirResource::retrieveCollections()
   Collection c;
   c.setParentCollection( Collection::root() );
   c.setRemoteId( iCalDirectoryName() );
-  c.setName( i18n( "Calendar Folder" ) );
+  c.setName( name() );
   c.setContentMimeTypes( QStringList() << "text/calendar" );
   if ( Settings::self()->readOnly() ) {
     c.setRights( Collection::CanChangeCollection );
@@ -247,6 +246,7 @@ void ICalDirResource::retrieveCollections()
   }
 
   EntityDisplayAttribute* attr = c.attribute<EntityDisplayAttribute>( Collection::AddIfMissing );
+  attr->setDisplayName( i18n( "Calendar Folder" ) );
   attr->setIconName( "office-calendar" );
 
   Collection::List list;
diff --git a/resources/vcarddir/vcarddirresource.cpp b/resources/vcarddir/vcarddirresource.cpp
index e5d5ded..5d17d26 100644
--- a/resources/vcarddir/vcarddirresource.cpp
+++ b/resources/vcarddir/vcarddirresource.cpp
@@ -60,7 +60,6 @@ void VCardDirResource::configure( WId windowId )
   SettingsDialog dlg( windowId );
   dlg.setWindowIcon( KIcon( "text-directory" ) );
   if ( dlg.exec() ) {
-    clearCache();
     initializeVCardDirectory();
     loadAddressees();
 
@@ -90,7 +89,7 @@ bool VCardDirResource::loadAddressees()
           mAddressees.insert( addr.uid(), addr );
         }
       } else {
-	kDebug()<<" file can't be load "<<it.filePath();
+        kDebug()<<" file can't be load "<<it.filePath();
       }
     }
   }
@@ -224,6 +223,7 @@ void VCardDirResource::retrieveCollections()
   }
 
   EntityDisplayAttribute* attr = c.attribute<EntityDisplayAttribute>( Collection::AddIfMissing );
+  attr->setDisplayName( i18n( "Contacts Folder" ) );
   attr->setIconName( "x-office-address-book" );
 
   Collection::List list;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic