Extract ref name from QAction's iconText() instead of text()
commit6cb6bb04dcc9e8370e22c2eacd2b634488126c24
authorAlex Hermann <alex-github@wenlex.nl>
Fri, 22 Sep 2017 15:33:02 +0000 (22 17:33 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Sep 2017 15:33:02 +0000 (22 17:33 +0200)
tree5a31c251d4765cd43539dcfbeb717b4c7860b33e
parent6847d452c457713ce563c019c74cb7d049c9a70a
Extract ref name from QAction's iconText() instead of text()

When selecting a branch on the context menu, the action text is supposed to have the ref name in it. In some cases, Qt mangles the text and inserts an ampersand (shortcut marker) on the triggered action (shortcuts are not shown in the UI). I don't know why Qt does this, this seems undocumented behavior. Due to the mangling, the ref obviously can't be found. By using iconText() instead of text(), Qt returns the text with ampersands removed.

As Qt is mangling texts, maybe a better fix would be to set the ref name into the userdata somewhere, but this quick fix works for me. It'll probably break on refnames with ampersands, but they should be rare.
src/mainimpl.cpp