[Digikam-devel] [Bug 118526] make it possible to remove an album's thumbnail
Gilles Caulier
caulier.gilles at free.fr
Fri Sep 1 12:19:17 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=118526
------- Additional Comments From caulier.gilles free fr 2006-09-01 13:19 -------
SVN commit 579591 by cgilles:
digikam from trunk: new popup menu options to reset album/tag thumbs in tag filter view
CCBUGS: 118526
M +53 -43 tagfilterview.cpp
M +9 -4 tagfilterview.h
--- trunk/extragear/graphics/digikam/digikam/tagfilterview.cpp #579590:579591
@ -1,11 +1,12 @
/* ============================================================
- * File : tagfilterview.cpp
- * Author: Renchi Raju <renchi pooh tam uiuc edu>
- * Date : 2005-05-05
- * Description :
+ * Authors: Renchi Raju <renchi pooh tam uiuc edu>
+ * Caulier Gilles <caulier dot gilles at kdemail dot net>
+ * Date : 2005-05-05
+ * Description : tags filter view
*
* Copyright 2005 by Renchi Raju
-
+ * Copyright 2006 by Gilles Caulier
+ *
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
@ -136,13 +137,14 @
class TagFilterViewPriv
{
+
public:
- QTimer* timer;
+ QTimer *timer;
};
TagFilterView::TagFilterView(QWidget* parent)
- : FolderView(parent)
+ : FolderView(parent)
{
d = new TagFilterViewPriv;
d->timer = new QTimer(this);
@ -159,29 +161,36 @
notTaggedItem->setPixmap(0, AlbumThumbnailLoader::instance()->getStandardTagIcon());
connect(AlbumManager::instance(), SIGNAL(signalAlbumAdded(Album*)),
- SLOT(slotTagAdded(Album*)));
+ this, SLOT(slotTagAdded(Album*)));
+
connect(AlbumManager::instance(), SIGNAL(signalAlbumDeleted(Album*)),
- SLOT(slotTagDeleted(Album*)));
+ this, SLOT(slotTagDeleted(Album*)));
+
connect(AlbumManager::instance(), SIGNAL(signalAlbumRenamed(Album*)),
- SLOT(slotTagRenamed(Album*)));
+ this, SLOT(slotTagRenamed(Album*)));
+
connect(AlbumManager::instance(), SIGNAL(signalAlbumsCleared()),
- SLOT(slotClear()));
+ this, SLOT(slotClear()));
+
connect(AlbumManager::instance(), SIGNAL(signalAlbumIconChanged(Album*)),
- SLOT(slotAlbumIconChanged(Album*)));
+ this, SLOT(slotAlbumIconChanged(Album*)));
+
connect(AlbumManager::instance(), SIGNAL(signalTAlbumMoved(TAlbum*, TAlbum*)),
- SLOT(slotTagMoved(TAlbum*, TAlbum*)));
+ this, SLOT(slotTagMoved(TAlbum*, TAlbum*)));
AlbumThumbnailLoader *loader = AlbumThumbnailLoader::instance();
+
connect(loader, SIGNAL(signalThumbnail(Album *, const QPixmap&)),
- SLOT(slotGotThumbnailFromIcon(Album *, const QPixmap&)));
+ this, SLOT(slotGotThumbnailFromIcon(Album *, const QPixmap&)));
+
connect(loader, SIGNAL(signalFailed(Album *)),
- SLOT(slotThumbnailLost(Album *)));
+ this, SLOT(slotThumbnailLost(Album *)));
connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- SLOT(slotContextMenu(QListViewItem*, const QPoint&, int)));
+ this, SLOT(slotContextMenu(QListViewItem*, const QPoint&, int)));
connect(d->timer, SIGNAL(timeout()),
- SLOT(slotTimeOut()));
+ this, SLOT(slotTimeOut()));
}
TagFilterView::~TagFilterView()
@ -280,8 +289,7 @
else
{
QPopupMenu popMenu(this);
- popMenu.insertItem( SmallIcon("tag"),
- i18n("Assign Tag '%1' to Dropped Items")
+ popMenu.insertItem( SmallIcon("tag"), i18n("Assign Tag '%1' to Dropped Items")
.arg(destAlbum->prettyURL()), 10) ;
popMenu.insertSeparator(-1);
popMenu.insertItem( SmallIcon("cancel"), i18n("C&ancel") );
@ -359,8 +367,7 @
if (!tag || !newParent)
return;
- TagFilterViewItem* item =
- (TagFilterViewItem*)(tag->extraData(this));
+ TagFilterViewItem* item = (TagFilterViewItem*)(tag->extraData(this));
if (!item)
return;
@ -369,8 +376,7 @
QListViewItem* oldPItem = item->parent();
oldPItem->takeItem(item);
- TagFilterViewItem* newPItem =
- (TagFilterViewItem*)(newParent->extraData(this));
+ TagFilterViewItem* newPItem = (TagFilterViewItem*)(newParent->extraData(this));
if (newPItem)
newPItem->insertItem(item);
else
@ -380,8 +386,7 @
{
takeItem(item);
- TagFilterViewItem* newPItem =
- (TagFilterViewItem*)(newParent->extraData(this));
+ TagFilterViewItem* newPItem = (TagFilterViewItem*)(newParent->extraData(this));
if (newPItem)
newPItem->insertItem(item);
@ -399,8 +404,7 @
if (!tag)
return;
- TagFilterViewItem* item =
- (TagFilterViewItem*)(album->extraData(this));
+ TagFilterViewItem* item = (TagFilterViewItem*)(album->extraData(this));
if (!item)
return;
@ -504,6 +508,7 @
if (item)
{
popmenu.insertItem(SmallIcon("pencil"), i18n("Edit Tag Properties..."), 11);
+ popmenu.insertItem(SmallIcon("reload_page"), i18n("Reset Tag Icon"), 13);
popmenu.insertItem(SmallIcon("edittrash"), i18n("Delete Tag"), 12);
}
@ -525,6 +530,12 @
tagDelete(item);
break;
}
+ case 13:
+ {
+ QString errMsg;
+ AlbumManager::instance()->updateTAlbumIcon(item->m_tag, QString(), 0, errMsg);
+ break;
+ }
default:
break;
}
@ -623,19 +634,18 @
if (children)
{
- int result =
- KMessageBox::warningContinueCancel(this,
- i18n("Tag '%1' has one subtag. "
- "Deleting this will also delete "
- "the subtag. "
- "Are you sure you want to continue?",
- "Tag '%1' has %n subtags. "
- "Deleting this will also delete "
- "the subtags. "
- "Are you sure you want to continue?",
- children).arg(tag->title()),
- i18n("Delete Tag"),
- KGuiItem(i18n("Delete"),"editdelete"));
+ int result = KMessageBox::warningContinueCancel(this,
+ i18n("Tag '%1' has one subtag. "
+ "Deleting this will also delete "
+ "the subtag. "
+ "Are you sure you want to continue?",
+ "Tag '%1' has %n subtags. "
+ "Deleting this will also delete "
+ "the subtags. "
+ "Are you sure you want to continue?",
+ children).arg(tag->title()),
+ i18n("Delete Tag"),
+ KGuiItem(i18n("Delete"),"editdelete"));
if(result == KMessageBox::Continue)
{
@ -646,9 +656,9 @
}
else
{
- int result =
- KMessageBox::warningContinueCancel(0, i18n("Delete '%1' tag?")
- .arg(tag->title()),i18n("Delete Tag"), KGuiItem(i18n("Delete"),"editdelete"));
+ int result = KMessageBox::warningContinueCancel(0, i18n("Delete '%1' tag?")
+ .arg(tag->title()),i18n("Delete Tag"),
+ KGuiItem(i18n("Delete"), "editdelete"));
if (result == KMessageBox::Continue)
{
--- trunk/extragear/graphics/digikam/digikam/tagfilterview.h #579590:579591
@ -1,7 +1,11 @
/* ============================================================
- * Author: Renchi Raju <renchi pooh tam uiuc edu>
- * Date : 2005-05-05
+ * Authors: Renchi Raju <renchi pooh tam uiuc edu>
+ * Caulier Gilles <caulier dot gilles at kdemail dot net>
+ * Date : 2005-05-05
+ * Description : tags filter view
+ *
* Copyright 2005 by Renchi Raju
+ * Copyright 2006 by Gilles Caulier
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
@ -57,8 +61,7 @
void slotAlbumIconChanged(Album* album);
void slotTimeOut();
void slotContextMenu(QListViewItem*, const QPoint&, int);
- void slotGotThumbnailFromIcon(Album *album,
- const QPixmap& thumbnail);
+ void slotGotThumbnailFromIcon(Album *album, const QPixmap& thumbnail);
void slotThumbnailLost(Album *album);
private:
@ -68,6 +71,8 @
void tagDelete(TagFilterViewItem* item);
void setTagThumbnail(TAlbum *album);
+private:
+
TagFilterViewPriv *d;
};
More information about the Digikam-devel
mailing list