Print meaningful warning when there is no QGuiApplication
ClosedPublic

Authored by broulik on Apr 21 2020, 7:15 AM.

Details

Summary

KWindowSystem plug-in loading (and everything regarding a window system, like X or Wayland connection anyway) depends on QGuiApplication::platformName() which will be empty when there is none, such as in a QCoreApplication.
This would then just print a meaningless error on how now platform plug-in was found.

Test Plan
  • Created a QCoreApplication, called KWindowSystem::windows(), got a warning that I need a QGuiApplication and an empty window list
  • Created a QGuiApplication, called KWindowSystem::windows(), got no warning and a lost of X window ids
  • Created a QApplication, called KWindowSystem::windows(), got no warning and a lost of X window ids

Diff Detail

Repository
R278 KWindowSystem
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Apr 21 2020, 7:15 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 21 2020, 7:15 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Apr 21 2020, 7:15 AM
zzag accepted this revision.Apr 21 2020, 8:08 AM
This revision is now accepted and ready to land.Apr 21 2020, 8:08 AM
This revision was automatically updated to reflect the committed changes.