Changeset View
Changeset View
Standalone View
Standalone View
krusader/actionsbase.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 88 | { | |||
---|---|---|---|---|---|
93 | _mainWindow->actions()->setDefaultShortcut(action, shortcut); | 93 | _mainWindow->actions()->setDefaultShortcut(action, shortcut); | ||
94 | 94 | | |||
95 | return action; | 95 | return action; | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | KToggleAction *ActionsBase::toggleAction(QString text, QString icon, const QKeySequence& shortcut, | 98 | KToggleAction *ActionsBase::toggleAction(QString text, QString icon, const QKeySequence& shortcut, | ||
99 | QObject *recv, const char *slot, QString name) | 99 | QObject *recv, const char *slot, QString name) | ||
100 | { | 100 | { | ||
101 | return (KToggleAction *)(action(std::move(text), std::move(icon), shortcut, recv, slot, std::move(name), true)); | 101 | return dynamic_cast<KToggleAction *>(action(std::move(text), std::move(icon), shortcut, recv, slot, std::move(name), true)); | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | KToggleAction *ActionsBase::toggleAction(QString text, QString icon, const QKeySequence& shortcut, | 104 | KToggleAction *ActionsBase::toggleAction(QString text, QString icon, const QKeySequence& shortcut, | ||
105 | ActionGroup &group, const char *slot, QString name) | 105 | ActionGroup &group, const char *slot, QString name) | ||
106 | { | 106 | { | ||
107 | return (KToggleAction *)(action(std::move(text), std::move(icon), shortcut, group, slot, std::move(name), true)); | 107 | return dynamic_cast<KToggleAction *>(action(std::move(text), std::move(icon), shortcut, group, slot, std::move(name), true)); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | QAction *ActionsBase::stdAction(KStandardAction::StandardAction id, QObject *recv, const char *slot) | 110 | QAction *ActionsBase::stdAction(KStandardAction::StandardAction id, QObject *recv, const char *slot) | ||
111 | { | 111 | { | ||
112 | return KStandardAction::create(id, recv, slot, _mainWindow->actions()); | 112 | return KStandardAction::create(id, recv, slot, _mainWindow->actions()); | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | QAction *ActionsBase::stdAction(KStandardAction::StandardAction id, ActionGroup &group, const char *slot) | 115 | QAction *ActionsBase::stdAction(KStandardAction::StandardAction id, ActionGroup &group, const char *slot) | ||
116 | { | 116 | { | ||
117 | QAction *action = KStandardAction::create(id, nullptr, nullptr, _mainWindow->actions()); | 117 | QAction *action = KStandardAction::create(id, nullptr, nullptr, _mainWindow->actions()); | ||
118 | group.addAction(action, slot); | 118 | group.addAction(action, slot); | ||
119 | return action; | 119 | return action; | ||
120 | } | 120 | } |