Summary: | Folders without pictures in it cannot be assigned icons | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Dieter Jurzitza <dieter.jurzitza> |
Component: | Thumbs-Album | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 0.9.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 |
Description
Dieter Jurzitza
2006-10-03 21:09:24 UTC
Currently it is only possible to set images of the same album as thumbnails. - leave it as is? - allow from subalbums as well? - no restriction, allow from any album? My two cents here: make the preview image a generic attribute of the album. Why restrict it to pictures out of the current one? Any choice would become possible - whatever the user likes most. Take care Dieter Jurzitza SVN commit 594810 by mwiesweg: Allow the freedom to assign albums thumbnails from any other album. Backport functionality from Tags icons. BUG: 135060 M +2 -1 NEWS M +20 -10 digikam/albumdb.cpp M +7 -0 digikam/albumfolderview.cpp --- trunk/extragear/graphics/digikam/NEWS #594809:594810 @@ -301,6 +301,7 @@ 180 ==> 135145 : Raw image converter fails on my raw files (cr2, crw, dng). 181 ==> 125727 : digiKam open with of raw file only shows application for octet-stream. 182 ==> 135430 : Typo automaticly should be automatically in raw image converter. -183 ==> +183 ==> 135060 : Folders without pictures in it cannot be assigned icons +184 ==> ---------------------------------------------------------------------------------------------------- --- trunk/extragear/graphics/digikam/digikam/albumdb.cpp #594809:594810 @@ -306,10 +306,13 @@ QString basePath(AlbumManager::instance()->getLibraryPath()); QStringList values; - execSql( "SELECT A.id, A.url, A.date, A.caption, A.collection, I.name \n " - "FROM Albums AS A LEFT OUTER JOIN Images AS I \n " - "ON A.icon=I.id;", &values); + execSql( "SELECT A.id, A.url, A.date, A.caption, A.collection, B.url, I.name \n " + "FROM Albums AS A \n " + " LEFT OUTER JOIN Images AS I ON A.icon=I.id \n" + " LEFT OUTER JOIN Albums AS B ON B.id=I.dirid;", &values); + QString iconAlbumUrl, iconName; + for (QStringList::iterator it = values.begin(); it != values.end();) { AlbumInfo info; @@ -324,11 +327,15 @@ ++it; info.collection = *it; ++it; - if (!(*it).isEmpty()) + iconAlbumUrl = *it; + ++it; + iconName = *it; + ++it; + + if (!iconName.isEmpty()) { - info.icon = basePath + info.url + '/' + *it; + info.icon = basePath + iconAlbumUrl + '/' + iconName; } - ++it; aList.append(info); } @@ -464,9 +471,11 @@ QString AlbumDB::getAlbumIcon(int albumID) { QStringList values; - execSql( QString("SELECT Albums.url, Images.name FROM Albums " - "LEFT OUTER JOIN Images ON Albums.icon=Images.id " - "WHERE Albums.id=%1;") + execSql( QString("SELECT B.url, I.name \n " + "FROM Albums AS A \n " + " LEFT OUTER JOIN Images AS I ON I.id=T.icon \n " + " LEFT OUTER JOIN Albums AS B ON B.id=I.dirid \n " + "WHERE T.id=%1;") .arg(albumID), &values ); if (values.isEmpty()) return QString(); @@ -549,7 +558,8 @@ { QStringList values; execSql( QString("SELECT A.url, I.name, T.iconkde \n " - "FROM Tags AS T LEFT OUTER JOIN Images AS I ON I.id=T.icon \n " + "FROM Tags AS T \n " + " LEFT OUTER JOIN Images AS I ON I.id=T.icon \n " " LEFT OUTER JOIN Albums AS A ON A.id=I.dirid \n " "WHERE T.id=%1;") .arg(tagID), &values ); --- trunk/extragear/graphics/digikam/digikam/albumfolderview.cpp #594809:594810 @@ -958,6 +958,8 @@ popMenu.insertTitle(SmallIcon("digikam"), i18n("My Albums")); popMenu.insertItem( SmallIcon("goto"), i18n("&Move Here"), 10 ); popMenu.insertItem( SmallIcon("editcopy"), i18n("&Copy Here"), 11 ); + if (imageIDs.count() == 1) + popMenu.insertItem(i18n("Set as Album Thumbnail"), 12); popMenu.insertSeparator(-1); popMenu.insertItem( SmallIcon("cancel"), i18n("C&ancel") ); popMenu.setMouseTracking(true); @@ -980,6 +982,11 @@ SLOT(slotDIOResult(KIO::Job*))); break; } + case 12: + { + QString errMsg; + AlbumManager::instance()->updatePAlbumIcon(destAlbum, imageIDs.first(), errMsg); + } default: break; } |