Only link to Qt5WebChannel if Qt5WebEngineWidgets available
ClosedPublic

Authored by fvogt on Feb 12 2020, 2:18 PM.

Details

Summary

QWebChannel is only used if WebEngine is also available.

This converts scripting support into an optional feature which is only enabled if both dependencies are available.

Test Plan

Still builds.

Diff Detail

Repository
R111 KSysguard Library
Branch
Plasma/5.18
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22401
Build 22419: arc lint + arc unit
fvogt created this revision.Feb 12 2020, 2:18 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 12 2020, 2:18 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
fvogt requested review of this revision.Feb 12 2020, 2:18 PM
davidedmundson accepted this revision.Feb 12 2020, 9:59 PM
This revision is now accepted and ready to land.Feb 12 2020, 9:59 PM
fvogt planned changes to this revision.Feb 27 2020, 4:20 PM
fvogt edited the summary of this revision. (Show Details)

I need some input on how to express HAVE_QTWEBENGINEWIDGETS with this. Currently it would fail to build if Qt5WebEngineWidgets is installed but Qt5WebChannel isn't.

fvogt added a comment.Mar 2 2020, 8:52 AM

Currently processui/scripting.cpp has this:

#if HAVE_QTWEBENGINEWIDGETS
#include <QWebChannel>
...
#endif

So Qt5WebEngineWidgets without Qt5WebChannel will fail to build and Qt5WebChannel without Qt5WebEngineWidgets leads to scripting support getting disabled.
My question is what the right way to handle this is. List both as optional dependencies and use #if HAVE_QTWEBENGINEWIDGETS && HAVE_QTWEBCHANNEL instead or raise a cmake error out in the former case?

fvogt updated this revision to Diff 76750.Mar 2 2020, 9:08 AM

Treat scripting as a feature instead

This revision is now accepted and ready to land.Mar 2 2020, 9:08 AM
fvogt edited the summary of this revision. (Show Details)Mar 2 2020, 9:09 AM
lbeltrame added inline comments.
CMakeLists.txt
86

Should you add a message in case one of the two is not found?

fvogt marked an inline comment as done.Mar 2 2020, 9:19 AM
fvogt added inline comments.
CMakeLists.txt
86

In that case WEBENGINE_SCRIPTING_ENABLED is FALSE and it'll print that Scripting plugin support is not enabled.

At least in theory.

This revision was automatically updated to reflect the committed changes.
fvogt marked an inline comment as done.