Bug 208851

Summary: Collections: Detection of duplicate collections too strict [patch]
Product: [Applications] digikam Reporter: Michael G. Hansen <mike>
Component: Setup-DatabaseAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.0
Attachments: Patch against r1028026, use KUrl::parentOf

Description Michael G. Hansen 2009-09-29 10:14:12 UTC
Version:           1.0.0-beta5 (using KDE 4.3.1)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Assume I have a network collection under /mnt/shares/pics. Then adding /mnt/shared/pics-new is rejected with the message "There is already a collection for a network share with the same path" although the new share is a sibling, not a child. On the other hand, adding /mnt/shares is not detected as being a parent to /mnt/shared/pics

Current codes checks if the path for a new collection is contained in the path to existing collections. Attached patch uses KUrl::parentOf instead, and checks relations in both directions (new.parentOf(old) and old.parentOf(new)).
Comment 1 Michael G. Hansen 2009-09-29 10:14:53 UTC
Created attachment 37232 [details]
Patch against r1028026, use KUrl::parentOf
Comment 2 caulier.gilles 2009-09-29 10:18:49 UTC
Marcel,

Patch is simple and sound fine for me... Your viewpoint ? No problem here for you ?

Gilles
Comment 3 Marcel Wiesweg 2009-09-29 18:58:41 UTC
Fine for me
Comment 4 Michael G. Hansen 2009-09-30 06:26:34 UTC
SVN commit 1029537 by mghansen:

Improve checks for existing collections when adding new ones.

BUG: 208851


 M  +2 -1      NEWS  
 M  +10 -3     libs/database/collectionmanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1029537