Commit 64c4dfce authored by Kartik Ramesh's avatar Kartik Ramesh

Implementation to automatically remove icon from tags

parent adf3ea4d
......@@ -347,6 +347,28 @@ void FaceUtils::addNormalTag(qlonglong imageId, int tagId)
void FaceUtils::removeNormalTag(qlonglong imageId, int tagId)
{
FileActionMngr::instance()->removeTag(ItemInfo(imageId), tagId);
int count = CoreDbAccess().db()->getNumberOfImagesInTagProperties(tagId,
ImageTagPropertyName::tagRegion());
/**
* If the face just removed was the final face
* associated with that Tag, reset Tag Icon.
*/
if (count == 0)
{
TAlbum* album = AlbumManager::instance()->findTAlbum(tagId);
if (album && album->iconId() != 0)
{
QString err;
if (!AlbumManager::instance()->updateTAlbumIcon(album, QString(),
0, err))
{
qCDebug(DIGIKAM_GENERAL_LOG) << err ;
}
}
}
}
void FaceUtils::removeNormalTags(qlonglong imageId, QList<int> tagIds)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment