Changeset View
Changeset View
Standalone View
Standalone View
src/server/datadevice_interface.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | |||||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | void DataDeviceInterface::Private::setSelection(DataSourceInterface *dataSource) | 127 | void DataDeviceInterface::Private::setSelection(DataSourceInterface *dataSource) | ||
128 | { | 128 | { | ||
129 | if (dataSource && dataSource->supportedDragAndDropActions() && wl_resource_get_version(dataSource->resource()) >= WL_DATA_SOURCE_ACTION_SINCE_VERSION) { | 129 | if (dataSource && dataSource->supportedDragAndDropActions() && wl_resource_get_version(dataSource->resource()) >= WL_DATA_SOURCE_ACTION_SINCE_VERSION) { | ||
130 | wl_resource_post_error(dataSource->resource(), WL_DATA_SOURCE_ERROR_INVALID_SOURCE, "Data source is for drag and drop"); | 130 | wl_resource_post_error(dataSource->resource(), WL_DATA_SOURCE_ERROR_INVALID_SOURCE, "Data source is for drag and drop"); | ||
131 | return; | 131 | return; | ||
132 | } | 132 | } | ||
133 | if (selection == dataSource) { | ||||
134 | return; | ||||
135 | } | ||||
133 | Q_Q(DataDeviceInterface); | 136 | Q_Q(DataDeviceInterface); | ||
134 | QObject::disconnect(selectionUnboundConnection); | 137 | QObject::disconnect(selectionUnboundConnection); | ||
135 | QObject::disconnect(selectionDestroyedConnection); | 138 | QObject::disconnect(selectionDestroyedConnection); | ||
136 | if (selection) { | 139 | if (selection) { | ||
137 | selection->cancel(); | 140 | selection->cancel(); | ||
138 | } | 141 | } | ||
139 | selection = dataSource; | 142 | selection = dataSource; | ||
140 | if (selection) { | 143 | if (selection) { | ||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |