Double assignment for the same variable in Shortcut constructor

• Jun 9, 2014 - 23:41
Type
Functional
Severity
S4 - Minor
Status
closed
Project

I've noticed that in this code the cont paramter is ignored, because imediatly after the assignemt
_context = cont;
_context get thes default value for a Shortcut, Qt::WindowShortcut.
Since nobody has complained about this before I've created this bug report to ask if I should remove the second assignment, or it is by design.


Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
const char* txt, int i)
{
_key = name;
_text = txt;
_descr = _text;
_help = _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = cont;
_context = Qt::WindowShortcut;
_icon = i;
_action = 0;
}


Comments