Commit 4d66ad00 authored by Maik Qualmann's avatar Maik Qualmann

do not delete QAction via sender from the dialog

The QAction will later be deleted in the dialog.
BUGS: 421361
FIXED-IN: 7.0.0
parent c97025cb
......@@ -719,4 +719,5 @@ BUGFIXES:
698 ==> 368444 - Not supporting XCF anymore.
699 ==> 412339 - Bug report "Gimp 2.10 XCF serious issue".
700 ==> 406461 - Can't update from V9 to V10.
701 ==>
701 ==> 421361 - Removing a keyboard shortcut crashes Digikam.
702 ==>
......@@ -327,10 +327,10 @@ void TagsActionMngr::slotTagActionChanged()
ks = QKeySequence(lst.first());
}
updateTagShortcut(tagId, ks);
updateTagShortcut(tagId, ks, false);
}
void TagsActionMngr::updateTagShortcut(int tagId, const QKeySequence& ks)
void TagsActionMngr::updateTagShortcut(int tagId, const QKeySequence& ks, bool delAction)
{
if (!tagId)
{
......@@ -350,12 +350,12 @@ void TagsActionMngr::updateTagShortcut(int tagId, const QKeySequence& ks)
if (ks.isEmpty())
{
removeTagActionShortcut(tagId);
removeTagActionShortcut(tagId, delAction);
tprop.removeProperties(TagPropertyName::tagKeyboardShortcut());
}
else
{
removeTagActionShortcut(tagId);
removeTagActionShortcut(tagId, delAction);
tprop.setProperty(TagPropertyName::tagKeyboardShortcut(), ks.toString());
createTagActionShortcut(tagId);
}
......@@ -374,7 +374,7 @@ void TagsActionMngr::slotAlbumDeleted(Album* album)
qCDebug(DIGIKAM_GENERAL_LOG) << "Delete Shortcut assigned to tag " << album->id();
}
bool TagsActionMngr::removeTagActionShortcut(int tagId)
bool TagsActionMngr::removeTagActionShortcut(int tagId, bool delAction)
{
if (!d->tagsActionMap.contains(tagId))
{
......@@ -392,7 +392,10 @@ bool TagsActionMngr::removeTagActionShortcut(int tagId)
ac->takeAction(act);
}
delete act;
if (delAction)
{
delete act;
}
}
}
......
......@@ -73,7 +73,7 @@ public:
* Updates the shortcut action for a tag. Call this when a shortcut was
* added, removed or changed.
*/
void updateTagShortcut(int tagId, const QKeySequence& ks);
void updateTagShortcut(int tagId, const QKeySequence& ks, bool delAction = true);
QString ratingShortcutPrefix() const;
QString tagShortcutPrefix() const;
......@@ -106,7 +106,7 @@ private Q_SLOTS:
private:
bool createTagActionShortcut(int tagId);
bool removeTagActionShortcut(int tagId);
bool removeTagActionShortcut(int tagId, bool delAction = true);
bool createRatingActionShortcut(KActionCollection* const ac, int rating);
bool createPickLabelActionShortcut(KActionCollection* const ac, int pickId);
......
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