Changeset View
Changeset View
Standalone View
Standalone View
src/knotificationmanager.cpp
Show All 34 Lines | |||||
35 | #endif | 35 | #endif | ||
36 | 36 | | |||
37 | #include "knotifyconfig.h" | 37 | #include "knotifyconfig.h" | ||
38 | #include "knotificationplugin.h" | 38 | #include "knotificationplugin.h" | ||
39 | 39 | | |||
40 | #include "notifybylogfile.h" | 40 | #include "notifybylogfile.h" | ||
41 | #include "notifybytaskbar.h" | 41 | #include "notifybytaskbar.h" | ||
42 | #include "notifybyexecute.h" | 42 | #include "notifybyexecute.h" | ||
43 | #ifndef Q_OS_ANDROID | 43 | | ||
44 | #ifdef Q_OS_ANDROID | ||||
45 | #include "notifybyandroid.h" | ||||
46 | #else | ||||
47 | #ifndef Q_OS_WIN | ||||
44 | #include "notifybypopup.h" | 48 | #include "notifybypopup.h" | ||
45 | #include "notifybyportal.h" | 49 | #include "notifybyportal.h" | ||
46 | #else | | |||
47 | #include "notifybyandroid.h" | | |||
48 | #endif | 50 | #endif | ||
51 | #endif | ||||
52 | | ||||
49 | #include "debug_p.h" | 53 | #include "debug_p.h" | ||
50 | 54 | | |||
51 | #if defined(HAVE_CANBERRA) | 55 | #if defined(HAVE_CANBERRA) | ||
52 | #include "notifybyaudio_canberra.h" | 56 | #include "notifybyaudio_canberra.h" | ||
53 | #elif defined(HAVE_PHONON4QT5) | 57 | #elif defined(HAVE_PHONON4QT5) | ||
54 | #include "notifybyaudio_phonon.h" | 58 | #include "notifybyaudio_phonon.h" | ||
55 | #endif | 59 | #endif | ||
56 | 60 | | |||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 128 | auto addPlugin = [this](KNotificationPlugin *plugin) { | |||
128 | connect(plugin, &KNotificationPlugin::actionInvoked, | 132 | connect(plugin, &KNotificationPlugin::actionInvoked, | ||
129 | this, &KNotificationManager::notificationActivated); | 133 | this, &KNotificationManager::notificationActivated); | ||
130 | }; | 134 | }; | ||
131 | 135 | | |||
132 | // Load plugin. | 136 | // Load plugin. | ||
133 | // We have a series of built-ins up first, and fall back to trying | 137 | // We have a series of built-ins up first, and fall back to trying | ||
134 | // to instantiate an externally supplied plugin. | 138 | // to instantiate an externally supplied plugin. | ||
135 | if (action == QLatin1String("Popup")) { | 139 | if (action == QLatin1String("Popup")) { | ||
136 | #ifndef Q_OS_ANDROID | 140 | #ifdef Q_OS_ANDROID | ||
141 | plugin = new NotifyByAndroid(this); | ||||
142 | #else | ||||
143 | #ifndef Q_OS_WIN | ||||
137 | if (d->portalDBusServiceExists) { | 144 | if (d->portalDBusServiceExists) { | ||
138 | plugin = new NotifyByPortal(this); | 145 | plugin = new NotifyByPortal(this); | ||
139 | } else { | 146 | } else { | ||
140 | plugin = new NotifyByPopup(this); | 147 | plugin = new NotifyByPopup(this); | ||
141 | } | 148 | } | ||
142 | #else | | |||
143 | plugin = new NotifyByAndroid(this); | | |||
144 | #endif | 149 | #endif | ||
145 | 150 | #endif | |||
146 | addPlugin(plugin); | 151 | addPlugin(plugin); | ||
147 | } else if (action == QLatin1String("Taskbar")) { | 152 | } else if (action == QLatin1String("Taskbar")) { | ||
148 | plugin = new NotifyByTaskbar(this); | 153 | plugin = new NotifyByTaskbar(this); | ||
149 | addPlugin(plugin); | 154 | addPlugin(plugin); | ||
150 | } else if (action == QLatin1String("Sound")) { | 155 | } else if (action == QLatin1String("Sound")) { | ||
151 | #if defined(HAVE_PHONON4QT5) || defined(HAVE_CANBERRA) | 156 | #if defined(HAVE_PHONON4QT5) || defined(HAVE_CANBERRA) | ||
152 | plugin = new NotifyByAudio(this); | 157 | plugin = new NotifyByAudio(this); | ||
153 | addPlugin(plugin); | 158 | addPlugin(plugin); | ||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |