[server] Ensure we have a DataSource on the DataDevice in setSelection

Authored by graesslin on Oct 24 2016, 8:04 AM.

Description

[server] Ensure we have a DataSource on the DataDevice in setSelection

Summary:
SeatInterface provides a way to set the current selection. This method
did not verify whether the new DataDeviceInterface actually has a
DataSourceInterface. If there is no DataSourceInterface on that
DataDeviceInterface the selection should not be sent to the current
selection owner. This results in a crash as DataOfferInterface
(correctly) doesn't expect the passed in DataSourceInterface to be null.

To ensure we don't hit this again the DataOfferInterface ctor gained an
Q_ASSERT to validate the DataSourceInterface.

Reviewers: Plasma on Wayland

Subscribers: plasma-devel

Tags: Plasma on Wayland

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