Strip richtext on Windows, simplify how rich teyt is stripped in KPassivePopup
ClosedPublic

Authored by vonreth on Jan 18 2020, 11:53 PM.

Diff Detail

Repository
R289 KNotifications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vonreth created this revision.Jan 18 2020, 11:53 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 18 2020, 11:53 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
vonreth requested review of this revision.Jan 18 2020, 11:53 PM
vonreth updated this revision to Diff 73850.Jan 19 2020, 12:18 AM

Switch to QTextDocumentFragment

We have the same problem on Linux (if the server doesn't support rich text) and probably Android too. In notifybypopup we do this with QXmlStreamReader + some API from KCodecs, but your solution is much simpler and nicer.

Ideally this should be done in KNotification instead of the backends. Therefore we'd need some API in KNotificationPlugin/KNotification to indicate whether rich text is supported. The KNotificationManager code is quite convoluted currently, but it should be doable.

This would help our quest of making KNotifications Tier 1 ;-)

vonreth updated this revision to Diff 73875.Jan 19 2020, 1:45 PM
  • Drop dependency to KF5Codecs by using the new stripRichText function
vonreth retitled this revision from Strip richtext on Windows, as Windows does not support it to Strip richtext on Windows, simplify how rich teyt is stripped in KPassivePopup .Jan 19 2020, 1:52 PM
vonreth edited the summary of this revision. (Show Details)
nicolasfella accepted this revision.Jan 19 2020, 3:16 PM

you can push the two commits directly

src/knotificationplugin.h
104

remove one empty line

src/notifybysnore.cpp
62

unrelated

This revision is now accepted and ready to land.Jan 19 2020, 3:16 PM
vonreth updated this revision to Diff 73884.Jan 19 2020, 3:52 PM
vonreth retitled this revision from Strip richtext on Windows, simplify how rich teyt is stripped in KPassivePopup to Strip richtext on Windows, simplify how rich teyt is stripped in KPassivePopup.

Whitespace

vonreth updated this revision to Diff 73885.Jan 19 2020, 3:53 PM

whitespace

nicolasfella accepted this revision.Jan 19 2020, 3:56 PM
This revision was automatically updated to reflect the committed changes.