Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/listpanelactions.cpp
Show All 36 Lines | |||||
37 | #include <KXmlGui/KActionCollection> | 37 | #include <KXmlGui/KActionCollection> | ||
38 | 38 | | |||
39 | 39 | | |||
40 | ListPanelActions::ListPanelActions(QObject *parent, KrMainWindow *mainWindow) : | 40 | ListPanelActions::ListPanelActions(QObject *parent, KrMainWindow *mainWindow) : | ||
41 | ActionsBase(parent, mainWindow) | 41 | ActionsBase(parent, mainWindow) | ||
42 | { | 42 | { | ||
43 | // set view type | 43 | // set view type | ||
44 | auto *mapper = new QSignalMapper(this); | 44 | auto *mapper = new QSignalMapper(this); | ||
45 | connect(mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &ListPanelActions::setView); | 45 | connect(mapper, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped), | ||
46 | this, &ListPanelActions::setView); | ||||
46 | auto *group = new QActionGroup(this); | 47 | auto *group = new QActionGroup(this); | ||
47 | group->setExclusive(true); | 48 | group->setExclusive(true); | ||
48 | QList<KrViewInstance*> views = KrViewFactory::registeredViews(); | 49 | QList<KrViewInstance*> views = KrViewFactory::registeredViews(); | ||
49 | for(int i = 0; i < views.count(); i++) { | 50 | for(int i = 0; i < views.count(); i++) { | ||
50 | KrViewInstance *inst = views[i]; | 51 | KrViewInstance *inst = views[i]; | ||
51 | QAction *action = new QAction(Icon(inst->iconName()), inst->description(), group); | 52 | QAction *action = new QAction(Icon(inst->iconName()), inst->description(), group); | ||
52 | action->setCheckable(true); | 53 | action->setCheckable(true); | ||
53 | connect(action, &QAction::triggered, mapper, QOverload<>::of(&QSignalMapper::map)); | 54 | connect(action, &QAction::triggered, mapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map)); | ||
54 | mapper->setMapping(action, inst->id()); | 55 | mapper->setMapping(action, inst->id()); | ||
55 | _mainWindow->actions()->addAction("view" + QString::number(i), action); | 56 | _mainWindow->actions()->addAction("view" + QString::number(i), action); | ||
56 | _mainWindow->actions()->setDefaultShortcut(action, inst->shortcut()); | 57 | _mainWindow->actions()->setDefaultShortcut(action, inst->shortcut()); | ||
57 | setViewActions.insert(inst->id(), action); | 58 | setViewActions.insert(inst->id(), action); | ||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | // standard actions | 61 | // standard actions | ||
61 | actHistoryBackward = stdAction(KStandardAction::Back, _func, SLOT(historyBackward())); | 62 | actHistoryBackward = stdAction(KStandardAction::Back, _func, SLOT(historyBackward())); | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |