diff --git a/panels/notification/server/dbusadaptor.cpp b/panels/notification/server/dbusadaptor.cpp index defed6f61..785fed734 100644 --- a/panels/notification/server/dbusadaptor.cpp +++ b/panels/notification/server/dbusadaptor.cpp @@ -28,11 +28,11 @@ uint DbusAdaptor::Notify(const QString &appName, uint replacesId, const QString int expireTimeout) { uint id = manager()->Notify(appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout); - if (id == std::numeric_limits::max()) { + if (id == 0) { QDBusError error(QDBusError::InternalError, "Notify failed."); QDBusMessage reply = QDBusMessage::createError(error); - return QDBusConnection::sessionBus().send(reply); + QDBusConnection::sessionBus().send(reply); } return id; @@ -72,11 +72,11 @@ uint DDENotificationDbusAdaptor::Notify(const QString &appName, uint replacesId, int expireTimeout) { uint id = manager()->Notify(appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout); - if (id == std::numeric_limits::max()) { + if (id == 0) { QDBusError error(QDBusError::InternalError, "Notify failed."); QDBusMessage reply = QDBusMessage::createError(error); - return QDBusConnection::sessionBus().send(reply); + QDBusConnection::sessionBus().send(reply); } return id; diff --git a/panels/notification/server/notificationmanager.cpp b/panels/notification/server/notificationmanager.cpp index aba7d07b5..bb7839233 100644 --- a/panels/notification/server/notificationmanager.cpp +++ b/panels/notification/server/notificationmanager.cpp @@ -240,7 +240,8 @@ uint NotificationManager::Notify(const QString &appName, uint replacesId, const if (entity.processedType() != NotifyEntity::None) { qint64 id = m_persistence->addEntity(entity); if (id == -1) { - return std::numeric_limits::max(); + qWarning(notifyLog) << "Failed on saving DB, bubbleId:" << entity.bubbleId() << ", appName" << appName; + return 0; } entity.setId(id);