Changeset View
Changeset View
Standalone View
Standalone View
libinput/events.cpp
Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Line(s) | 219 | { | |||
---|---|---|---|---|---|
220 | Q_ASSERT(type() == LIBINPUT_EVENT_TOUCH_DOWN || type() == LIBINPUT_EVENT_TOUCH_MOTION); | 220 | Q_ASSERT(type() == LIBINPUT_EVENT_TOUCH_DOWN || type() == LIBINPUT_EVENT_TOUCH_MOTION); | ||
221 | return QPointF(libinput_event_touch_get_x_transformed(m_touchEvent, size.width()), | 221 | return QPointF(libinput_event_touch_get_x_transformed(m_touchEvent, size.width()), | ||
222 | libinput_event_touch_get_y_transformed(m_touchEvent, size.height())); | 222 | libinput_event_touch_get_y_transformed(m_touchEvent, size.height())); | ||
223 | } | 223 | } | ||
224 | 224 | | |||
225 | qint32 TouchEvent::id() const | 225 | qint32 TouchEvent::id() const | ||
226 | { | 226 | { | ||
227 | Q_ASSERT(type() != LIBINPUT_EVENT_TOUCH_CANCEL && type() != LIBINPUT_EVENT_TOUCH_FRAME); | 227 | Q_ASSERT(type() != LIBINPUT_EVENT_TOUCH_CANCEL && type() != LIBINPUT_EVENT_TOUCH_FRAME); | ||
228 | return libinput_event_touch_get_slot(m_touchEvent); | 228 | | ||
229 | const qint32 slot = libinput_event_touch_get_slot(m_touchEvent); | ||||
graesslin: I suggest to const this. | |||||
230 | | ||||
231 | return slot == -1 ? 0 : slot; | ||||
229 | } | 232 | } | ||
230 | 233 | | |||
231 | GestureEvent::GestureEvent(libinput_event *event, libinput_event_type type) | 234 | GestureEvent::GestureEvent(libinput_event *event, libinput_event_type type) | ||
232 | : Event(event, type) | 235 | : Event(event, type) | ||
233 | , m_gestureEvent(libinput_event_get_gesture_event(event)) | 236 | , m_gestureEvent(libinput_event_get_gesture_event(event)) | ||
234 | { | 237 | { | ||
235 | } | 238 | } | ||
236 | 239 | | |||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
I suggest to const this.