Port KWordQuiz away from deprecated API and kdelibs4support
ClosedPublic

Authored by yurchor on Oct 13 2018, 5:56 PM.

Details

Summary

Porting by examples. Files for KFilterProxySearchLine replacement are shamelessly borrowed from KDevelop. Code to recover files is borrowed from Umbrello.

Test Plan
  1. Start KWordQuiz and open an example (e.g. /usr/share/kwordquiz/examples/us_states_and_capitals.kvtml or src/examples/us_states_and_capitals.kvtml in the source tree).
  2. Try to print it into the cards PDF file (KWordQuiz tab under "Options" should work).
  3. Try to link image (Vocabulary -> Link Image) or sound (Vocabulary -> Link Sound) with a cell.
  4. Try to filter the list with entering "co" in the filter proxy list at the top of the window.
  5. Try if everything works (saves and restores) in the "Settings -> Configure KWordQuiz" window (1st and 2nd tabs).

Diff Detail

Repository
R338 KWordQuiz
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
yurchor created this revision.Oct 13 2018, 5:56 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptOct 13 2018, 5:56 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
yurchor requested review of this revision.Oct 13 2018, 5:56 PM

It appears that it is pretty normal that print preview shows nothing on a system with no default printer with QPrintPreviewDialog. So the porting is done correctly here.

aacid added a subscriber: aacid.Oct 15 2018, 9:29 PM
aacid added inline comments.
src/kwordquiz.h
252

Confused about this one, that's in kitemviews and thus needs no porting, no?

https://api.kde.org/frameworks/kitemviews/html/classKFilterProxySearchLine.html

yurchor marked an inline comment as done.Oct 16 2018, 4:52 AM
yurchor added inline comments.
src/kwordquiz.h
252

From the referred page:

Deprecated:
since 5.50, use QLineEdit directly. If filtering is expensive, consider a short timer to not act on every keypress, and if results are large, consider not reacting until 3 letters.

yurchor retitled this revision from Port KWordQuiz away from kdelibs4support to Port KWordQuiz away from deprecated API and kdelibs4support.Oct 16 2018, 2:35 PM
yurchor updated this revision to Diff 43807.Oct 17 2018, 5:45 PM
yurchor marked an inline comment as done.

Fix print preview.

yurchor edited the summary of this revision. (Show Details)Oct 17 2018, 5:46 PM
yurchor updated this revision to Diff 43808.Oct 17 2018, 5:53 PM

Add missing files. Sorry.

aacid added a comment.EditedOct 17 2018, 10:24 PM

Code looks reasonable, i *have not* tried it.

So maybe wait for someone to actually give it a second review or if you're totally confident you're not breaking stuff just commit it

Code looks reasonable, i *have not* tried it.

So maybe wait for someone to actually give it a second review or if you're totally confident you're not breaking stuff just commit it

Sure. I will wait for two weeks from now then commit the changes if no one objects.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 1 2018, 3:57 PM
This revision was automatically updated to reflect the committed changes.