Fix crash if KWindowSystem::mapViewport is called without a QCoreApplication

Review Request #126887 - Created Jan. 26, 2016 and submitted

Martin Flöser
NETRootInfo can be used without requiring a QCoreApplication. But there
are calls into KWindowSytem to check whether viewports are used. This
creates a static container and tries to move it to the main thread of
the QCoreApplication. If we don't have a QCoreApplication this crashes.

This change ensures that it's possible to call into mapViewport even
if there is no QCoreApplication. It will return false as also no plugin
will be loadable.

The change comes with a new auto test which simulates the condition
of calling into mapViewport without a QCoreApplication.

David Faure
Martin Flöser
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 9248b92eb24ea0fae4f372b7810c08a32bca8a28 by Martin Gräßlin to branch master.