Skip to content

Commit 58168e0

Browse files
committed
GUI: removed shitloads of code duplication from CPUDisassembly (start of a series of refactors)
1 parent 63ed769 commit 58168e0

File tree

3 files changed

+162
-407
lines changed

3 files changed

+162
-407
lines changed

src/gui/Src/BasicView/AbstractTableView.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,22 @@ public slots:
221221
inline QAction* connectAction(QAction* action, const char* slot)
222222
{
223223
connect(action, SIGNAL(triggered(bool)), this, slot);
224-
addAction(action);
225224
return action;
226225
}
227226

228227
inline QAction* connectShortcutAction(QAction* action, const char* shortcut)
229228
{
230229
actionShortcutPairs.push_back(ActionShortcut(action, shortcut));
231230
action->setShortcut(ConfigShortcut(shortcut));
231+
action->setShortcutContext(Qt::WidgetShortcut);
232+
addAction(action);
232233
return action;
233234
}
234235

235236
inline QAction* connectMenuAction(QMenu* menu, QAction* action)
236237
{
237-
return connectMenuAction(menu, action);
238+
menu->addAction(action);
239+
return action;
238240
}
239241

240242
protected:
@@ -268,12 +270,12 @@ public slots:
268270
return connectMenuAction(menu, makeAction(icon, text, slot));
269271
}
270272

271-
inline QAction* makeMenuShortcutAction(QMenu* menu, const QString & text, const char* slot, const char* shortcut)
273+
inline QAction* makeShortcutMenuAction(QMenu* menu, const QString & text, const char* slot, const char* shortcut)
272274
{
273275
return connectShortcutAction(makeMenuAction(menu, text, slot), shortcut);
274276
}
275277

276-
inline QAction* makeMenuShortcutAction(QMenu* menu, const QIcon & icon, const QString & text, const char* slot, const char* shortcut)
278+
inline QAction* makeShortcutMenuAction(QMenu* menu, const QIcon & icon, const QString & text, const char* slot, const char* shortcut)
277279
{
278280
return connectShortcutAction(makeMenuAction(menu, icon, text, slot), shortcut);
279281
}

0 commit comments

Comments
 (0)