Save and load latex entries render results into cws
ClosedPublic

Authored by sirgienko on Jun 15 2018, 9:20 PM.

Details

Summary

Now we add eps files of latex entries to saved worksheet (cws file) and load this prepared images, it they exists, when load worksheet.

Diff Detail

Repository
R55 Cantor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sirgienko created this revision.Jun 15 2018, 9:20 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJun 15 2018, 9:20 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.Jun 15 2018, 9:20 PM
sirgienko updated this revision to Diff 36213.Jun 15 2018, 9:24 PM

Add const

asemke added inline comments.Jun 16 2018, 10:01 AM
src/latexentry.cpp
120

can be declared const QString& dir.

122
const QString& imagePath = dir + QDir::separator() + imageFile->name();

This should be faster than your variant.

160

will this logic always work? What happens if the temporary file was deleted in between? I think it would be more safer to save the rendered image in LatexEntry::evaluate() to a private member of LatexEntry and to use it in LatexEntry::toXml() (save it first to a temporary file and add it to archive).

sirgienko updated this revision to Diff 36225.Jun 16 2018, 12:42 PM

Add logic for situation, when tempory file don't exist

sirgienko marked 2 inline comments as done.Jun 16 2018, 12:44 PM
sirgienko added inline comments.
src/latexentry.cpp
160

Add code for rerendering eps file, if the file don't exists

asemke accepted this revision.Jun 16 2018, 4:18 PM
This revision is now accepted and ready to land.Jun 16 2018, 4:18 PM
This revision was automatically updated to reflect the committed changes.