Merge lp:~mzanetti/reminders-app/fix-stale-qt-tags into lp:reminders-app
Status: | Merged |
---|---|
Approved by: | Riccardo Padovani |
Approved revision: | 409 |
Merged at revision: | 411 |
Proposed branch: | lp:~mzanetti/reminders-app/fix-stale-qt-tags |
Merge into: | lp:reminders-app |
Diff against target: |
77 lines (+28/-8) 1 file modified
src/libqtevernote/utils/enmldocument.cpp (+28/-8) |
To merge this branch: | bzr merge lp:~mzanetti/reminders-app/fix-stale-qt-tags |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Riccardo Padovani | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+255894@code.launchpad.net |
Commit message
fix data loss because of stale "-qt" tags in the markup
Description of the change
I caught a data loss bug that happened with a note of mine. Afaiu, this can happen if you create a note with reminders and just add some empty lines (paragraphs). The QTextEdit will set a style attribute to it like:
<p style="
If this is sent to Evernote and the user edits this paragraph on the website, it will add content to the paragraph but still keep that attribute, not knowing about it but still trying to play nice on other clients and keep their special attributes.
When this comes back to reminders, QTextEdit will get confused about the paragraph being marked as an empty one but still having text, effectively, not displaying half of the content in this paragraph. Saving such a note will permanently drop parts of the paragraph and sync the result back to Evernote.
As a fix, I now completely clean up all the "-qt-*" tags generated by the QTextArea when converting the content back to ENML. That might make rendering next time a wee little slower, as the QTextEdit seems to regenerate those tags, but gives me a much better feeling than having stale attributes floating around - and fixes the content loss with my test note here.
PASSED: Continuous integration, rev:408 91.189. 93.70:8080/ job/reminders- app-ci/ 738/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2558 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2558/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/reminders- app-utopic- amd64-ci/ 340 91.189. 93.70:8080/ job/reminders- app-vivid- amd64-ci/ 160
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 738/rebuild
http://