diff --git a/dataengines/notifications/notificationsengine.cpp b/dataengines/notifications/notificationsengine.cpp --- a/dataengines/notifications/notificationsengine.cpp +++ b/dataengines/notifications/notificationsengine.cpp @@ -217,22 +217,18 @@ qDebug() << "Currrent active notifications:" << m_activeNotifications; qDebug() << "Guessing partOf as:" << partOf; qDebug() << " New Notification: " << summary << body << timeout << "& Part of:" << partOf; - QString bodyFinal = body; + QString bodyFinal = NotificationSanitizer::parse(body); QString summaryFinal = summary; if (partOf > 0) { const QString source = QStringLiteral("notification %1").arg(partOf); Plasma::DataContainer *container = containerForSource(source); if (container) { // append the body text - QString _body = container->data()[QStringLiteral("body")].toString(); - if (_body != body) { - _body.append("\n").append(body); - } else { - _body = body; + const QString previousBody = container->data()[QStringLiteral("body")].toString(); + if (previousBody != bodyFinal) { + bodyFinal = previousBody + QStringLiteral("
") + bodyFinal; } - bodyFinal = _body; - replaces_id = partOf; // remove the old notification and replace it with the new one @@ -267,7 +263,7 @@ const int AVERAGE_WORD_LENGTH = 6; const int WORD_PER_MINUTE = 250; - int count = summary.length() + body.length(); + int count = summary.length() + body.length() - (sizeof("") - 1); // -1 is "server default", 0 is persistent with "server default" display time, // anything more should honor the setting @@ -282,8 +278,6 @@ const QString source = QStringLiteral("notification %1").arg(id); - bodyFinal = NotificationSanitizer::parse(bodyFinal); - Plasma::DataEngine::Data notificationData; notificationData.insert(QStringLiteral("id"), QString::number(id)); notificationData.insert(QStringLiteral("eventId"), eventId);