[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kphotoalbum/area_workflow_improvement] AnnotationDialog: If a tag is removed from an area or the ar
From: Tobias Leupold <tobias.leupold () gmx ! de>
Date: 2016-11-30 21:18:25
Message-ID: E1cCCGn-0004OP-Sn () code ! kde ! org
[Download RAW message or body]
Git commit 0230f57be3d626551822d7c5b48c39a9a58d259c by Tobias Leupold.
Committed on 30/11/2016 at 21:17.
Pushed by tleupold into branch 'area_workflow_improvement'.
If a tag is removed from an area or the area is deleted, deselect the tag.
M +6 -0 AnnotationDialog/ListSelect.cpp
M +2 -0 AnnotationDialog/ListSelect.h
M +4 -4 AnnotationDialog/ResizableFrame.cpp
https://commits.kde.org/kphotoalbum/0230f57be3d626551822d7c5b48c39a9a58d259c
diff --git a/AnnotationDialog/ListSelect.cpp b/AnnotationDialog/ListSelect.cpp
index 644b803..6010c69 100644
--- a/AnnotationDialog/ListSelect.cpp
+++ b/AnnotationDialog/ListSelect.cpp
@@ -880,5 +880,11 @@ void AnnotationDialog::ListSelect::ensureTagIsSelected(QString \
category, QString matchingTags.first()->setCheckState(0, Qt::Checked);
}
+void AnnotationDialog::ListSelect::deselectTag(QString tag)
+{
+ QList<QTreeWidgetItem *> matchingTags = m_treeWidget->findItems(tag, \
Qt::MatchExactly | Qt::MatchRecursive, 0); + \
matchingTags.first()->setCheckState(0, Qt::Unchecked); +}
+
#include "ListSelect.moc"
// vi:expandtab:tabstop=4 shiftwidth=4:
diff --git a/AnnotationDialog/ListSelect.h b/AnnotationDialog/ListSelect.h
index 45b2c27..d5c8044 100644
--- a/AnnotationDialog/ListSelect.h
+++ b/AnnotationDialog/ListSelect.h
@@ -72,6 +72,8 @@ public:
void connectLineEdit(CompletableLineEdit *le);
+ void deselectTag(QString tag);
+
public slots:
void slotReturn();
void slotExternalReturn(const QString& text);
diff --git a/AnnotationDialog/ResizableFrame.cpp \
b/AnnotationDialog/ResizableFrame.cpp index fd04d93..c9b69c4 100644
--- a/AnnotationDialog/ResizableFrame.cpp
+++ b/AnnotationDialog/ResizableFrame.cpp
@@ -499,8 +499,8 @@ void AnnotationDialog::ResizableFrame::setTagData(QString \
category, QString tag,
void AnnotationDialog::ResizableFrame::removeTag()
{
- // Add the tag to the positionable candidate list again
- m_dialog->addTagToCandidateList(m_tagData.first, m_tagData.second);
+ // Deselect the tag
+ m_dialog->listSelectForCategory(m_tagData.first)->deselectTag(m_tagData.second);
// Delete the tag data from this area
removeTagData();
}
@@ -532,8 +532,8 @@ void AnnotationDialog::ResizableFrame::removeTagData()
void AnnotationDialog::ResizableFrame::remove()
{
if (! m_tagData.first.isEmpty()) {
- // Re-add the associated tag to the candidate list
- removeTag();
+ // Deselect the tag
+ m_dialog->listSelectForCategory(m_tagData.first)->deselectTag(m_tagData.second);
}
// Delete the area
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic