Skip to content

Commit b96c440

Browse files
committed
fix: dbus_message protocol error for notification
std::numeric_limits<unit>::max() cause dbus_message protocol error.
1 parent c7a5b09 commit b96c440

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

panels/notification/server/dbusadaptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ uint DDENotificationDbusAdaptor::Notify(const QString &appName, uint replacesId,
7272
int expireTimeout)
7373
{
7474
uint id = manager()->Notify(appName, replacesId, appIcon, summary, body, actions, hints, expireTimeout);
75-
if (id == std::numeric_limits<uint>::max()) {
75+
if (id == 0) {
7676
QDBusError error(QDBusError::InternalError, "Notify failed.");
7777
QDBusMessage reply = QDBusMessage::createError(error);
7878

79-
return QDBusConnection::sessionBus().send(reply);
79+
QDBusConnection::sessionBus().send(reply);
8080
}
8181

8282
return id;

panels/notification/server/notificationmanager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ uint NotificationManager::Notify(const QString &appName, uint replacesId, const
240240
if (entity.processedType() != NotifyEntity::None) {
241241
qint64 id = m_persistence->addEntity(entity);
242242
if (id == -1) {
243-
return std::numeric_limits<uint>::max();
243+
qWarning(notifyLog) << "Failed on saving DB, bubbleId:" << entity.bubbleId() << ", appName" << appName;
244+
return 0;
244245
}
245246

246247
entity.setId(id);

0 commit comments

Comments
 (0)