Use virtual functions for OSD

This commit is contained in:
Jonas Kvinge
2020-08-09 01:37:00 +02:00
parent 184e9a5c93
commit ab7d383cf1
18 changed files with 281 additions and 198 deletions

View File

@@ -102,7 +102,13 @@
#endif
#include "settings/behavioursettingspage.h"
#include "widgets/osd.h"
#ifdef HAVE_DBUS
# include "osd/osddbus.h"
#elif defined(Q_OS_MACOS)
# include "osd/osdmac.h"
#else
# include "osd/osdbase.h"
#endif
#ifdef HAVE_DBUS
QDBusArgument &operator<<(QDBusArgument &arg, const QImage &image);
@@ -264,7 +270,13 @@ int main(int argc, char* argv[]) {
// Create the tray icon and OSD
std::unique_ptr<SystemTrayIcon> tray_icon(SystemTrayIcon::CreateSystemTrayIcon());
OSD osd(tray_icon.get(), &app);
#ifdef HAVE_DBUS
OSDDBus osd(tray_icon.get(), &app);
#elif defined(Q_OS_MACOS)
OSDMac osd(tray_icon.get(), &app);
#else
OSDBase osd(tray_icon.get(), &app);
#endif
#ifdef HAVE_DBUS
mpris::Mpris mpris(&app);