Changeset View
Changeset View
Standalone View
Standalone View
krusader/actionsbase.cpp
Show All 15 Lines | |||||
16 | * * | 16 | * * | ||
17 | * You should have received a copy of the GNU General Public License * | 17 | * You should have received a copy of the GNU General Public License * | ||
18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | 18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | ||
19 | *****************************************************************************/ | 19 | *****************************************************************************/ | ||
20 | 20 | | |||
21 | #include "actionsbase.h" | 21 | #include "actionsbase.h" | ||
22 | 22 | | |||
23 | #include "krmainwindow.h" | 23 | #include "krmainwindow.h" | ||
24 | #include "icon.h" | ||||
24 | 25 | | |||
25 | // QtWidgets | 26 | // QtWidgets | ||
26 | #include <QAction> | 27 | #include <QAction> | ||
27 | 28 | | |||
28 | #include <KXmlGui/KActionCollection> | 29 | #include <KXmlGui/KActionCollection> | ||
29 | #include <KWidgetsAddons/KToggleAction> | 30 | #include <KWidgetsAddons/KToggleAction> | ||
30 | 31 | | |||
31 | void ActionsBase::ActionGroup::reconnect(QObject *recv) | 32 | void ActionsBase::ActionGroup::reconnect(QObject *recv) | ||
Show All 11 Lines | |||||
43 | 44 | | |||
44 | 45 | | |||
45 | QAction *ActionsBase::createAction(QString text, QString icon, bool isToggleAction) | 46 | QAction *ActionsBase::createAction(QString text, QString icon, bool isToggleAction) | ||
46 | { | 47 | { | ||
47 | if(isToggleAction) { | 48 | if(isToggleAction) { | ||
48 | if (icon == 0) | 49 | if (icon == 0) | ||
49 | return (QAction *)(new KToggleAction(text, this)); | 50 | return (QAction *)(new KToggleAction(text, this)); | ||
50 | else | 51 | else | ||
51 | return (QAction *)(new KToggleAction(QIcon::fromTheme(icon), text, this)); | 52 | return (QAction *)(new KToggleAction(Icon(icon), text, this)); | ||
52 | } else { | 53 | } else { | ||
53 | if (icon == 0) | 54 | if (icon == 0) | ||
54 | return new QAction(text, this); | 55 | return new QAction(text, this); | ||
55 | else | 56 | else | ||
56 | return new QAction(QIcon::fromTheme(icon), text, this); | 57 | return new QAction(Icon(icon), text, this); | ||
57 | } | 58 | } | ||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | QAction *ActionsBase::action(QString text, QString icon, QKeySequence shortcut, | 61 | QAction *ActionsBase::action(QString text, QString icon, QKeySequence shortcut, | ||
61 | QObject *recv, const char *slot, QString name, bool isToggleAction) | 62 | QObject *recv, const char *slot, QString name, bool isToggleAction) | ||
62 | { | 63 | { | ||
63 | QAction *a = createAction(text, icon, isToggleAction); | 64 | QAction *a = createAction(text, icon, isToggleAction); | ||
64 | 65 | | |||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |