| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | | - |
| 30 | | - |
| 31 | | - |
| 32 | | - |
| 33 | | - |
| 34 | #include "qxcbmime.h" | - |
| 35 | | - |
| 36 | #include <QtCore/QTextCodec> | - |
| 37 | #include <QtGui/QImageWriter> | - |
| 38 | #include <QtCore/QBuffer> | - |
| 39 | #include <qdebug.h> | - |
| 40 | | - |
| 41 | #include <X11/Xutil.h> | - |
| 42 | | - |
| 43 | #undef XCB_ATOM_STRING | - |
| 44 | #undef XCB_ATOM_PIXMAP | - |
| 45 | #undef XCB_ATOM_BITMAP | - |
| 46 | | - |
| 47 | QT_BEGIN_NAMESPACE | - |
| 48 | | - |
| 49 | #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) | - |
| 50 | | - |
| 51 | QXcbMime::QXcbMime() | - |
| 52 | : QInternalMimeData() | - |
| 53 | {executed 134 times by 9 tests: end of blockExecuted by:- tst_QApplication
- tst_QClipboard
- tst_QGuiApplication
- tst_QPlainTextEdit
- tst_QStyleSheetStyle
- tst_QTextEdit
- tst_qapplication - unknown status
- tst_qprocess - unknown status
- tst_selftests - unknown status
}executed 134 times by 9 tests: end of blockExecuted by:- tst_QApplication
- tst_QClipboard
- tst_QGuiApplication
- tst_QPlainTextEdit
- tst_QStyleSheetStyle
- tst_QTextEdit
- tst_qapplication - unknown status
- tst_qprocess - unknown status
- tst_selftests - unknown status
| 134 |
| 54 | | - |
| 55 | QXcbMime::~QXcbMime() | - |
| 56 | {} | - |
| 57 | | - |
| 58 | | - |
| 59 | | - |
| 60 | QString QXcbMime::mimeAtomToString(QXcbConnection *connection, xcb_atom_t a) | - |
| 61 | { | - |
| 62 | if (a == XCB_NONE)| TRUE | never evaluated | | FALSE | evaluated 59 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-59 |
| 63 | return QString(); never executed: return QString(); | 0 |
| 64 | | - |
| 65 | | - |
| 66 | if (a == XCB_ATOM_STRING| TRUE | evaluated 7 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 52 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 7-52 |
| 67 | || a == connection->atom(QXcbAtom::UTF8_STRING)| TRUE | evaluated 9 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 43 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 9-43 |
| 68 | || a == connection->atom(QXcbAtom::TEXT))| TRUE | evaluated 7 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 36 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 7-36 |
| 69 | return QLatin1String("text/plain");executed 23 times by 6 tests: return QLatin1String("text/plain");Executed by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 23 |
| 70 | | - |
| 71 | | - |
| 72 | if (a == XCB_ATOM_PIXMAP)| TRUE | never evaluated | | FALSE | evaluated 36 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-36 |
| 73 | return QLatin1String("image/ppm"); never executed: return QLatin1String("image/ppm"); | 0 |
| 74 | | - |
| 75 | QByteArray atomName = connection->atomName(a); | - |
| 76 | | - |
| 77 | | - |
| 78 | if (atomName == "text/x-moz-url")| TRUE | never evaluated | | FALSE | evaluated 36 times by 6 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-36 |
| 79 | atomName = "text/uri-list"; never executed: atomName = "text/uri-list"; | 0 |
| 80 | | - |
| 81 | return QString::fromLatin1(atomName.constData());executed 36 times by 6 tests: return QString::fromLatin1(atomName.constData());Executed by:- tst_QApplication
- tst_QStyleSheetStyle
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 36 |
| 82 | } | - |
| 83 | | - |
| 84 | bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, | - |
| 85 | xcb_atom_t *atomFormat, int *dataFormat) | - |
| 86 | { | - |
| 87 | if (!data)| TRUE | never evaluated | | FALSE | evaluated 29 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-29 |
| 88 | return false; never executed: return false; | 0 |
| 89 | | - |
| 90 | bool ret = false; | - |
| 91 | *atomFormat = a; | - |
| 92 | *dataFormat = 8; | - |
| 93 | | - |
| 94 | if ((a == connection->atom(QXcbAtom::UTF8_STRING)| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 24 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5-24 |
| 95 | || a == XCB_ATOM_STRING| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 19 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5-19 |
| 96 | || a == connection->atom(QXcbAtom::TEXT))| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 14 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5-14 |
| 97 | && QInternalMimeData::hasFormatHelper(QLatin1String("text/plain"), mimeData)) {| TRUE | evaluated 15 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | never evaluated |
| 0-15 |
| 98 | if (a == connection->atom(QXcbAtom::UTF8_STRING)) {| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 10 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5-10 |
| 99 | *data = QInternalMimeData::renderDataHelper(QLatin1String("text/plain"), mimeData); | - |
| 100 | ret = true; | - |
| 101 | } else if (a == XCB_ATOM_STRING ||executed 5 times by 5 tests: end of blockExecuted by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5 |
| 102 | a == connection->atom(QXcbAtom::TEXT)) {| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | never evaluated |
| 0-5 |
| 103 | | - |
| 104 | *data = QString::fromUtf8(QInternalMimeData::renderDataHelper( | - |
| 105 | QLatin1String("text/plain"), mimeData)).toLatin1(); | - |
| 106 | ret = true; | - |
| 107 | }executed 10 times by 5 tests: end of blockExecuted by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 10 |
| 108 | return ret;executed 15 times by 5 tests: return ret;Executed by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 15 |
| 109 | } | - |
| 110 | | - |
| 111 | QString atomName = mimeAtomToString(connection, a); | - |
| 112 | if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) {| TRUE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 5-9 |
| 113 | *data = QInternalMimeData::renderDataHelper(atomName, mimeData); | - |
| 114 | | - |
| 115 | | - |
| 116 | if (atomName == QLatin1String("text/uri-list")| TRUE | never evaluated | | FALSE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-9 |
| 117 | && connection->atomName(a) == "text/x-moz-url") {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 118 | const QByteArray uri = data->split('\n').first(); | - |
| 119 | QString mozUri = QString::fromLatin1(uri, uri.size()); | - |
| 120 | mozUri += QLatin1Char('\n'); | - |
| 121 | *data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), | - |
| 122 | mozUri.length() * 2); | - |
| 123 | } else if (atomName == QLatin1String("application/x-color")) never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-9 |
| 124 | *dataFormat = 16; never executed: *dataFormat = 16; | 0 |
| 125 | ret = true; | - |
| 126 | } else if ((a == XCB_ATOM_PIXMAP || a == XCB_ATOM_BITMAP) && mimeData->hasImage()) {executed 9 times by 5 tests: end of blockExecuted by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| TRUE | never evaluated | | FALSE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| TRUE | never evaluated | | FALSE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-9 |
| 127 | ret = true; | - |
| 128 | } else if (atomName == QLatin1String("text/plain") never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-5 |
| 129 | && mimeData->hasFormat(QLatin1String("text/uri-list"))) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 130 | | - |
| 131 | *data = QInternalMimeData::renderDataHelper(atomName, mimeData); | - |
| 132 | ret = true; | - |
| 133 | } never executed: end of block | 0 |
| 134 | return ret;executed 14 times by 5 tests: return ret;Executed by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 14 |
| 135 | } | - |
| 136 | | - |
| 137 | QVector<xcb_atom_t> QXcbMime::mimeAtomsForFormat(QXcbConnection *connection, const QString &format) | - |
| 138 | { | - |
| 139 | QVector<xcb_atom_t> atoms; | - |
| 140 | atoms.reserve(7); | - |
| 141 | atoms.append(connection->internAtom(format.toLatin1())); | - |
| 142 | | - |
| 143 | | - |
| 144 | if (format == QLatin1String("text/plain")) {| TRUE | evaluated 5 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| | FALSE | evaluated 4 times by 2 testsEvaluated by:- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 4-5 |
| 145 | atoms.append(connection->atom(QXcbAtom::UTF8_STRING)); | - |
| 146 | atoms.append(XCB_ATOM_STRING); | - |
| 147 | atoms.append(connection->atom(QXcbAtom::TEXT)); | - |
| 148 | }executed 5 times by 5 tests: end of blockExecuted by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 5 |
| 149 | | - |
| 150 | | - |
| 151 | if (format == QLatin1String("text/uri-list")) {| TRUE | never evaluated | | FALSE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-9 |
| 152 | atoms.append(connection->internAtom("text/x-moz-url")); | - |
| 153 | atoms.append(connection->internAtom("text/plain")); | - |
| 154 | } never executed: end of block | 0 |
| 155 | | - |
| 156 | | - |
| 157 | if (format == QLatin1String("image/ppm"))| TRUE | never evaluated | | FALSE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-9 |
| 158 | atoms.append(XCB_ATOM_PIXMAP); never executed: atoms.append(XCB_ATOM_PIXMAP); | 0 |
| 159 | if (format == QLatin1String("image/pbm"))| TRUE | never evaluated | | FALSE | evaluated 9 times by 5 testsEvaluated by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
|
| 0-9 |
| 160 | atoms.append(XCB_ATOM_BITMAP); never executed: atoms.append(XCB_ATOM_BITMAP); | 0 |
| 161 | | - |
| 162 | return atoms;executed 9 times by 5 tests: return atoms;Executed by:- tst_QApplication
- tst_qclipboard - unknown status
- tst_qlineedit - unknown status
- tst_qplaintextedit - unknown status
- tst_qtextedit - unknown status
| 9 |
| 163 | } | - |
| 164 | | - |
| 165 | QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, | - |
| 166 | QVariant::Type requestedType, const QByteArray &encoding) | - |
| 167 | { | - |
| 168 | QString atomName = mimeAtomToString(connection, a); | - |
| 169 | | - |
| 170 | | - |
| 171 | if (!encoding.isEmpty()| TRUE | never evaluated | | FALSE | evaluated 2 times by 2 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
|
| 0-2 |
| 172 | && atomName == format + QLatin1String(";charset=") + QString::fromLatin1(encoding)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 173 | | - |
| 174 | #ifndef QT_NO_TEXTCODEC | - |
| 175 | if (requestedType == QVariant::String) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 176 | QTextCodec *codec = QTextCodec::codecForName(encoding); | - |
| 177 | if (codec)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 178 | return codec->toUnicode(data); never executed: return codec->toUnicode(data); | 0 |
| 179 | } never executed: end of block | 0 |
| 180 | #endif | - |
| 181 | | - |
| 182 | return data; never executed: return data; | 0 |
| 183 | } | - |
| 184 | | - |
| 185 | | - |
| 186 | if (format == QLatin1String("text/plain")) {| TRUE | evaluated 2 times by 2 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
| | FALSE | never evaluated |
| 0-2 |
| 187 | if (a == connection->atom(QXcbAtom::UTF8_STRING))| TRUE | evaluated 2 times by 2 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
| | FALSE | never evaluated |
| 0-2 |
| 188 | return QString::fromUtf8(data);executed 2 times by 2 tests: return QString::fromUtf8(data);Executed by:- tst_QApplication
- tst_QStyleSheetStyle
| 2 |
| 189 | if (a == XCB_ATOM_STRING ||| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 190 | a == connection->atom(QXcbAtom::TEXT))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 191 | return QString::fromLatin1(data); never executed: return QString::fromLatin1(data); | 0 |
| 192 | } never executed: end of block | 0 |
| 193 | | - |
| 194 | | - |
| 195 | | - |
| 196 | | - |
| 197 | if ((format == QLatin1String("text/html") || format == QLatin1String("text/uri-list"))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 198 | && data.size() > 1) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 199 | const quint8 byte0 = data.at(0); | - |
| 200 | const quint8 byte1 = data.at(1); | - |
| 201 | if ((byte0 == 0xff && byte1 == 0xfe) || (byte0 == 0xfe && byte1 == 0xff)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 202 | || (byte0 != 0 && byte1 == 0) || (byte0 == 0 && byte1 != 0)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 203 | const QString str = QString::fromUtf16( | - |
| 204 | reinterpret_cast<const ushort *>(data.constData()), data.size() / 2); | - |
| 205 | if (!str.isNull()) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 206 | if (format == QLatin1String("text/uri-list")) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 207 | const QStringList urls = str.split(QLatin1Char('\n')); | - |
| 208 | QList<QVariant> list; | - |
| 209 | foreach (const QString &s, urls) { | - |
| 210 | const QUrl url(s.trimmed()); | - |
| 211 | if (url.isValid())| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 212 | list.append(url); never executed: list.append(url); | 0 |
| 213 | } never executed: end of block | 0 |
| 214 | | - |
| 215 | | - |
| 216 | | - |
| 217 | if (!list.isEmpty() && connection->atomName(a) == "text/x-moz-url")| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 218 | return list.first(); never executed: return list.first(); | 0 |
| 219 | return list; never executed: return list; | 0 |
| 220 | } else { | - |
| 221 | return str; never executed: return str; | 0 |
| 222 | } | - |
| 223 | } | - |
| 224 | } never executed: end of block | 0 |
| 225 | } never executed: end of block | 0 |
| 226 | | - |
| 227 | if (atomName == format)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 228 | return data; never executed: return data; | 0 |
| 229 | | - |
| 230 | #if 0 // ### | - |
| 231 | | - |
| 232 | if (format == QLatin1String("image/ppm")) { | - |
| 233 | if (a == XCB_ATOM_PIXMAP && data.size() == sizeof(Pixmap)) { | - |
| 234 | Pixmap xpm = *((Pixmap*)data.data()); | - |
| 235 | if (!xpm) | - |
| 236 | return QByteArray(); | - |
| 237 | Window root; | - |
| 238 | int x; | - |
| 239 | int y; | - |
| 240 | uint width; | - |
| 241 | uint height; | - |
| 242 | uint border_width; | - |
| 243 | uint depth; | - |
| 244 | | - |
| 245 | XGetGeometry(display, xpm, &root, &x, &y, &width, &height, &border_width, &depth); | - |
| 246 | XImage *ximg = XGetImage(display,xpm,x,y,width,height,AllPlanes,depth==1 ? XYPixmap : ZPixmap); | - |
| 247 | QImage qimg = QXlibStatic::qimageFromXImage(ximg); | - |
| 248 | XDestroyImage(ximg); | - |
| 249 | | - |
| 250 | QImageWriter imageWriter; | - |
| 251 | imageWriter.setFormat("PPMRAW"); | - |
| 252 | QBuffer buf; | - |
| 253 | buf.open(QIODevice::WriteOnly); | - |
| 254 | imageWriter.setDevice(&buf); | - |
| 255 | imageWriter.write(qimg); | - |
| 256 | return buf.buffer(); | - |
| 257 | } | - |
| 258 | } | - |
| 259 | #endif | - |
| 260 | return QVariant(); never executed: return QVariant(); | 0 |
| 261 | } | - |
| 262 | | - |
| 263 | xcb_atom_t QXcbMime::mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, | - |
| 264 | const QVector<xcb_atom_t> &atoms, QByteArray *requestedEncoding) | - |
| 265 | { | - |
| 266 | requestedEncoding->clear(); | - |
| 267 | | - |
| 268 | | - |
| 269 | if (format == QLatin1String("text/plain")) {| TRUE | evaluated 2 times by 2 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
| | FALSE | never evaluated |
| 0-2 |
| 270 | if (atoms.contains(connection->atom(QXcbAtom::UTF8_STRING)))| TRUE | evaluated 2 times by 2 testsEvaluated by:- tst_QApplication
- tst_QStyleSheetStyle
| | FALSE | never evaluated |
| 0-2 |
| 271 | return connection->atom(QXcbAtom::UTF8_STRING);executed 2 times by 2 tests: return connection->atom(QXcbAtom::UTF8_STRING);Executed by:- tst_QApplication
- tst_QStyleSheetStyle
| 2 |
| 272 | if (atoms.contains(XCB_ATOM_STRING))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 273 | return XCB_ATOM_STRING; never executed: return XCB_ATOM_STRING; | 0 |
| 274 | if (atoms.contains(connection->atom(QXcbAtom::TEXT)))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 275 | return connection->atom(QXcbAtom::TEXT); never executed: return connection->atom(QXcbAtom::TEXT); | 0 |
| 276 | } never executed: end of block | 0 |
| 277 | | - |
| 278 | | - |
| 279 | if (format == QLatin1String("text/uri-list")) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 280 | xcb_atom_t a = connection->internAtom(format.toLatin1()); | - |
| 281 | if (a && atoms.contains(a))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 282 | return a; never executed: return a; | 0 |
| 283 | a = connection->internAtom("text/x-moz-url"); | - |
| 284 | if (a && atoms.contains(a))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 285 | return a; never executed: return a; | 0 |
| 286 | } never executed: end of block | 0 |
| 287 | | - |
| 288 | | - |
| 289 | if (format == QLatin1String("image/ppm")) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 290 | if (atoms.contains(XCB_ATOM_PIXMAP))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 291 | return XCB_ATOM_PIXMAP; never executed: return XCB_ATOM_PIXMAP; | 0 |
| 292 | } never executed: end of block | 0 |
| 293 | | - |
| 294 | | - |
| 295 | | - |
| 296 | if (requestedType == QVariant::String| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 297 | && format.startsWith(QLatin1String("text/"))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 298 | && !format.contains(QLatin1String("charset="))) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 299 | | - |
| 300 | QString formatWithCharset = format; | - |
| 301 | formatWithCharset.append(QLatin1String(";charset=utf-8")); | - |
| 302 | | - |
| 303 | xcb_atom_t a = connection->internAtom(formatWithCharset.toLatin1()); | - |
| 304 | if (a && atoms.contains(a)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 305 | *requestedEncoding = "utf-8"; | - |
| 306 | return a; never executed: return a; | 0 |
| 307 | } | - |
| 308 | } never executed: end of block | 0 |
| 309 | | - |
| 310 | xcb_atom_t a = connection->internAtom(format.toLatin1()); | - |
| 311 | if (a && atoms.contains(a))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 312 | return a; never executed: return a; | 0 |
| 313 | | - |
| 314 | return 0; never executed: return 0; | 0 |
| 315 | } | - |
| 316 | | - |
| 317 | #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) | - |
| 318 | | - |
| 319 | QT_END_NAMESPACE | - |
| | |