diff --git a/src/core/application_p.cpp b/src/core/application_p.cpp index 8bda222..88b5a6c 100644 --- a/src/core/application_p.cpp +++ b/src/core/application_p.cpp @@ -21,8 +21,6 @@ using namespace Snore; -int ApplicationData::applicationMetaID = qRegisterMetaType(); - ApplicationData::ApplicationData(const QString &name, const Icon &icon): m_name(name), m_icon(icon) diff --git a/src/core/application_p.h b/src/core/application_p.h index 5cd28d7..e20576c 100644 --- a/src/core/application_p.h +++ b/src/core/application_p.h @@ -37,8 +37,6 @@ public: Icon m_icon; QHash m_alerts; Hint m_hint; - - static int applicationMetaID; }; } diff --git a/src/core/notification/notification.cpp b/src/core/notification/notification.cpp index 2a7cf9e..eef5e80 100644 --- a/src/core/notification/notification.cpp +++ b/src/core/notification/notification.cpp @@ -30,8 +30,6 @@ using namespace Snore; int Notification::m_defaultTimeout = 10; -int NotificationData::notificationMetaID = qRegisterMetaType(); - Notification::Notification () : d(NULL) diff --git a/src/core/notification/notification_p.h b/src/core/notification/notification_p.h index 9710a28..0269599 100644 --- a/src/core/notification/notification_p.h +++ b/src/core/notification/notification_p.h @@ -82,7 +82,6 @@ private: static uint notificationCount; static uint m_idCount; - static int notificationMetaID; }; diff --git a/src/core/snore.cpp b/src/core/snore.cpp index 8e18e91..ffbbb14 100644 --- a/src/core/snore.cpp +++ b/src/core/snore.cpp @@ -38,9 +38,10 @@ using namespace Snore; -SnoreCore::SnoreCore(QSystemTrayIcon *trayIcon ): - d_ptr(new SnoreCorePrivate(trayIcon )) +SnoreCore::SnoreCore(QSystemTrayIcon *trayIcon ) { + SnoreCorePrivate::registerMetaTypes(); + d_ptr = new SnoreCorePrivate(trayIcon ); Q_D(SnoreCore); d->q_ptr = this; } diff --git a/src/core/snore_p.cpp b/src/core/snore_p.cpp index 0136b5b..68a7780 100644 --- a/src/core/snore_p.cpp +++ b/src/core/snore_p.cpp @@ -64,6 +64,12 @@ bool SnoreCorePrivate::setBackendIfAvailible(const QString &backend) return false; } +void SnoreCorePrivate::registerMetaTypes() +{ + qRegisterMetaType(); + qRegisterMetaType(); +} + bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const { return m_notificationBackend->canUpdateNotification(); diff --git a/src/core/snore_p.h b/src/core/snore_p.h index a91b64f..2a78483 100644 --- a/src/core/snore_p.h +++ b/src/core/snore_p.h @@ -40,6 +40,8 @@ public: { return QCryptographicHash::hash(data,QCryptographicHash::Md5).toHex(); } + + static void registerMetaTypes(); public: SnoreCorePrivate(QSystemTrayIcon *trayIcon); ~SnoreCorePrivate(); @@ -51,6 +53,8 @@ public: bool setBackendIfAvailible(const QString & backend); + + /** * * @return whether the backend can update a notification