Commit 69e77bd9 authored by Grégory Oestreicher's avatar Grégory Oestreicher
Browse files

Fix duplicate collection names in the same resource

Use the display name attribute instead of the collection
name to prevent naming conflicts if a calendar and an address
book happen to have the same name.

BUG: 284783
parent ebd22c1b
......@@ -441,10 +441,11 @@ void DavGroupwareResource::onRetrieveCollectionsFinished( KJob *job )
Akonadi::Collection collection;
collection.setParentCollection( mDavCollectionRoot );
collection.setRemoteId( davCollection.url() );
if ( davCollection.displayName().isEmpty() ) {
collection.setName( name() + QLatin1String(" (") + davCollection.url() + QLatin1Char(')') );
} else {
collection.setName( davCollection.displayName() );
collection.setName( collection.remoteId() );
if ( !davCollection.displayName().isEmpty() ) {
EntityDisplayAttribute *attr = collection.attribute<EntityDisplayAttribute>( Collection::AddIfMissing );
attr->setDisplayName( davCollection.displayName() );
}
QStringList mimeTypes;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment