diff --git a/dataengines/notifications/notificationsengine.cpp b/dataengines/notifications/notificationsengine.cpp
--- a/dataengines/notifications/notificationsengine.cpp
+++ b/dataengines/notifications/notificationsengine.cpp
@@ -202,18 +202,19 @@
qDebug() << "Currrent active notifications:" << m_activeNotifications;
qDebug() << "Guessing partOf as:" << partOf;
qDebug() << " New Notification: " << summary << body << timeout << "& Part of:" << partOf;
- QString _body;
+ QString bodyFinal = NotificationSanitizer::parse(body);
if (partOf > 0) {
const QString source = QStringLiteral("notification %1").arg(partOf);
Plasma::DataContainer *container = containerForSource(source);
if (container) {
// append the body text
- _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) {
+ // FIXME: This will just append the entire old XML document to another one, leading to:
+ // old
new
+ // It works but is not very clean.
+ bodyFinal = previousBody + QStringLiteral("
") + bodyFinal;
}
replaces_id = partOf;
@@ -246,7 +247,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() - strlen("");
// -1 is "server default", 0 is persistent with "server default" display time,
// anything more should honor the setting
@@ -261,9 +262,6 @@
const QString source = QStringLiteral("notification %1").arg(id);
- QString bodyFinal = (partOf == 0 ? body : _body);
- bodyFinal = NotificationSanitizer::parse(bodyFinal);
-
Plasma::DataEngine::Data notificationData;
notificationData.insert(QStringLiteral("id"), QString::number(id));
notificationData.insert(QStringLiteral("eventId"), eventId);