Add detectPlatform to always use wayland in a wayland session

Authored by fvogt on Jul 19 2019, 3:12 PM.

Description

Add detectPlatform to always use wayland in a wayland session

Summary:
It's possible that Qt uses the xcb platform by default even in a Wayland
session, so detect such cases and switch to wayland instead to enable
proper support for remote input. Copy code from libkworkspace to not
introduce a dependency.

Test Plan: Started kdeconnectd, uses wayland platform now. Remote input works.

Reviewers: KDE Connect, nicolasfella

Reviewed By: KDE Connect, nicolasfella

Subscribers: kdeconnect

Tags: KDE Connect

Differential Revision: https://phabricator.kde.org/D22562