qxcbclipboard.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/qxcbclipboard.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12class QXcbClipboardMime : public QXcbMime-
13{-
14 public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }-
15#pragma GCC diagnostic push-
16 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
17#pragma GCC diagnostic pop-
18 struct QPrivateSignal {};-
19public:-
20 QXcbClipboardMime(QClipboard::Mode mode, QXcbClipboard *clipboard)-
21 : QXcbMime()-
22 , m_clipboard(clipboard)-
23 {-
24 switch (mode) {-
25 case
never executed: case QClipboard::Selection:
QClipboard::Selection:
never executed: case QClipboard::Selection:
0
26 modeAtom = XCB_ATOM_PRIMARY;-
27 break;
never executed: break;
0
28-
29 case
executed 5 times by 5 tests: case QClipboard::Clipboard:
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
QClipboard::Clipboard:
executed 5 times by 5 tests: case QClipboard::Clipboard:
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
5
30 modeAtom = m_clipboard->atom(QXcbAtom::CLIPBOARD);-
31 break;
executed 5 times by 5 tests: break;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
5
32-
33 default
never executed: default:
:
never executed: default:
0
34 QMessageLogger(__FILE__, 77, __PRETTY_FUNCTION__).warning("QXcbClipboardMime: Internal error: Unsupported clipboard mode");-
35 break;
never executed: break;
0
36 }-
37 }-
38-
39 void reset()-
40 {-
41 formatList.clear();-
42 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QClipboard
1
43-
44 bool isEmpty() const-
45 {-
46 return
executed 60 times by 5 tests: return m_clipboard->getSelectionOwner(modeAtom) == 0L;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
m_clipboard->getSelectionOwner(modeAtom) == 0L;
executed 60 times by 5 tests: return m_clipboard->getSelectionOwner(modeAtom) == 0L;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
60
47 }-
48-
49protected:-
50 QStringList formats_sys() const override-
51 {-
52 if (isEmpty()
isEmpty()Description
TRUEevaluated 49 times by 2 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
2-49
53 return
executed 49 times by 2 tests: return QStringList();
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
QStringList();
executed 49 times by 2 tests: return QStringList();
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
49
54-
55 if (!formatList.count()
!formatList.count()Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEnever evaluated
) {
0-2
56 QXcbClipboardMime *that = const_cast<QXcbClipboardMime *>(this);-
57-
58-
59-
60 that->format_atoms = m_clipboard->getDataInFormat(modeAtom, m_clipboard->atom(QXcbAtom::TARGETS));-
61-
62 if (format_atoms.size() > 0
format_atoms.size() > 0Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEnever evaluated
) {
0-2
63 const xcb_atom_t *targets = (const xcb_atom_t *) format_atoms.data();-
64 int size = format_atoms.size() / sizeof(xcb_atom_t);-
65-
66 for (int i = 0; i < size
i < sizeDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
; ++i) {
2-14
67 if (targets[i] == 0
targets[i] == 0Description
TRUEnever evaluated
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
0-14
68 continue;
never executed: continue;
0
69-
70 QString format = mimeAtomToString(m_clipboard->connection(), targets[i]);-
71 if (!formatList.contains(format)
!formatList.contains(format)Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
6-8
72 that->formatList.append(format);
executed 8 times by 2 tests: that->formatList.append(format);
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
8
73 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
14
74 }
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
2
75 }
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
2
76-
77 return
executed 2 times by 2 tests: return formatList;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
formatList;
executed 2 times by 2 tests: return formatList;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
2
78 }-
79-
80 bool hasFormat_sys(const QString &format) const override-
81 {-
82 QStringList list = formats();-
83 return
executed 49 times by 2 tests: return list.contains(format);
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
list.contains(format);
executed 49 times by 2 tests: return list.contains(format);
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
49
84 }-
85-
86 QVariant retrieveData_sys(const QString &fmt, QVariant::Type requestedType) const override-
87 {-
88 if (fmt.isEmpty()
fmt.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 5 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QStyleSheetStyle
|| isEmpty()
isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QClipboard
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
0-5
89 return
executed 3 times by 1 test: return QByteArray();
Executed by:
  • tst_QClipboard
QByteArray();
executed 3 times by 1 test: return QByteArray();
Executed by:
  • tst_QClipboard
3
90-
91 (void)formats();-
92-
93 QVector<xcb_atom_t> atoms;-
94 const xcb_atom_t *targets = (const xcb_atom_t *) format_atoms.data();-
95 int size = format_atoms.size() / sizeof(xcb_atom_t);-
96 atoms.reserve(size);-
97 for (int i = 0; i < size
i < sizeDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
; ++i)
2-14
98 atoms.append(targets[i]);
executed 14 times by 2 tests: atoms.append(targets[i]);
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
14
99-
100 QByteArray encoding;-
101 xcb_atom_t fmtatom = mimeAtomForFormat(m_clipboard->connection(), fmt, requestedType, atoms, &encoding);-
102-
103 if (fmtatom == 0
fmtatom == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
0-2
104 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
105-
106 return
executed 2 times by 2 tests: return mimeConvertToFormat(m_clipboard->connection(), fmtatom, m_clipboard->getDataInFormat(modeAtom, fmtatom), fmt, requestedType, encoding);
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
mimeConvertToFormat(m_clipboard->connection(), fmtatom, m_clipboard->getDataInFormat(modeAtom, fmtatom), fmt, requestedType, encoding);
executed 2 times by 2 tests: return mimeConvertToFormat(m_clipboard->connection(), fmtatom, m_clipboard->getDataInFormat(modeAtom, fmtatom), fmt, requestedType, encoding);
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
2
107 }-
108private:-
109-
110 xcb_atom_t modeAtom;-
111 QXcbClipboard *m_clipboard;-
112 QStringList formatList;-
113 QByteArray format_atoms;-
114};-
115-
116class INCRTransaction;-
117typedef QMap<xcb_window_t,INCRTransaction*> TransactionMap;-
118static TransactionMap *transactions = 0;-
119-
120-
121-
122class INCRTransaction : public QObject-
123{-
124 public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }-
125#pragma GCC diagnostic push-
126 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
127#pragma GCC diagnostic pop-
128 struct QPrivateSignal {};-
129public:-
130 INCRTransaction(QXcbConnection *c, xcb_window_t w, xcb_atom_t p,-
131 QByteArray d, uint i, xcb_atom_t t, int f, int to) :-
132 conn(c), win(w), property(p), data(d), increment(i),-
133 target(t), format(f), timeout(to), offset(0)-
134 {-
135 const quint32 values[] = { XCB_EVENT_MASK_PROPERTY_CHANGE };-
136 xcb_change_window_attributes(conn->xcb_connection(), win,-
137 XCB_CW_EVENT_MASK, values);-
138 if (!transactions
!transactionsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
139-
140-
141-
142 transactions = new TransactionMap;-
143 conn->clipboard()->setProcessIncr(true);-
144 }
never executed: end of block
0
145 transactions->insert(win, this);-
146 abort_timer = startTimer(timeout);-
147 }
never executed: end of block
0
148-
149 ~INCRTransaction()-
150 {-
151 if (abort_timer
abort_timerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
152 killTimer(abort_timer);
never executed: killTimer(abort_timer);
0
153 abort_timer = 0;-
154 transactions->remove(win);-
155 if (transactions->isEmpty()
transactions->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
156-
157-
158-
159 delete transactions;-
160 transactions = 0;-
161 conn->clipboard()->setProcessIncr(false);-
162 }
never executed: end of block
0
163 }
never executed: end of block
0
164-
165 void updateIncrProperty(xcb_property_notify_event_t *event, bool &accepted)-
166 {-
167 xcb_connection_t *c = conn->xcb_connection();-
168 if (event->atom == property
event->atom == propertyDescription
TRUEnever evaluated
FALSEnever evaluated
&& event->state == XCB_PROPERTY_DELETE
event->state =...ROPERTY_DELETEDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
169 accepted = true;-
170-
171 if (abort_timer
abort_timerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
172 killTimer(abort_timer);
never executed: killTimer(abort_timer);
0
173 abort_timer = startTimer(timeout);-
174-
175 unsigned int bytes_left = data.size() - offset;-
176 if (bytes_left > 0
bytes_left > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
177 unsigned int bytes_to_send = qMin(increment, bytes_left);-
178-
179-
180-
181-
182 int dataSize = bytes_to_send / (format / 8);-
183 xcb_change_property(c, XCB_PROP_MODE_REPLACE, win, property,-
184 target, format, dataSize, data.constData() + offset);-
185 offset += bytes_to_send;-
186 }
never executed: end of block
else {
0
187-
188-
189-
190 xcb_change_property(c, XCB_PROP_MODE_REPLACE, win, property,-
191 target, format, 0, (const void *)0);-
192 const quint32 values[] = { XCB_EVENT_MASK_NO_EVENT };-
193 xcb_change_window_attributes(conn->xcb_connection(), win,-
194 XCB_CW_EVENT_MASK, values);-
195-
196 delete this;-
197 }
never executed: end of block
0
198 }-
199 }
never executed: end of block
0
200-
201protected:-
202 void timerEvent(QTimerEvent *ev) override-
203 {-
204 if (ev->timerId() == abort_timer
ev->timerId() == abort_timerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
205-
206-
207-
208-
209-
210 delete this;-
211 }
never executed: end of block
0
212 }
never executed: end of block
0
213-
214private:-
215 QXcbConnection *conn;-
216 xcb_window_t win;-
217 xcb_atom_t property;-
218 QByteArray data;-
219 uint increment;-
220 xcb_atom_t target;-
221 int format;-
222 int timeout;-
223 uint offset;-
224 int abort_timer;-
225};-
226-
227const int QXcbClipboard::clipboard_timeout = 5000;-
228-
229QXcbClipboard::QXcbClipboard(QXcbConnection *c)-
230 : QXcbObject(c), QPlatformClipboard()-
231 , m_requestor(0L)-
232 , m_owner(0L)-
233 , m_incr_active(false)-
234 , m_clipboard_closing(false)-
235 , m_incr_receive_time(0)-
236{-
237 ((!(QClipboard::Clipboard == 0)) ? qt_assert("QClipboard::Clipboard == 0",__FILE__,276) : qt_noop());-
238 ((!(QClipboard::Selection == 1)) ? qt_assert("QClipboard::Selection == 1",__FILE__,277) : qt_noop());-
239 m_clientClipboard[QClipboard::Clipboard] = 0;-
240 m_clientClipboard[QClipboard::Selection] = 0;-
241 m_timestamp[QClipboard::Clipboard] = 0L;-
242 m_timestamp[QClipboard::Selection] = 0L;-
243 m_owner = connection()->getQtSelectionOwner();-
244-
245-
246 QByteArray ba("Qt clipboard window");-
247 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_owner, atom(QXcbAtom::_NET_WM_NAME), atom(QXcbAtom::UTF8_STRING), 8, ba.length(), ba.constData())-
248-
249-
250-
251-
252-
253-
254 ;-
255-
256-
257 if (connection()->hasXFixes()
connection()->hasXFixes()Description
TRUEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
) {
0-135
258 const uint32_t mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER |-
259 XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY |-
260 XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE;-
261 xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, XCB_ATOM_PRIMARY, mask);-
262 xcb_xfixes_select_selection_input_checked(xcb_connection(), m_owner, atom(QXcbAtom::CLIPBOARD), mask);-
263 }
executed 135 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
135
264}
executed 135 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
135
265-
266QXcbClipboard::~QXcbClipboard()-
267{-
268 m_clipboard_closing = true;-
269-
270 if (m_timestamp[QClipboard::Clipboard] != 0L
m_timestamp[QC...ipboard] != 0LDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 342 times by 215 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolor - unknown status
  • ...
||
5-342
271 m_timestamp[QClipboard::Selection] != 0L
m_timestamp[QC...lection] != 0LDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qgraphicsproxywidget - unknown status
FALSEevaluated 341 times by 214 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolor - unknown status
  • ...
) {
1-341
272-
273-
274 xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));-
275 xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection(), cookie, 0);-
276 if (reply
replyDescription
TRUEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
&& reply->owner != 0L
reply->owner != 0LDescription
TRUEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
) {
0-6
277-
278 xcb_delete_property(xcb_connection(), m_owner, atom(QXcbAtom::_QT_SELECTION));-
279 xcb_convert_selection(xcb_connection(), m_owner, atom(QXcbAtom::CLIPBOARD_MANAGER), atom(QXcbAtom::SAVE_TARGETS),-
280 atom(QXcbAtom::_QT_SELECTION), connection()->time());-
281 connection()->sync();-
282-
283-
284 if (!waitForClipboardEvent(m_owner, 31, clipboard_timeout, true)
!waitForClipbo...timeout, true)Description
TRUEnever evaluated
FALSEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-6
285 QMessageLogger(__FILE__, 324, __PRETTY_FUNCTION__).warning("QXcbClipboard: Unable to receive an event from the "-
286 "clipboard manager in a reasonable time");-
287 }
never executed: end of block
0
288 }
executed 6 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
6
289 free(reply);-
290 }
executed 6 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
6
291-
292 if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]
m_clientClipbo...rd::Selection]Description
TRUEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 341 times by 214 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolor - unknown status
  • ...
)
6-341
293 delete m_clientClipboard[QClipboard::Clipboard];
executed 6 times by 6 tests: delete m_clientClipboard[QClipboard::Clipboard];
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
6
294 delete m_clientClipboard[QClipboard::Selection];-
295}
executed 347 times by 219 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qclipboard - unknown status
  • ...
347
296-
297void QXcbClipboard::incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted)-
298{-
299 uint response_type = ge->response_type & ~0x80;-
300 if (response_type == 28
response_type == 28Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
301 xcb_property_notify_event_t *event = (xcb_property_notify_event_t *)ge;-
302 TransactionMap::Iterator it = transactions->find(event->window);-
303 if (it != transactions->end()
it != transactions->end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
304 (*it)->updateIncrProperty(event, accepted);-
305 }
never executed: end of block
0
306 }
never executed: end of block
0
307}
never executed: end of block
0
308-
309xcb_window_t QXcbClipboard::getSelectionOwner(xcb_atom_t atom) const-
310{-
311 return
executed 217 times by 7 tests: return connection()->getSelectionOwner(atom);
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
connection()->getSelectionOwner(atom);
executed 217 times by 7 tests: return connection()->getSelectionOwner(atom);
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
217
312}-
313-
314xcb_atom_t QXcbClipboard::atomForMode(QClipboard::Mode mode) const-
315{-
316 if (mode == QClipboard::Clipboard
mode == QClipboard::ClipboardDescription
TRUEevaluated 140 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
FALSEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
16-140
317 return
executed 140 times by 6 tests: return atom(QXcbAtom::CLIPBOARD);
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
atom(QXcbAtom::CLIPBOARD);
executed 140 times by 6 tests: return atom(QXcbAtom::CLIPBOARD);
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
140
318 if (mode == QClipboard::Selection
mode == QClipboard::SelectionDescription
TRUEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEnever evaluated
)
0-16
319 return
executed 16 times by 4 tests: return XCB_ATOM_PRIMARY;
Executed by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
XCB_ATOM_PRIMARY;
executed 16 times by 4 tests: return XCB_ATOM_PRIMARY;
Executed by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
16
320 return
never executed: return 0L;
0L;
never executed: return 0L;
0
321}-
322-
323QClipboard::Mode QXcbClipboard::modeForAtom(xcb_atom_t a) const-
324{-
325 if (a == XCB_ATOM_PRIMARY
a == XCB_ATOM_PRIMARYDescription
TRUEevaluated 11 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 81 times by 9 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
11-81
326 return
executed 11 times by 4 tests: return QClipboard::Selection;
Executed by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
QClipboard::Selection;
executed 11 times by 4 tests: return QClipboard::Selection;
Executed by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QPlainTextEdit
  • tst_QTextEdit
11
327 if (a == atom(QXcbAtom::CLIPBOARD)
a == atom(QXcbAtom::CLIPBOARD)Description
TRUEevaluated 81 times by 9 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
)
0-81
328 return
executed 81 times by 9 tests: return QClipboard::Clipboard;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
QClipboard::Clipboard;
executed 81 times by 9 tests: return QClipboard::Clipboard;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
81
329-
330 return
never executed: return QClipboard::FindBuffer;
QClipboard::FindBuffer;
never executed: return QClipboard::FindBuffer;
0
331}-
332-
333-
334QMimeData * QXcbClipboard::mimeData(QClipboard::Mode mode)-
335{-
336 if (mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEnever evaluated
FALSEevaluated 89 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
)
0-89
337 return
never executed: return 0;
0;
never executed: return 0;
0
338-
339 xcb_window_t clipboardOwner = getSelectionOwner(atomForMode(mode));-
340 if (clipboardOwner == owner()
clipboardOwner == owner()Description
TRUEevaluated 65 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
) {
24-65
341 return
executed 65 times by 4 tests: return m_clientClipboard[mode];
Executed by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
m_clientClipboard[mode];
executed 65 times by 4 tests: return m_clientClipboard[mode];
Executed by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
65
342 } else {-
343 if (!m_xClipboard[mode]
!m_xClipboard[mode]Description
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
FALSEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
5-19
344 m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));
executed 5 times by 5 tests: m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
5
345-
346 return
executed 24 times by 5 tests: return m_xClipboard[mode].data();
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
m_xClipboard[mode].data();
executed 24 times by 5 tests: return m_xClipboard[mode].data();
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
24
347 }-
348}-
349-
350void QXcbClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)-
351{-
352 if (mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEnever evaluated
FALSEevaluated 72 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
0-72
353 return;
never executed: return;
0
354-
355 QXcbClipboardMime *xClipboard = 0;-
356-
357 if (!data
!dataDescription
TRUEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 53 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
19-53
358 xClipboard = qobject_cast<QXcbClipboardMime *>(mimeData(mode));-
359 if (xClipboard
xClipboardDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 15 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
4-15
360 if (xClipboard->isEmpty()
xClipboard->isEmpty()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEnever evaluated
)
0-4
361 return;
executed 4 times by 2 tests: return;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
4
362 }
never executed: end of block
0
363 }
executed 15 times by 3 tests: end of block
Executed by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
15
364-
365 if (!xClipboard
!xClipboardDescription
TRUEevaluated 68 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEnever evaluated
&& (
(m_clientClipb...mode] == data)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
FALSEevaluated 67 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
m_clientClipboard[mode] == data)
(m_clientClipb...mode] == data)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
FALSEevaluated 67 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
0-68
366 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QClipboard
1
367-
368 xcb_atom_t modeAtom = atomForMode(mode);-
369 xcb_window_t newOwner = 0L;-
370-
371 if (m_clientClipboard[mode]
m_clientClipboard[mode]Description
TRUEevaluated 43 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 24 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
24-43
372 if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]
m_clientClipbo...rd::Selection]Description
TRUEevaluated 40 times by 4 tests
Evaluated by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QClipboard
)
3-40
373 delete m_clientClipboard[mode];
executed 40 times by 4 tests: delete m_clientClipboard[mode];
Executed by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
40
374 m_clientClipboard[mode] = 0;-
375 m_timestamp[mode] = 0L;-
376 }
executed 43 times by 4 tests: end of block
Executed by:
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
43
377-
378 if (connection()->time() == 0L
connection()->time() == 0LDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 62 times by 5 tests
Evaluated by:
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
5-62
379 connection()->setTime(connection()->getTimestamp());
executed 5 times by 5 tests: connection()->setTime(connection()->getTimestamp());
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
5
380-
381 if (data
dataDescription
TRUEevaluated 52 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 15 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
15-52
382 newOwner = owner();-
383-
384 m_clientClipboard[mode] = data;-
385 m_timestamp[mode] = connection()->time();-
386 }
executed 52 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
52
387-
388 xcb_set_selection_owner(xcb_connection(), newOwner, modeAtom, connection()->time());-
389-
390 if (getSelectionOwner(modeAtom) != newOwner
getSelectionOw...m) != newOwnerDescription
TRUEnever evaluated
FALSEevaluated 67 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
0-67
391 QMessageLogger(__FILE__, 430, __PRETTY_FUNCTION__).warning("QXcbClipboard::setMimeData: Cannot set X11 selection owner");-
392 }
never executed: end of block
0
393-
394 emitChanged(mode);-
395}
executed 67 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
67
396-
397bool QXcbClipboard::supportsMode(QClipboard::Mode mode) const-
398{-
399 if (mode <= QClipboard::Selection
mode <= QClipboard::SelectionDescription
TRUEevaluated 169 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QClipboard
)
9-169
400 return
executed 169 times by 7 tests: return true;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
true;
executed 169 times by 7 tests: return true;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
169
401 return
executed 9 times by 1 test: return false;
Executed by:
  • tst_QClipboard
false;
executed 9 times by 1 test: return false;
Executed by:
  • tst_QClipboard
9
402}-
403-
404bool QXcbClipboard::ownsMode(QClipboard::Mode mode) const-
405{-
406 if (m_owner == 0L
m_owner == 0LDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QClipboard
|| mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QClipboard
)
0-3
407 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QClipboard
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QClipboard
1
408-
409 ((!(m_timestamp[mode] == 0L || getSelectionOwner(atomForMode(mode)) == m_owner)) ? qt_assert("m_timestamp[mode] == XCB_CURRENT_TIME || getSelectionOwner(atomForMode(mode)) == m_owner",__FILE__,448) : qt_noop());-
410-
411 return
executed 2 times by 1 test: return m_timestamp[mode] != 0L;
Executed by:
  • tst_QClipboard
m_timestamp[mode] != 0L;
executed 2 times by 1 test: return m_timestamp[mode] != 0L;
Executed by:
  • tst_QClipboard
2
412}-
413-
414QXcbScreen *QXcbClipboard::screen() const-
415{-
416 return
executed 24 times by 6 tests: return connection()->primaryScreen();
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
connection()->primaryScreen();
executed 24 times by 6 tests: return connection()->primaryScreen();
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
417}-
418-
419xcb_window_t QXcbClipboard::requestor() const-
420{-
421 QXcbScreen *platformScreen = screen();-
422-
423 if (!m_requestor
!m_requestorDescription
TRUEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 18 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
&& platformScreen
platformScreenDescription
TRUEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
) {
0-18
424 const int x = 0, y = 0, w = 3, h = 3;-
425 QXcbClipboard *that = const_cast<QXcbClipboard *>(this);-
426-
427 xcb_window_t window = xcb_generate_id(xcb_connection());-
428 xcb_create_window(xcb_connection(), 0L, window, platformScreen->screen()->root, x, y, w, h, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, platformScreen->screen()->root_visual, 0, 0)-
429 ;-
430-
431 QByteArray ba("Qt clipboard requestor window");-
432 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, window, atom(QXcbAtom::_NET_WM_NAME), atom(QXcbAtom::UTF8_STRING), 8, ba.length(), ba.constData())-
433-
434-
435-
436-
437-
438-
439 ;-
440-
441-
442 uint32_t mask = XCB_EVENT_MASK_PROPERTY_CHANGE;-
443 xcb_change_window_attributes(xcb_connection(), window, XCB_CW_EVENT_MASK, &mask);-
444-
445 that->setRequestor(window);-
446 }
executed 6 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
6
447 return
executed 24 times by 6 tests: return m_requestor;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
m_requestor;
executed 24 times by 6 tests: return m_requestor;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
448}-
449-
450void QXcbClipboard::setRequestor(xcb_window_t window)-
451{-
452 if (m_requestor != 0L
m_requestor != 0LDescription
TRUEnever evaluated
FALSEevaluated 6 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-6
453 xcb_destroy_window(xcb_connection(), m_requestor);-
454 }
never executed: end of block
0
455 m_requestor = window;-
456}
executed 6 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
6
457-
458xcb_window_t QXcbClipboard::owner() const-
459{-
460 return
executed 208 times by 7 tests: return m_owner;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
m_owner;
executed 208 times by 7 tests: return m_owner;
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QStyleSheetStyle
  • tst_QTextEdit
208
461}-
462-
463xcb_atom_t QXcbClipboard::sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property)-
464{-
465 QVector<xcb_atom_t> types;-
466 QStringList formats = QInternalMimeData::formatsHelper(d);-
467 for (int i = 0; i < formats.size()
i < formats.size()Description
TRUEevaluated 9 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
; ++i) {
5-9
468 QVector<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), formats.at(i));-
469 for (int j = 0; j < atoms.size()
j < atoms.size()Description
TRUEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 9 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
; ++j) {
9-24
470 if (!types.contains(atoms.at(j))
!types.contains(atoms.at(j))Description
TRUEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
)
0-24
471 types.append(atoms.at(j));
executed 24 times by 5 tests: types.append(atoms.at(j));
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
472 }
executed 24 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
473 }
executed 9 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
9
474 types.append(atom(QXcbAtom::TARGETS));-
475 types.append(atom(QXcbAtom::MULTIPLE));-
476 types.append(atom(QXcbAtom::TIMESTAMP));-
477 types.append(atom(QXcbAtom::SAVE_TARGETS));-
478-
479 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, window, property, XCB_ATOM_ATOM,-
480 32, types.size(), (const void *)types.constData());-
481 return
executed 5 times by 5 tests: return property;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
property;
executed 5 times by 5 tests: return property;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
482}-
483-
484xcb_atom_t QXcbClipboard::sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property)-
485{-
486 xcb_atom_t atomFormat = target;-
487 int dataFormat = 0;-
488 QByteArray data;-
489-
490 QString fmt = QXcbMime::mimeAtomToString(connection(), target);-
491 if (fmt.isEmpty()
fmt.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 29 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-29
492-
493 return
never executed: return 0L;
0L;
never executed: return 0L;
0
494 }-
495-
496-
497 if (QXcbMime::mimeDataForAtom(connection(), target, d, &data, &atomFormat, &dataFormat)
QXcbMime::mime..., &dataFormat)Description
TRUEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5-24
498-
499-
500-
501 static xcb_atom_t motif_clip_temporary = atom(QXcbAtom::CLIP_TEMPORARY);-
502 bool allow_incr = property != motif_clip_temporary;-
503-
504 if (m_clipboard_closing
m_clipboard_closingDescription
TRUEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
)
0-24
505 allow_incr = false;
executed 24 times by 5 tests: allow_incr = false;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
506-
507 const int increment = (xcb_get_maximum_request_length(xcb_connection()) * 4) - 24;-
508 if (data.size() > increment
data.size() > incrementDescription
TRUEnever evaluated
FALSEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
&& allow_incr
allow_incrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-24
509 long bytes = data.size();-
510 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, window, property,-
511 atom(QXcbAtom::INCR), 32, 1, (const void *)&bytes);-
512 new INCRTransaction(connection(), window, property, data, increment,-
513 atomFormat, dataFormat, clipboard_timeout);-
514 return
never executed: return property;
property;
never executed: return property;
0
515 }-
516-
517-
518 if (data.size() > increment
data.size() > incrementDescription
TRUEnever evaluated
FALSEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
0-24
519 return
never executed: return 0L;
0L;
never executed: return 0L;
0
520 int dataSize = data.size() / (dataFormat / 8);-
521-
522 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, window, property, atomFormat,-
523 dataFormat, dataSize, (const void *)data.constData());-
524 }
executed 24 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
24
525 return
executed 29 times by 5 tests: return property;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
property;
executed 29 times by 5 tests: return property;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
29
526}-
527-
528void QXcbClipboard::handleSelectionClearRequest(xcb_selection_clear_event_t *event)-
529{-
530 QClipboard::Mode mode = modeForAtom(event->selection);-
531 if (mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEnever evaluated
FALSEevaluated 15 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
0-15
532 return;
never executed: return;
0
533-
534-
535 if (m_timestamp[mode] != 0L
m_timestamp[mode] != 0LDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
&& event->time <= m_timestamp[mode]
event->time <=...imestamp[mode]Description
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEnever evaluated
)
0-14
536 return;
executed 14 times by 3 tests: return;
Executed by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
14
537-
538-
539-
540-
541-
542 xcb_window_t newOwner = getSelectionOwner(event->selection);-
543-
544-
545-
546-
547-
548 if (newOwner != 0L
newOwner != 0LDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
) {
0-1
549 if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection]
m_clientClipbo...rd::Selection]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
550 delete m_clientClipboard[mode];
never executed: delete m_clientClipboard[mode];
0
551 m_clientClipboard[mode] = 0;-
552 m_timestamp[mode] = 0L;-
553 }
never executed: end of block
0
554}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QClipboard
1
555-
556void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)-
557{-
558 if (requestor()
requestor()Description
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
&& req->requestor == requestor()
req->requestor == requestor()Description
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-10
559 QMessageLogger(__FILE__, 606, __PRETTY_FUNCTION__).warning("QXcbClipboard: Selection request should be caught before");-
560 return;
never executed: return;
0
561 }-
562-
563 xcb_selection_notify_event_t event;-
564 event.response_type = 31;-
565 event.requestor = req->requestor;-
566 event.selection = req->selection;-
567 event.target = req->target;-
568 event.property = 0L;-
569 event.time = req->time;-
570-
571 QMimeData *d;-
572 QClipboard::Mode mode = modeForAtom(req->selection);-
573 if (mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-10
574 QMessageLogger(__FILE__, 621, __PRETTY_FUNCTION__).warning() << "QXcbClipboard: Unknown selection" << connection()->atomName(req->selection);-
575 xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);-
576 return;
never executed: return;
0
577 }-
578-
579 d = m_clientClipboard[mode];-
580-
581 if (!d
!dDescription
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-10
582 QMessageLogger(__FILE__, 629, __PRETTY_FUNCTION__).warning("QXcbClipboard: Cannot transfer data, no data available");-
583 xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);-
584 return;
never executed: return;
0
585 }-
586-
587 if (m_timestamp[mode] == 0L
m_timestamp[mode] == 0LDescription
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
0-10
588 || (req->time != 0L
req->time != 0LDescription
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
&& req->time < m_timestamp[mode]
req->time < m_timestamp[mode]Description
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)) {
0-10
589 QMessageLogger(__FILE__, 636, __PRETTY_FUNCTION__).warning("QXcbClipboard: SelectionRequest too old");-
590 xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);-
591 return;
never executed: return;
0
592 }-
593-
594 xcb_atom_t targetsAtom = atom(QXcbAtom::TARGETS);-
595 xcb_atom_t multipleAtom = atom(QXcbAtom::MULTIPLE);-
596 xcb_atom_t timestampAtom = atom(QXcbAtom::TIMESTAMP);-
597-
598 struct AtomPair { xcb_atom_t target; xcb_atom_t property; } *multi = 0;-
599 xcb_atom_t multi_type = 0L;-
600 int multi_format = 0;-
601 int nmulti = 0;-
602 int imulti = -1;-
603 bool multi_writeback = false;-
604-
605 if (req->target == multipleAtom
req->target == multipleAtomDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5
606 QByteArray multi_data;-
607 if (req->property == 0L
req->property == 0LDescription
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
0-5
608 || !clipboardReadProperty(req->requestor, req->property, false, &multi_data,
!clipboardRead...&multi_format)Description
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
0-5
609 0, &multi_type, &multi_format)
!clipboardRead...&multi_format)Description
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
0-5
610 || multi_format != 32
multi_format != 32Description
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-5
611-
612 xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);-
613 return;
never executed: return;
0
614 }-
615 nmulti = multi_data.size()/sizeof(*multi);-
616 multi = new AtomPair[nmulti];-
617 memcpy(multi,multi_data.data(),multi_data.size());-
618 imulti = 0;-
619 }
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
620-
621 for (; imulti < nmulti
imulti < nmultiDescription
TRUEevaluated 39 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
; ++imulti) {
5-39
622 xcb_atom_t target;-
623 xcb_atom_t property;-
624-
625 if (multi
multiDescription
TRUEevaluated 34 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5-34
626 target = multi[imulti].target;-
627 property = multi[imulti].property;-
628 }
executed 34 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
else {
34
629 target = req->target;-
630 property = req->property;-
631 if (property == 0L
property == 0LDescription
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
0-5
632 property = target;
never executed: property = target;
0
633 }
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
634-
635 xcb_atom_t ret = 0L;-
636 if (target == 0L
target == 0LDescription
TRUEnever evaluated
FALSEevaluated 39 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
|| property == 0L
property == 0LDescription
TRUEnever evaluated
FALSEevaluated 39 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-39
637 ;-
638 }
never executed: end of block
else if (target == timestampAtom
target == timestampAtomDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 34 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-34
639 if (m_timestamp[mode] != 0L
m_timestamp[mode] != 0LDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
) {
0-5
640 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, req->requestor,-
641 property, XCB_ATOM_INTEGER, 32, 1, &m_timestamp[mode]);-
642 ret = property;-
643 }
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
else {
5
644 QMessageLogger(__FILE__, 691, __PRETTY_FUNCTION__).warning("QXcbClipboard: Invalid data timestamp");-
645 }
never executed: end of block
0
646 } else if (target == targetsAtom
target == targetsAtomDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 29 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5-29
647 ret = sendTargetsSelection(d, req->requestor, property);-
648 }
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
else {
5
649 ret = sendSelection(d, target, req->requestor, property);-
650 }
executed 29 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
29
651-
652 if (nmulti > 0
nmulti > 0Description
TRUEevaluated 34 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5-34
653 if (ret == 0L
ret == 0LDescription
TRUEnever evaluated
FALSEevaluated 34 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-34
654 multi[imulti].property = 0L;-
655 multi_writeback = true;-
656 }
never executed: end of block
0
657 }
executed 34 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
else {
34
658 event.property = ret;-
659 break;
executed 5 times by 5 tests: break;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
660 }-
661 }-
662-
663 if (nmulti > 0
nmulti > 0Description
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
5
664 if (multi_writeback
multi_writebackDescription
TRUEnever evaluated
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-5
665-
666-
667 xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, req->requestor, req->property,-
668 multi_type, 32, nmulti*2, (const void *)multi);-
669 }
never executed: end of block
0
670-
671 delete [] multi;-
672 event.property = req->property;-
673 }
executed 5 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
674-
675-
676 xcb_send_event(xcb_connection(), false, req->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&event);-
677}
executed 10 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
678-
679void QXcbClipboard::handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event)-
680{-
681 QClipboard::Mode mode = modeForAtom(event->selection);-
682 if (mode > QClipboard::Selection
mode > QClipboard::SelectionDescription
TRUEnever evaluated
FALSEevaluated 67 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
0-67
683 return;
never executed: return;
0
684-
685-
686-
687-
688 if (event->owner != owner()
event->owner != owner()Description
TRUEevaluated 15 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
FALSEevaluated 52 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
&& event->selection_timestamp > m_timestamp[mode]
event->selecti...imestamp[mode]Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
FALSEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QClipboard
  • tst_QPlainTextEdit
  • tst_QTextEdit
) {
1-52
689 if (!m_xClipboard[mode]
!m_xClipboard[mode]Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QClipboard
) {
0-1
690 m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));-
691 }
never executed: end of block
else {
0
692 m_xClipboard[mode]->reset();-
693 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QClipboard
1
694 emitChanged(mode);-
695 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QClipboard
else if (event->subtype == XCB_XFIXES_SELECTION_EVENT_SELECTION_CLIENT_CLOSE
event->subtype...N_CLIENT_CLOSEDescription
TRUEnever evaluated
FALSEevaluated 66 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
||
0-66
696 event->subtype == XCB_XFIXES_SELECTION_EVENT_SELECTION_WINDOW_DESTROY
event->subtype...WINDOW_DESTROYDescription
TRUEnever evaluated
FALSEevaluated 66 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
)
0-66
697 emitChanged(mode);
never executed: emitChanged(mode);
0
698}
executed 67 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QGraphicsProxyWidget
  • tst_QLineEdit
  • tst_QPlainTextEdit
  • tst_QTextEdit
67
699-
700-
701static inline int maxSelectionIncr(xcb_connection_t *c)-
702{-
703 int l = xcb_get_maximum_request_length(c);-
704 return
executed 9 times by 6 tests: return (l > 65536 ? 65536*4 : l*4) - 100;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
(l > 65536 ? 65536*4 : l*4) - 100;
executed 9 times by 6 tests: return (l > 65536 ? 65536*4 : l*4) - 100;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
9
705}-
706-
707bool QXcbClipboard::clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format)-
708{-
709 int maxsize = maxSelectionIncr(xcb_connection());-
710 ulong bytes_left;-
711 xcb_atom_t dummy_type;-
712 int dummy_format;-
713-
714 if (!type
!typeDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
0-9
715 type = &dummy_type;
never executed: type = &dummy_type;
0
716 if (!format
!formatDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
4-5
717 format = &dummy_format;
executed 4 times by 2 tests: format = &dummy_format;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
4
718-
719-
720 xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, 0, 0);-
721 xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);-
722 if (!reply
!replyDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
|| reply->type == 0L
reply->type == 0LDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-9
723 free(reply);-
724 buffer->resize(0);-
725 return
never executed: return false;
false;
never executed: return false;
0
726 }-
727 *type = reply->type;-
728 *format = reply->format;-
729 bytes_left = reply->bytes_after;-
730 free(reply);-
731-
732 int offset = 0, buffer_offset = 0;-
733-
734 int newSize = bytes_left;-
735 buffer->resize(newSize);-
736-
737 bool ok = (buffer->size() == newSize);-
738-
739 if (ok
okDescription
TRUEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
&& newSize
newSizeDescription
TRUEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
) {
0-9
740-
741-
742 while (bytes_left
bytes_leftDescription
TRUEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
9
743-
744-
745 xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, win, property, XCB_GET_PROPERTY_TYPE_ANY, offset, maxsize/4);-
746 reply = xcb_get_property_reply(xcb_connection(), cookie, 0);-
747 if (!reply
!replyDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
|| reply->type == 0L
reply->type == 0LDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-9
748 free(reply);-
749 break;
never executed: break;
0
750 }-
751 *type = reply->type;-
752 *format = reply->format;-
753 bytes_left = reply->bytes_after;-
754 char *data = (char *)xcb_get_property_value(reply);-
755 int length = xcb_get_property_value_length(reply);-
756-
757-
758-
759-
760 if ((
(int)(buffer_o...buffer->size()Description
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
int)(buffer_offset + length) > buffer->size()
(int)(buffer_o...buffer->size()Description
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-9
761 QMessageLogger(__FILE__, 808, __PRETTY_FUNCTION__).warning("QXcbClipboard: buffer overflow");-
762 length = buffer->size() - buffer_offset;-
763-
764-
765 bytes_left = 0;-
766 }
never executed: end of block
0
767-
768 memcpy(buffer->data() + buffer_offset, data, length);-
769 buffer_offset += length;-
770-
771 if (bytes_left
bytes_leftDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-9
772-
773 offset += length / 4;-
774 }
never executed: end of block
0
775 free(reply);-
776 }
executed 9 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
9
777 }
executed 9 times by 6 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
9
778-
779-
780-
781 if (size
sizeDescription
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
0-9
782 *
never executed: *size = buffer_offset;
size = buffer_offset;
never executed: *size = buffer_offset;
0
783 if (*
*type == atom(QXcbAtom::INCR)Description
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
type == atom(QXcbAtom::INCR)
*type == atom(QXcbAtom::INCR)Description
TRUEnever evaluated
FALSEevaluated 9 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
0-9
784 m_incr_receive_time = connection()->getTimestamp();
never executed: m_incr_receive_time = connection()->getTimestamp();
0
785 if (deleteProperty
deletePropertyDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
4-5
786 xcb_delete_property(xcb_connection(), win, property);
executed 4 times by 2 tests: xcb_delete_property(xcb_connection(), win, property);
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
4
787-
788 connection()->flush();-
789-
790 return
executed 9 times by 6 tests: return ok;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
ok;
executed 9 times by 6 tests: return ok;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
9
791}-
792-
793-
794namespace-
795{-
796 class Notify {-
797 public:-
798 Notify(xcb_window_t win, int t)-
799 : window(win), type(t) {}
executed 21 times by 7 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
21
800 xcb_window_t window;-
801 int type;-
802 bool checkEvent(xcb_generic_event_t *event) const {-
803 if (!event
!eventDescription
TRUEevaluated 17 times by 6 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 1436 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
17-1436
804 return
executed 17 times by 6 tests: return false;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
false;
executed 17 times by 6 tests: return false;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
17
805 int t = event->response_type & 0x7f;-
806 if (t != type
t != typeDescription
TRUEevaluated 1426 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 10 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
10-1426
807 return
executed 1426 times by 7 tests: return false;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
false;
executed 1426 times by 7 tests: return false;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
1426
808 if (t == 28
t == 28Description
TRUEnever evaluated
FALSEevaluated 10 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-10
809 xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event;-
810 if (pn->window == window
pn->window == windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
811 return
never executed: return true;
true;
never executed: return true;
0
812 }
never executed: end of block
else if (t == 31
t == 31Description
TRUEevaluated 10 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
) {
0-10
813 xcb_selection_notify_event_t *sn = (xcb_selection_notify_event_t *)event;-
814 if (sn->requestor == window
sn->requestor == windowDescription
TRUEevaluated 10 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
)
0-10
815 return
executed 10 times by 7 tests: return true;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
true;
executed 10 times by 7 tests: return true;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
816 }
never executed: end of block
0
817 return
never executed: return false;
false;
never executed: return false;
0
818 }-
819 };-
820 class ClipboardEvent {-
821 public:-
822 ClipboardEvent(QXcbConnection *c)-
823 { clipboard = c->internAtom("CLIPBOARD"); }
executed 11 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
11
824 xcb_atom_t clipboard;-
825 bool checkEvent(xcb_generic_event_t *e) const {-
826 if (!e
!eDescription
TRUEevaluated 5 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 848 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
5-848
827 return
executed 5 times by 5 tests: return false;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
false;
executed 5 times by 5 tests: return false;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
5
828 int type = e->response_type & 0x7f;-
829 if (type == 30
type == 30Description
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 838 times by 4 tests
Evaluated by:
  • tst_QApplication
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
10-838
830 xcb_selection_request_event_t *sr = (xcb_selection_request_event_t *)e;-
831 return
executed 10 times by 5 tests: return sr->selection == XCB_ATOM_PRIMARY || sr->selection == clipboard;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
sr->selection == XCB_ATOM_PRIMARY || sr->selection == clipboard;
executed 10 times by 5 tests: return sr->selection == XCB_ATOM_PRIMARY || sr->selection == clipboard;
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
832 } else if (type == 29
type == 29Description
TRUEnever evaluated
FALSEevaluated 838 times by 4 tests
Evaluated by:
  • tst_QApplication
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-838
833 xcb_selection_clear_event_t *sc = (xcb_selection_clear_event_t *)e;-
834 return
never executed: return sc->selection == XCB_ATOM_PRIMARY || sc->selection == clipboard;
sc->selection == XCB_ATOM_PRIMARY || sc->selection == clipboard;
never executed: return sc->selection == XCB_ATOM_PRIMARY || sc->selection == clipboard;
0
835 }-
836 return
executed 838 times by 4 tests: return false;
Executed by:
  • tst_QApplication
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
false;
executed 838 times by 4 tests: return false;
Executed by:
  • tst_QApplication
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
838
837 }-
838 };-
839}-
840-
841xcb_generic_event_t *QXcbClipboard::waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager)-
842{-
843 QElapsedTimer timer;-
844 timer.start();-
845 do {-
846 Notify notify(win, type);-
847 xcb_generic_event_t *e = connection()->checkEvent(notify);-
848 if (e
eDescription
TRUEevaluated 10 times by 7 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 11 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
)
10-11
849 return
executed 10 times by 7 tests: return e;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
e;
executed 10 times by 7 tests: return e;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
  • tst_qclipboard - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
850-
851 if (checkManager
checkManagerDescription
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QApplication
) {
1-10
852 xcb_get_selection_owner_cookie_t cookie = xcb_get_selection_owner(xcb_connection(), atom(QXcbAtom::CLIPBOARD_MANAGER));-
853 xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection(), cookie, 0);-
854 if (!reply
!replyDescription
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
|| reply->owner == 0L
reply->owner == 0LDescription
TRUEnever evaluated
FALSEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
) {
0-10
855 free(reply);-
856 return
never executed: return 0;
0;
never executed: return 0;
0
857 }-
858 free(reply);-
859 }
executed 10 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
860-
861-
862 ClipboardEvent clipboard(connection());-
863 e = connection()->checkEvent(clipboard);-
864 if (e
eDescription
TRUEevaluated 10 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QApplication
) {
1-10
865 connection()->handleXcbEvent(e);-
866 free(e);-
867 }
executed 10 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
10
868-
869 connection()->flush();-
870-
871-
872 struct timeval usleep_tv;-
873 usleep_tv.tv_sec = 0;-
874 usleep_tv.tv_usec = 50000;-
875 select(0, 0, 0, 0, &usleep_tv);-
876 }
executed 11 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
while (timer.elapsed() < timeout
timer.elapsed() < timeoutDescription
TRUEevaluated 11 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_qclipboard - unknown status
  • tst_qlineedit - unknown status
  • tst_qplaintextedit - unknown status
  • tst_qtextedit - unknown status
FALSEnever evaluated
);
0-11
877-
878 return
never executed: return 0;
0;
never executed: return 0;
0
879}-
880-
881QByteArray QXcbClipboard::clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm)-
882{-
883 QByteArray buf;-
884 QByteArray tmp_buf;-
885 bool alloc_error = false;-
886 int length;-
887 int offset = 0;-
888 xcb_timestamp_t prev_time = m_incr_receive_time;-
889-
890 if (nbytes > 0
nbytes > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
891-
892-
893-
894 buf.resize(nbytes+1);-
895 alloc_error = buf.size() != nbytes+1;-
896 }
never executed: end of block
0
897-
898 for (;;) {-
899 connection()->flush();-
900 xcb_generic_event_t *ge = waitForClipboardEvent(win, 28, clipboard_timeout);-
901 if (!ge
!geDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
902 break;
never executed: break;
0
903 xcb_property_notify_event_t *event = (xcb_property_notify_event_t *)ge;-
904-
905 if (event->atom != property
event->atom != propertyDescription
TRUEnever evaluated
FALSEnever evaluated
0
906 || event->state != XCB_PROPERTY_NEW_VALUE
event->state !...ERTY_NEW_VALUEDescription
TRUEnever evaluated
FALSEnever evaluated
0
907 || event->time < prev_time
event->time < prev_timeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
908 continue;
never executed: continue;
0
909 prev_time = event->time;-
910-
911 if (clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)
clipboardReadP...&length, 0, 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
912 if (length == 0
length == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
913 if (nullterm
nulltermDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
914 buf.resize(offset+1);-
915 buf[offset] = '\0';-
916 }
never executed: end of block
else {
0
917 buf.resize(offset);-
918 }
never executed: end of block
0
919 return
never executed: return buf;
buf;
never executed: return buf;
0
920 } else if (!alloc_error
!alloc_errorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
921 if (offset+length > (int)buf.size()
offset+length ...int)buf.size()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
922 buf.resize(offset+length+65535);-
923 if (buf.size() != offset+length+65535
buf.size() != ...t+length+65535Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
924 alloc_error = true;-
925 length = buf.size() - offset;-
926 }
never executed: end of block
0
927 }
never executed: end of block
0
928 memcpy(buf.data()+offset, tmp_buf.constData(), length);-
929 tmp_buf.resize(0);-
930 offset += length;-
931 }
never executed: end of block
0
932 }
never executed: end of block
else {
0
933 break;
never executed: break;
0
934 }-
935-
936 free(ge);-
937 }
never executed: end of block
0
938-
939-
940-
941 setRequestor(0);-
942-
943 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
944}-
945-
946QByteArray QXcbClipboard::getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtAtom)-
947{-
948 return
executed 4 times by 2 tests: return getSelection(modeAtom, fmtAtom, atom(QXcbAtom::_QT_SELECTION));
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
getSelection(modeAtom, fmtAtom, atom(QXcbAtom::_QT_SELECTION));
executed 4 times by 2 tests: return getSelection(modeAtom, fmtAtom, atom(QXcbAtom::_QT_SELECTION));
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
4
949}-
950-
951QByteArray QXcbClipboard::getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t time)-
952{-
953 QByteArray buf;-
954 xcb_window_t win = requestor();-
955-
956 if (time == 0
time == 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEnever evaluated
) time = connection()->time();
executed 4 times by 2 tests: time = connection()->time();
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
0-4
957-
958 xcb_delete_property(xcb_connection(), win, property);-
959 xcb_convert_selection(xcb_connection(), win, selection, target, property, time);-
960-
961 connection()->sync();-
962-
963 xcb_generic_event_t *ge = waitForClipboardEvent(win, 31, clipboard_timeout);-
964 bool no_selection = !ge
!geDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
|| ((
((xcb_selectio...property == 0LDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
xcb_selection_notify_event_t *)ge)->property == 0L
((xcb_selectio...property == 0LDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
;
0-4
965 free(ge);-
966-
967 if (no_selection
no_selectionDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
)
0-4
968 return
never executed: return buf;
buf;
never executed: return buf;
0
969-
970 xcb_atom_t type;-
971 if (clipboardReadProperty(win, property, true, &buf, 0, &type, 0)
clipboardReadP..., 0, &type, 0)Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
FALSEnever evaluated
) {
0-4
972 if (type == atom(QXcbAtom::INCR)
type == atom(QXcbAtom::INCR)Description
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QStyleSheetStyle
) {
0-4
973 int nbytes = buf.size() >= 4
buf.size() >= 4Description
TRUEnever evaluated
FALSEnever evaluated
? *((int*)buf.data()) : 0;
0
974 buf = clipboardReadIncrementalProperty(win, property, nbytes, false);-
975 }
never executed: end of block
0
976 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
4
977-
978 return
executed 4 times by 2 tests: return buf;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
buf;
executed 4 times by 2 tests: return buf;
Executed by:
  • tst_QApplication
  • tst_QStyleSheetStyle
4
979}-
980-
981-
982-
983-
984-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9