Bug 312627

Summary: cannot create a new album in root "My Albums"
Product: [Applications] digikam Reporter: bogdan
Component: Database-AlbumsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bogdan, caulier.gilles, smit.meh
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 3.0.0

Description bogdan 2013-01-04 19:20:45 UTC
When trying to create a new album in root it always creates the new album in one sub album ( the second-last one in my case)

Reproducible: Always

Steps to Reproduce:
1. select My Albums in the navigator ( to make sure that there is no other selected)
2. right click the My albums  and select New
3. select in Child of : Root or even Selected album ( remember My Albums is now selected)
4. The new album is always created in the same place, in my case as a subalbum in the second last album 
5. If trying to create a new album in a sub-album it works fine.
Actual Results:  
described above, not created in the Root as expected

Expected Results:  
I tried many times with the same outcome

create a root album
Comment 1 Smit Mehta 2013-01-04 19:31:43 UTC
Hi bogdan

If you are using digiKam in english, the left pane will be something like this :

My Albums
   - Album 1
       - SubAlbum 1.1
       - SubAlbum 1.2
           - SubAlbum 1.2.1
   - Album 2
       - SubAlbum 2.1

Now Album 1 and Album 2 cannot be created inside digiKam. These are actually collections which you want to use in digiKam, selected by you when you start or you can add / modify from  Settings -> Configure digiKam -> Collections. I think you already have Album 1 and you want to create Album 2. That will be done by the process i explained in above lines. Otherwise, whenever you click as "root" while making an album inside digikam, it will be either album1 or album2 based on your current selection.

I hope I am clear enough. Feel free if your doubt is still not cleared. You can also attach a screenshot explaining what you exactly want to do.

Smit
Comment 2 bogdan 2013-01-06 15:21:40 UTC
HI Smit,

You are right. It works the way you described. 

However, for people like me who forget, it would be nice if you can add a piece of code that will notify you when My Albums is selected that creating an album there is not possible, instead of creating an album randomly.   

To give you an example: 
Even if I select an album in my first collection and look at some pictures there after that I select My Albums and try to create an album in Root, it will be created in my second last collection for some reason.  There is some strange logic that keeps the current pointer at the last collection. I think that in this case because the selection is on the root of all collections an error message should be displayed

I believe that in this case create in Root means create in the root of the current collection. Initially I thought that it will create a collection in My Albums.

Regards,
Bogdan
Comment 3 Smit Mehta 2013-01-06 16:31:15 UTC
Hi Bogdan,

I got your point. I will see what can be done. Thanks.

Smit
Comment 4 Smit Mehta 2013-01-06 17:30:30 UTC
Hi Gilles

Is there a way to disable the right click on "My Albums", which is the root? Also, we should disable on all the collections' name. Because its obsolete and it is creating confusion. The options in right click are

- New -> Cant make a new album here. Needs to be added as a collection.
- Open in file manager, Open in terminal -> Falsely opens 'root' in dolphin.
- Rename, Import, Export, Delete -> Not possible
- Properties -> N/A

So you see, its completely useless and not intuitive to have a right click there. Also, there is no use. What do you think about this?

Smit
Comment 5 caulier.gilles 2013-01-06 18:37:02 UTC
Smit,

In Album class, if i remember, there is a propertie to see if album is root or not.

But i'm not sure, if root album, which is normally a collection title is assigned as root album. If it's not the case, well album must be null, i think.

You need to investiguate in code. After that clean and wrap all contextual menus accordingly.

Gilles
Comment 6 Marcel Wiesweg 2013-01-07 18:39:42 UTC
Smit, have a look at our nice class class AlbumSelectionTreeView::AlbumSelectionTreeViewPriv::AlbumSelectionTreeViewContextMenuElement in albums/albumselectiontreeview.cpp

For any Album*, you have isRoot() to find out if the album is the "root album" which serves as the root of the tree structure. 
For PAlbum*, there is isAlbumRoot() which tells you if the album correspondends to the topmost album of a Collection. These albums are physical, they can contain pictures.
Comment 7 Smit Mehta 2013-01-08 16:43:40 UTC
Git commit 7c22c5d73bd41b7ea755adc4e597ecfde17d8bfd by Smit Mehta.
Committed on 08/01/2013 at 17:41.
Pushed by smitmehta into branch 'master'.

Polish.
Removed obselete actions from context menu in album tree view for Root and Parent collections.
Added KMessageBox showing error if someone tries to open Root in terminal or file manager.

M  +1    -1    digikam/album/albumpropsedit.cpp
M  +10   -2    digikam/album/albumselectiontreeview.cpp
M  +14   -0    digikam/views/digikamview.cpp

http://commits.kde.org/digikam/7c22c5d73bd41b7ea755adc4e597ecfde17d8bfd