Commit 6f2ffa69 authored by Kartik Ramesh's avatar Kartik Ramesh

Implementation to clear Face Tag Icon.

Particularly when the face is removed through the Face Context Menu
using Remove Face Tags.
parent 093690ea
......@@ -102,6 +102,8 @@
#include "contextmenuhelper.h"
#include "albumlabelssearchhandler.h"
#include "dnotificationwidget.h"
#include "coredb.h"
#include "coredbaccess.h"
#ifdef HAVE_MEDIAPLAYER
# include "mediaplayerview.h"
......
......@@ -77,6 +77,32 @@ void ItemIconView::slotAssignTag(int tagID)
void ItemIconView::slotRemoveTag(int tagID)
{
FileActionMngr::instance()->removeTags(selectedInfoList(ApplicationSettings::Metadata), QList<int>() << tagID);
// Give some Time for Tag Removal to take place.
QTimer::singleShot(200, [=]()
{
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 ;
}
}
}
});
}
......
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