From kde-commits Sun Mar 03 17:33:56 2013 From: Tobias Koenig Date: Sun, 03 Mar 2013 17:33:56 +0000 To: kde-commits Subject: [kdepim-runtime/KDE/4.10] resources: Keep custom name/icon of resource collection on collection sync Message-Id: <20130303173356.655A5A604F () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=136233204616169 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/88b4257c716bc31cecc7ff4c7904b1f924d66= f1f diff --git a/resources/icaldir/icaldirresource.cpp b/resources/icaldir/ical= dirresource.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 =3D c.attribute( Co= llection::AddIfMissing ); + attr->setDisplayName( i18n( "Calendar Folder" ) ); attr->setIconName( "office-calendar" ); = Collection::List list; diff --git a/resources/vcarddir/vcarddirresource.cpp b/resources/vcarddir/v= carddirresource.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 "<( Co= llection::AddIfMissing ); + attr->setDisplayName( i18n( "Contacts Folder" ) ); attr->setIconName( "x-office-address-book" ); = Collection::List list;