[Digikam-devel] #images in album/tag list
Marcel Wiesweg
marcel.wiesweg at gmx.de
Sun Jan 28 12:16:50 GMT 2007
> > - album tree view,
> > - date tree view
> > - search tree view
> > - tags filtrer tree view
> > - tags tree view from left side bar
> > - tags tree view on Comments & Tags
> >
> > Some of piece can be set on/off independetly, but not sure.
>
> Are search and date "albums" also stored in DB? In that case it should not
> be problem to implement it, otherwise we would need to count (slow...).
First place to look at is AlbumManager::scanPAlbums, scanTAlbums, scanDAlbums,
scanSAlbums.
For Physical and Tag albums, everything is done from AlbumManager and AlbumDB.
The information can be included in the AlbumInfo/TagInfo structure returned
from AlbumDB::scanAlbums/scanTags, and can be cached in the corresponding
Album objects.
Updating:
When a file is added, the KDirWatch will call DIO::scan, which lets the
ioslave scan and then calls AlbumManager::refresh, which call scanPAlbums.
So here is a possible place to update the count of existing albums (around
line 375?)
For tags, you could use the signals from ImagesAttributesWatch. For the first
signal you have to find out the tags of the imageId. Then you will need to
add a count function to the AlbumDB to retrieve the number of images.
Date albums are loaded in the AlbumManager with the digikamdates ioslave, with
folder==yes. You can see that as the date is stored as a string, all images
have to be read from db anyway, and the count can be retrieved.
I think for updating, the same applies as for physical albums.
Search albums are different. As far as I see looking quickly through the
source, the searches are executed only when the album has been selected (by
AlbumLister, and the digikamsearch ioslave). So retrieving the count here
would require to execute each search, and updating would be a nightmare too.
> I have looked in that code, but AFAIR, it uses count() of images in the
> widget, therefore it does not need to query database. For new feature, we
> do not have this info yet (afaik).
>
> I will probably do this in phases anyway as I would like to receive
> review/feedback before final big patch:
> 1. Albums
> 2. Tags
> 3. Dates
> 4. Searches
> 5. Tag Filter
More information about the Digikam-devel
mailing list