Port kprinter4 to Qt 5/KDE 5
AbandonedPublic

Authored by michaelweghorn on Dec 15 2017, 6:48 AM.

Details

Reviewers
None
Group Reviewers
KDE Applications
Summary

This ports kprinter4 to use KDE 5/Qt 5, in particular
the Qt 5 print dialog.
Functionality is basically unchanged (except for
differences in the underlying Qt 4 vs. Qt 5 print dialog).

The migration is actually a series of git commits, and is
also available in the branch "michaelweghorn/qt5Port",
currently in a fork of the repository in Gitlab:
https://gitlab.com/michaelweghorn/kprinter4/tree/michaelweghorn/qt5Port

In addition, a .arcconfig is added to have a proper setup for using the
"arc" command line tool to interact with Phabricator.

Test Plan
  • Open a PostScript file with kprinter4.
  • Verify that the Qt 5 print dialog is being used.
  • Check that functionality is basically the same as before the port to Qt 5/KDE 5.

Diff Detail

Repository
R757 KPrinter for KDE 4
Branch
update_phabricator
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelweghorn requested review of this revision.Dec 15 2017, 6:48 AM
michaelweghorn created this revision.
anthonyfieroni added a subscriber: anthonyfieroni.
anthonyfieroni added inline comments.
CMakeLists.txt
57–58

Let's call it kprinter5.

main.cpp
33

Use capital letters include KLocalizedString

Rename to "kprinter5", update includes

  • Change the application name to "kprinter5"
  • Update includes: "klocalizedstring.h" -> "KLocalizedString"
  • Update POT file and German translation after renaming the application
michaelweghorn marked 2 inline comments as done.Dec 15 2017, 8:58 AM

The 2 suggested improvements are now implemented.

Is this still relevant?

Is this still relevant?

Good question...
Since distributions are dropping Qt 4, porting to qt5/kf5 seems the only way to keep kprinter alive. On the other hand, it seems to have been inactive for quite a while already and I'm not sure how big the need for kprinter actually still is.
There's e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874973 where this qt5 port was added for the Debian package in form of patches ~1 year ago, but there doesn't seem to be much interest and it never made it into the official Debian package.
If not considered relevant any more, an alternative might be to abandon kprinter after all? Probably Okular can be used as a replacement for those that want to print PostScript files using the Qt print dialog, in particular with the --print-and-exit option it gained in the meanwhile (though it doesn't yet have all options for scaling or poster printing that kprinter has).

Long time ago the choice was to drop the printing function from the code managed by KDE and use whatever was provided by Qt. If I remember correctly (@aacid probably remembers the story more than me) the original promise of having more care from the Qt side didn't exactly work as expected, so we had a lot of regression for a long time (until few people started pushing the feature again to Qt). At this point, kprinter is probably redundant and the missing features should be probably pushed to Qt. Or at least the features already provided by Qt should be removed from here.

aacid added a comment.Jun 19 2019, 6:38 PM

kprinter maybe/probably/potentially does things that the qt print dialog doesn't, but yes, it'd be much better if those were upstreamed rather than having another tool you have to learn how to use besides the print dialog of apps

michaelweghorn abandoned this revision.Jul 19 2019, 8:19 PM
In D9341#482119, @aacid wrote:

kprinter maybe/probably/potentially does things that the qt print dialog doesn't, but yes, it'd be much better if those were upstreamed rather than having another tool you have to learn how to use besides the print dialog of apps

kprinter actually uses the Qt print dialog and just adds some specific tabs. I agree that functionality should best be upstreamed to Qt, though implementing it in a general and platform-independent way is certainly much more work than using existing command-line tools to handle PostScript, which, IIRC is what kprinter mostly does.

Anyway, abandoning this patch now; there doesn't seem to be much interest in kprinter any longer and I personally don't care much.