| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | namespace { namespace Q_QGS_loader { typedef QFactoryLoader Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ("org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5", QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive))) : value ("org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5", QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive) { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QFactoryLoader, Q_QGS_loader::innerFunction, Q_QGS_loader::guard> loader; | - | ||||||
| 7 | - | |||||||
| 8 | - | |||||||
| 9 | - | |||||||
| 10 | namespace { namespace Q_QGS_directLoader { typedef QFactoryLoader Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized) guard.store(QtGlobalStatic::Destroyed); } }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ("org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5", QLatin1String(""), Qt::CaseInsensitive))) : value ("org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5", QLatin1String(""), Qt::CaseInsensitive) { guard.store(QtGlobalStatic::Initialized); } } holder; return &holder.value; } } } static QGlobalStatic<QFactoryLoader, Q_QGS_directLoader::innerFunction, Q_QGS_directLoader::guard> directLoader; | - | ||||||
| static inline QXcbGlIntegration *loadIntegration(QFactoryLoader *loader, const QString &key) | ||||||||
| { | ||||||||
| const int index = loader->indexOf(key); | ||||||||
| if (index != -1) { | ||||||||
| if (QXcbGlIntegrationPlugin *factory = qobject_cast<QXcbGlIntegrationPlugin *>(loader->instance(index))) | ||||||||
| if (QXcbGlIntegration *result = factory->create()) | ||||||||
| return result; | ||||||||
| } | ||||||||
| return nullptr; | ||||||||
| 11 | - | |||||||
| 12 | - | |||||||
| 13 | - | |||||||
| }QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath) | ||||||||
| 15 | { | - | ||||||
| 16 | QStringList list; | - | ||||||
| 17 | - | |||||||
| 18 | if (!pluginPath.isEmpty()
| 0 | ||||||
| 19 | QCoreApplication::addLibraryPath(pluginPath); | - | ||||||
| 20 | list = directLoader()->keyMap().values(); | - | ||||||
| 21 | if (!list.isEmpty()
| 0 | ||||||
| 22 | const QString postFix = ([]() -> QString { enum { Size = sizeof(u"" " (from ")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" " (from " }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()) | - | ||||||
| 23 | + QDir::toNativeSeparators(pluginPath) | - | ||||||
| 24 | + QLatin1Char(')'); | - | ||||||
| 25 | const QStringList::iterator end = list.end(); | - | ||||||
| 26 | for (QStringList::iterator it = list.begin(); it != end
| 0 | ||||||
| 27 | (* never executed: it).append(postFix);(*it).append(postFix);never executed: (*it).append(postFix); | 0 | ||||||
| 28 | } never executed: end of block | 0 | ||||||
| 29 | } never executed: end of block | 0 | ||||||
| 30 | - | |||||||
| 31 | - | |||||||
| 32 | - | |||||||
| 33 | list.append(loader()->keyMap().values()); | - | ||||||
| 34 | return never executed: list;return list;never executed: return list; | 0 | ||||||
| 35 | } | - | ||||||
| 36 | - | |||||||
| 37 | QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath) | - | ||||||
| 38 | { | - | ||||||
| 39 | - | |||||||
| 40 | - | |||||||
| 41 | if (!pluginPath.isEmpty()
| 0-135 | ||||||
| 42 | QCoreApplication::addLibraryPath(pluginPath); | - | ||||||
| 43 | if (QXcbGlIntegration *ret = loadIntegration(qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(directLoader(), platform)
| 0 | ||||||
| 44 | return never executed: ret;return ret;never executed: return ret; | 0 | ||||||
| 45 | } never executed: end of block | 0 | ||||||
| 46 | - | |||||||
| 47 | - | |||||||
| 48 | - | |||||||
| 49 | if (return executed 135 times by 5 tests: return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
executed 135 times by 5 tests: qLoadPlugin<QXcbGlIntegration*ret = loadIntegration(, QXcbGlIntegrationPlugin>(loader(), platform))return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
executed 135 times by 5 tests: return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
| 135 | ||||||
| return ret; executed 135 times by 5 tests: return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
| ||||||||
| return nullptr; executed 135 times by 5 tests: return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
executed 135 times by 5 tests: );return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
executed 135 times by 5 tests: return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);Executed by:
| ||||||||
| 50 | } | - | ||||||
| 51 | - | |||||||
| 52 | - | |||||||
| Switch to Source code | Preprocessed file |