[Digikam-devel] [Bug 135060] Folders without pictures in it cannot be assigned icons
Marcel Wiesweg
marcel.wiesweg at gmx.de
Thu Oct 12 12:39:19 BST 2006
------- 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=135060
marcel.wiesweg gmx de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From marcel.wiesweg gmx de 2006-10-12 13:39 -------
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;
}
More information about the Digikam-devel
mailing list