[Digikam-devel] [Bug 117287] New: search albums on read only album path
Domenico Salvagnin
domenico.salvagnin at tin.it
Tue Nov 29 16:24:52 GMT 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=117287
Summary: search albums on read only album path
Product: digikam
Version: 0.8.0
Platform: Slackware Packages
OS/Version: Linux
Status: UNCONFIRMED
Severity: wishlist
Priority: NOR
Component: general
AssignedTo: digikam-devel kde org
ReportedBy: domenico.salvagnin tin it
Version: 0.8.0 (using KDE KDE 3.4.2)
Installed from: Slackware Packages
As explained in #114682, I need to use digikam on a read only library path. In this scenario searches are quite unusable, since it is not possible to add a search album. I've developed a 4-line-patch that solves the problem, which allows the creation of temporary search albums not stored in the db.
This is the patch (svn diff output)
--- albummanager.cpp (revision 484166)
+++ albummanager.cpp (working copy)
@ -75,6 +75,9 @
DAlbum *rootDAlbum;
SAlbum *rootSAlbum;
+ // manage temporary search albums
+ int max_temp_salbum_id;
+
bool changed;
PAlbumDict pAlbumDict;
@ -110,6 +113,9 @
d->rootDAlbum = 0;
d->rootSAlbum = 0;
+ // temporary search albums in the range 8000-9999
+ d->max_temp_salbum_id = 8000;
+
d->itemHandler = 0;
d->currentAlbum = 0;
@ -1110,7 +1116,11 @
int id = d->db->addSearch(url.queryItem("name"), url);
if (id == -1)
- return 0;
+ {
+ // cannot insert search on db: will be a temporary album
+ id = d->max_temp_salbum_id;
+ d->max_temp_salbum_id++;
+ }
SAlbum* album = new SAlbum(id, url, simple, false);
album->setTitle(url.queryItem("name"));
More information about the Digikam-devel
mailing list