[src/] port more code away from kdelibs4support and other deprecated classes
ClosedPublic

Authored by ahmadsamir on Oct 19 2019, 9:06 PM.

Details

Summary

Drop setOpaqueResize() call in konqframecontainer, let the style use
its defaults.

Remove some spurious #include's

Don't setFont() on widgets, let the widget/style handle it

Diff Detail

Repository
R226 Konqueror
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir requested review of this revision.Oct 19 2019, 9:06 PM
ahmadsamir created this revision.
ognarb added a subscriber: ognarb.Oct 19 2019, 9:44 PM

Some small comments ;) Otherwise the changes are looking good.

CMakeLists.txt
29

Why not use one find_package for all the kf5 components?

src/CMakeLists.txt
112

Why moving this KF5::KDELibs4Support outside the other target_link_libraries?

src/konqview.cpp
1227

This commented code could also be removed

ahmadsamir updated this revision to Diff 68321.Oct 20 2019, 4:47 AM
ahmadsamir marked an inline comment as done.

Less find_package calls

ahmadsamir marked 2 inline comments as done.Oct 20 2019, 4:48 AM
ahmadsamir added inline comments.
CMakeLists.txt
29

I'll merge the first two ones.

As for kdelibs4support, having it in a separate find_package makes it easier to comment out one line while building locally to find out what code still needs porting away from kdelibs4support.

src/konqview.cpp
1227

I think this whole method can go away, I'll do that in a separate diff.

dfaure requested changes to this revision.Oct 20 2019, 10:11 AM
dfaure added inline comments.
src/konqmainwindow.cpp
221

setComponentData is a non-deprecated method in KParts::PartBase (which the mainwindow inherits from). We need to call it, what happens in main() won't end up triggering the code in PartBase.

I think you just need to replace KComponentData::mainComponent() with KAboutData::applicationData()

430

Given the if(), we also get in the else if the file is local and exists, which seems wrong.

You probably want to split up the if() in order to have the exists() call in a nested if() statemend.

431

you should also do

job->setSide(KIO::StatJob::DestinationSide);

to preserve this logic from the old NetAccess call.

434

exec() returns bool, so you could just do

nameFilter = !job->exec() ? fileName : QString();
This revision now requires changes to proceed.Oct 20 2019, 10:11 AM
ahmadsamir updated this revision to Diff 68361.EditedOct 20 2019, 1:58 PM
ahmadsamir marked 2 inline comments as done.

Fix if() loop totally wrong logic

setComponentData() is not deprecated for KParts

When replacing KIO::NetAccess::exists() better use a stat job with KIO::StatJob::DestinationSide

Use job->exec() directly as it returns a bool

ahmadsamir updated this revision to Diff 68362.Oct 20 2019, 1:59 PM
ahmadsamir edited the summary of this revision. (Show Details)

Verbatim

dfaure accepted this revision.Oct 20 2019, 4:49 PM
This revision is now accepted and ready to land.Oct 20 2019, 4:49 PM
This revision was automatically updated to reflect the committed changes.