Skip to content

Commit

Permalink
fix #26106
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jun 10, 2014
1 parent ea51a17 commit f167972
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 49 deletions.
37 changes: 0 additions & 37 deletions mscore/shortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ extern QString dataPath;
// Shortcut
//---------------------------------------------------------

Shortcut::Shortcut()
{
_key = 0;
_descr = 0;
_text = 0;
_help = 0;
_state = 0;
_flags = 0;
_standardKey = QKeySequence::UnknownKey;
_context = Qt::WindowShortcut;
_icon = -1;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
const char* txt, const char* d, const char* h, int i)
{
Expand All @@ -50,10 +36,8 @@ Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
_help = h ? h : _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = cont;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name,
Expand All @@ -65,10 +49,7 @@ Shortcut::Shortcut(int s, int f, const char* name,
_help = h ? h : _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = Qt::WindowShortcut;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name, const char* txt,
Expand All @@ -80,10 +61,7 @@ Shortcut::Shortcut(int s, int f, const char* name, const char* txt,
_help = _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = Qt::WindowShortcut;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
Expand All @@ -95,10 +73,8 @@ Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
_help = _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = cont;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name, const char* txt, int i)
Expand All @@ -109,10 +85,7 @@ Shortcut::Shortcut(int s, int f, const char* name, const char* txt, int i)
_help = _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = Qt::WindowShortcut;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
Expand All @@ -124,11 +97,8 @@ Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont,
_help = _descr;
_state = s;
_flags = f;
_standardKey = QKeySequence::UnknownKey;
_context = cont;
_context = Qt::WindowShortcut;
_icon = i;
_action = 0;
}

Shortcut::Shortcut(const Shortcut& sc)
Expand All @@ -143,15 +113,8 @@ Shortcut::Shortcut(const Shortcut& sc)
_keys = sc._keys;
_context = sc._context;
_icon = sc._icon;
_action = 0;
}

//Shortcut::~Shortcut()
// {
// delete _action;
// _action->deleteLater();
// }

//---------------------------------------------------------
// clear
//---------------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions mscore/shortcut.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ static const int KEYSEQ_SIZE = 4;
//---------------------------------------------------------

class Shortcut {
const char* _key; //! xml tag name for configuration file
const char* _descr; //! descriptor, shown in editor
const char* _text; //! text as shown on buttons or menus
const char* _help; //! ballon help
int _state; //! shortcut is valid in this Mscore state
//! (or'd list of states)
int _flags;
const char* _key { 0 }; //! xml tag name for configuration file
const char* _descr { 0 }; //! descriptor, shown in editor
const char* _text { 0 }; //! text as shown on buttons or menus
const char* _help { 0 }; //! ballon help
int _state { 0 }; //! shortcut is valid in this Mscore state
//! (or'd list of states)
int _flags { 0 };

QList<QKeySequence> _keys; //! shortcut list
QKeySequence::StandardKey _standardKey;
Qt::ShortcutContext _context;
int _icon;
mutable QAction* _action; //! cached action
QKeySequence::StandardKey _standardKey { QKeySequence::UnknownKey };
Qt::ShortcutContext _context { Qt::WindowShortcut };
int _icon { -1 };
mutable QAction* _action { 0 }; //! cached action

static Shortcut sc[];
static QMap<QString, Shortcut*> _shortcuts;

public:
Shortcut();
Shortcut() {}
Shortcut(int state, int flags,
const char* name,
Qt::ShortcutContext cont,
Expand Down

0 comments on commit f167972

Please sign in to comment.