diff --git a/src/libsnore/notification/icon.cpp b/src/libsnore/notification/icon.cpp index c2f6bd0..f1d506e 100644 --- a/src/libsnore/notification/icon.cpp +++ b/src/libsnore/notification/icon.cpp @@ -41,11 +41,6 @@ Icon Icon::defaultIcon() return icon; } -Icon::Icon() : - d(NULL) -{ -} - Icon::Icon(const QImage &img): d(new IconData(img)) { @@ -89,7 +84,7 @@ bool Icon::isLocalFile() const bool Icon::isValid() const { - return d && !(d->m_img.isNull() && d->m_url.isEmpty()); + return !(d->m_img.isNull() && d->m_url.isEmpty()); } Icon Icon::scaled(const QSize &s) const diff --git a/src/libsnore/notification/icon.h b/src/libsnore/notification/icon.h index ebc59d9..507ae48 100644 --- a/src/libsnore/notification/icon.h +++ b/src/libsnore/notification/icon.h @@ -47,7 +47,6 @@ public: static Icon defaultIcon(); - Icon(); /** * Creates an Icon from an QImage @@ -114,6 +113,7 @@ public: Icon scaled(const QSize &s) const; private: + Icon() = delete; QExplicitlySharedDataPointer d; friend SNORE_EXPORT QDebug(::operator<<)(QDebug, const Snore::Icon &); }; diff --git a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp index d0a8d89..9b5506d 100644 --- a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp +++ b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp @@ -83,7 +83,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, const QString &app_icon, const QString &summary, const QString &body, const QStringList &actions, const QVariantMap &hints, int timeout) { - Icon icon; + Icon icon = Icon::defaultIcon(); Application app; Notification::Prioritys priotity = Notification::NORMAL; @@ -91,8 +91,6 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id, FreedesktopImageHint image; hints.value(QLatin1String("image_data")).value() >> image; icon = Icon(image.toQImage()); - } else { - icon = Icon::defaultIcon(); } if (!SnoreCore::instance().aplications().contains(app_name)) { diff --git a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.h b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.h index bb592ed..6b59f85 100644 --- a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.h +++ b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.h @@ -50,7 +50,6 @@ public Q_SLOTS: private: Snore::Alert m_alert; - Snore::Icon m_icon; NotificationsAdaptor *m_adaptor; };