From kde-panel-devel Fri Jan 30 11:37:56 2015 From: "Martin Klapetek" Date: Fri, 30 Jan 2015 11:37:56 +0000 To: kde-panel-devel Subject: Re: Review Request 122314: Sanitize whitespace in notification popups Message-Id: <20150130113756.13679.46499 () probe ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=142261789128960 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============8763195128855797570==" --===============8763195128855797570== Content-Type: multipart/alternative; boundary="===============2893368735669282773==" --===============2893368735669282773== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/122314/ ----------------------------------------------------------- (Updated Jan. 30, 2015, 12:37 p.m.) Review request for Plasma. Changes ------- Fix the regexp; I went with my extended version as in the best case that one will not do a single replace (case when there are only single
s) Bugs: 343532 https://bugs.kde.org/show_bug.cgi?id=343532 Repository: plasma-workspace Description ------- While looking into https://bugs.kde.org/show_bug.cgi?id=343532 I noticed that wall sends message always starting with \n, but with our limited space, that makes no sense. With this patch the text is first trimmed from whitespace at the beginning and end, then all \ns are converted to
(as before), then the text replaces all remaining inner whitespace with single space and finally, if there are two new lines in succession, it turns it into just one. The bug itself, which is about messages from wall not appearing in the popup, will only partially get solved by this as the popup is limited in max height, so it displays at most 3 lines of text and with wall first two lines are already taken, that leaves just one line for the actual message. However these are persistant so they get saved in the notification history anyway. Diffs (updated) ----- dataengines/notifications/notificationsengine.cpp 6e566b4 Diff: https://git.reviewboard.kde.org/r/122314/diff/ Testing ------- Now I'm able to see the message sent with wall. Thanks, Martin Klapetek --===============2893368735669282773== MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/122314/

Review request for Plasma.
By Martin Klapetek.

Updated Jan. 30, 2015, 12:37 p.m.

Changes

Fix the regexp; I went with my extended version as in the best case that one will not do a single replace (case when there are only single <br/>s)
Bugs: 343532
Repository: plasma-workspace

Description

While looking into https://bugs.kde.org/show_bug.cgi?id=343532 I noticed that wall sends message always starting with \n, but with our limited space, that makes no sense.

With this patch the text is first trimmed from whitespace at the beginning and end, then all \ns are converted to <br/> (as before), then the text replaces all remaining inner whitespace with single space and finally, if there are two new lines in succession, it turns it into just one.

The bug itself, which is about messages from wall not appearing in the popup, will only partially get solved by this as the popup is limited in max height, so it displays at most 3 lines of text and with wall first two lines are already taken, that leaves just one line for the actual message.

However these are persistant so they get saved in the notification history anyway.

Testing

Now I'm able to see the message sent with wall.

Diffs (updated)

  • dataengines/notifications/notificationsengine.cpp (6e566b4)

View Diff

--===============2893368735669282773==-- --===============8763195128855797570== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============8763195128855797570==--