[aseprite] 88/128: Fix removing original accelerators that are before a new accelerator (fix #1104)

Tobias Hansen thansen at moszumanska.debian.org
Mon May 9 21:24:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 00c7cb7e54d043b7c2e2dfd6ad79cf5d88cb34ea
Author: David Capello <davidcapello at gmail.com>
Date:   Mon May 2 13:03:04 2016 -0300

    Fix removing original accelerators that are before a new accelerator (fix #1104)
---
 src/app/commands/cmd_keyboard_shortcuts.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp
index 4c12943..d859dd6 100644
--- a/src/app/commands/cmd_keyboard_shortcuts.cpp
+++ b/src/app/commands/cmd_keyboard_shortcuts.cpp
@@ -86,14 +86,19 @@ private:
     this->window()->layout();
   }
 
-  void onDeleteAccel(int index)
-  {
-    if (Alert::show("Warning"
-        "<<Do you really want to delete this keyboard shortcut?"
-        "||&Yes||&No") != 1)
+  void onDeleteAccel(int index) {
+    // We need to create a copy of the accelerator because
+    // Key::disableAccel() will modify the accels() collection itself.
+    ui::Accelerator accel = m_key->accels()[index];
+
+    if (Alert::show(
+          "Warning"
+          "<<Do you really want to delete '%s' keyboard shortcut?"
+          "||&Yes||&No",
+          accel.toString().c_str()) != 1)
       return;
 
-    m_key->disableAccel(m_key->accels()[index]);
+    m_key->disableAccel(accel);
     window()->layout();
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list