Use a global printer object for all print jobs
ClosedPublic

Authored by tbaumgart on Mar 24 2019, 8:04 AM.

Details

Summary

BUG: 405059
FIXED-IN:5.0.4

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tbaumgart requested review of this revision.Mar 24 2019, 8:04 AM
tbaumgart created this revision.
habacker edited the summary of this revision. (Show Details)Mar 24 2019, 8:57 PM
habacker requested changes to this revision.Mar 24 2019, 9:05 PM

Just a note: Printing a report as diagram prints in fact a table report, which may confuses user expecting to print a real diagram.
As a fix I see to disable print button in case a diagram is shown. Another options is to add diagram printing support in as separate commit. See https://cgit.kde.org/kmymoney.git/commit/?h=4.8-staging&id=2ac6eb5433f81111ae7206e84a2cfda50ddcfe7f for an example for the 4.8 branch.

kmymoney/plugins/checkprinting/checkprinting.cpp
37–38

this (and 4 similiar ) includes are now obsolete and should be removed

This revision now requires changes to proceed.Mar 24 2019, 9:05 PM
habacker added a comment.EditedMar 24 2019, 9:16 PM

Another options is to add diagram printing support.

On implementing you may consider to design diagram printing with print preview in mind to avoid an additional required refactoring to get print preview support afterwards. Print preview support requires to perform the preview generating and real printing by a slot getting a pointer to a QPrinter instance e.g. slotPaintRequested(QPrinter *printer) , see https://doc.qt.io/Qt-5/qprintpreviewdialog.html#details for details.

tbaumgart updated this revision to Diff 54783.Mar 25 2019, 4:44 PM
  • Removed unused #include statements
tbaumgart marked an inline comment as done.Mar 25 2019, 4:47 PM

Just a note: Printing a report as diagram prints in fact a table report, which may confuses user expecting to print a real diagram.

This is a different task on my list, the same applies to print preview.

habacker accepted this revision.Mar 25 2019, 5:50 PM

looks good otherwise

kmymoney/kmymoneyutils.cpp
42 ↗(On Diff #54783)

unrelated, looks to be added for another task.

627 ↗(On Diff #54783)

This is also unrelated, please remove

kmymoney/plugins/checkprinting/checkprinting.json.cmake
11 ↗(On Diff #54783)

patch contains unrelated additions, also some more locations below

This revision is now accepted and ready to land.Mar 25 2019, 5:50 PM
kmymoney/kmymoneyutils.cpp
627 ↗(On Diff #54783)

arc played tricks on me 'again'. I hate it for that. Will use plain git to add to repo.

This revision was automatically updated to reflect the committed changes.
habacker added a comment.EditedMar 26 2019, 7:01 AM

The -#include <QPrintDialog> is still missing in git and needs an additional fixup commit.

arc played tricks on me 'again'. I hate it for that. Will use plain git to add to repo.

It probably will be better with the gitlab migration. See "Gitlab Evaluation & Migration" thread in kde-devel@kde.org.