Replace some obsolete methods with non-obsolete ones
ClosedPublic

Authored by yurchor on Jul 18 2019, 11:14 AM.

Details

Summary
Test Plan
  1. Run Gwenview, select an image.
  2. Use Edit -> Crop to ensure that cropping is working as expected.
  3. Press F11 to go to the full screen mode. The top panel should appear as expected.

Diff Detail

Repository
R260 Gwenview
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14117
Build 14135: arc lint + arc unit
yurchor created this revision.Jul 18 2019, 11:14 AM
Restricted Application added a project: Gwenview. ยท View Herald TranscriptJul 18 2019, 11:14 AM
yurchor requested review of this revision.Jul 18 2019, 11:14 AM
tommo added a subscriber: tommo.Jul 18 2019, 4:48 PM

I vote against bumping Qt to 5.10 just because of a single obsolete method. Qt 5.9 is a LTS release, which is supported until May 2020. E.g. I'm using openSUSE Leap 15.1, which uses 5.9.7 . Also, QImage::sizeInBytes() is recommend for images bigger 2GiB, but I never had success to open images that big with Gwenview.

yurchor updated this revision to Diff 61992.Jul 18 2019, 5:28 PM

Revert Qt 5.9 -> 5.10 and byteCount() -> sizeInBytes() change.

the description needs to be changed now

yurchor edited the summary of this revision. (Show Details)Jul 18 2019, 7:27 PM
meven added a subscriber: meven.Jul 19 2019, 7:27 AM
meven added inline comments.
lib/crop/croptool.cpp
274โ€“275

Add const here

lib/imagescaler.cpp
134

Wrap d->mRegion in qAsConst(d->mRegion)
https://www.kdab.com/goodbye-q_foreach/

yurchor marked 2 inline comments as done.Jul 19 2019, 7:42 AM

Thanks.

yurchor updated this revision to Diff 62029.Jul 19 2019, 7:43 AM

Use constant iterators.

ngraham added inline comments.Jul 19 2019, 5:36 PM
lib/crop/cropwidget.cpp
203

Might be better to use QGuiApplication::screenAt() and get the screen where the window is open, rather than assuming it's open on the primary screen (also, the concept of the primary screen does not exist on Wayland; not sure what QGuiApplication::primaryScreen() will return there)

lib/fullscreenbar.cpp
85

ditto

Thanks in advance for your answer.

lib/crop/cropwidget.cpp
203

This will introduce the dependency on Qt 5.10:

https://doc.qt.io/qt-5/qguiapplication.html#screenAt

How should I proceed?

lib/fullscreenbar.cpp
85

Same here.

Darn. Don't port those, then, and instead just add a TODO that says what we should do when we're going to bump the dep to a newer Qt version.

yurchor updated this revision to Diff 62092.Jul 20 2019, 6:06 AM

Revert screenGeometry() changes to keep Qt 5.9 dependency, add appropriate comments.

yurchor marked 2 inline comments as done.Jul 20 2019, 6:08 AM

Thanks! Almost done...

lib/crop/cropwidget.cpp
32

Now we don't need this include anymore

lib/fullscreenbar.cpp
32

ditto

yurchor updated this revision to Diff 62119.Jul 20 2019, 2:08 PM

Remove QScreen includes.

ngraham accepted this revision.Jul 20 2019, 2:09 PM

Thanks, shipit! ๐Ÿ‘

This revision is now accepted and ready to land.Jul 20 2019, 2:09 PM
This revision was automatically updated to reflect the committed changes.