Changeset View
Changeset View
Standalone View
Standalone View
kded/daemon.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
86 | 86 | | |||
87 | void KScreenDaemon::init() | 87 | void KScreenDaemon::init() | ||
88 | { | 88 | { | ||
89 | KActionCollection *coll = new KActionCollection(this); | 89 | KActionCollection *coll = new KActionCollection(this); | ||
90 | QAction* action = coll->addAction(QStringLiteral("display")); | 90 | QAction* action = coll->addAction(QStringLiteral("display")); | ||
91 | action->setText(i18n("Switch Display" )); | 91 | action->setText(i18n("Switch Display" )); | ||
92 | QList<QKeySequence> switchDisplayShortcuts({Qt::Key_Display, Qt::MetaModifier + Qt::Key_P}); | 92 | QList<QKeySequence> switchDisplayShortcuts({Qt::Key_Display, Qt::MetaModifier + Qt::Key_P}); | ||
93 | KGlobalAccel::self()->setGlobalShortcut(action, switchDisplayShortcuts); | 93 | KGlobalAccel::self()->setGlobalShortcut(action, switchDisplayShortcuts); | ||
94 | connect(action, &QAction::triggered, [&](bool) { displayButton(); }); | 94 | connect(action, &QAction::triggered, this, [&](bool) { displayButton(); }); | ||
broulik: You could also connect it to the method directly
```
connect(action, &QAction::triggered, this… | |||||
gladhorn: Of course, that was pretty blind of me. | |||||
95 | 95 | | |||
96 | new KScreenAdaptor(this); | 96 | new KScreenAdaptor(this); | ||
97 | // Initialize OSD manager to register its dbus interface | 97 | // Initialize OSD manager to register its dbus interface | ||
98 | KScreen::OsdManager::self(); | 98 | KScreen::OsdManager::self(); | ||
99 | 99 | | |||
100 | m_saveTimer->setInterval(300); | 100 | m_saveTimer->setInterval(300); | ||
101 | m_saveTimer->setSingleShot(true); | 101 | m_saveTimer->setSingleShot(true); | ||
102 | connect(m_saveTimer, &QTimer::timeout, this, &KScreenDaemon::saveCurrentConfig); | 102 | connect(m_saveTimer, &QTimer::timeout, this, &KScreenDaemon::saveCurrentConfig); | ||
▲ Show 20 Lines • Show All 349 Lines • Show Last 20 Lines |
You could also connect it to the method directly