diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:50:27 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:50:27 +0200 |
commit | bbb75d9614953b8c0f01f31d55885f76d48babfb (patch) | |
tree | 4ee3b7c317b42ee9de628bcdc4fc74b0061df2d5 /src/tools/moc | |
parent | 5fd882803e6bf642e17e7f8c32b35bcd6c7a6e50 (diff) | |
parent | f363540580eabd5aa27f4c172da796d637e38dfa (diff) |
Merge remote-tracking branch 'gerrit/dev' into wip/cmake
Change-Id: I2e1812e4f40131ff74919aa3b558db5c261fe412
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 6 | ||||
-rw-r--r-- | src/tools/moc/moc.cpp | 4 | ||||
-rw-r--r-- | src/tools/moc/moc.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 02c1fbd394..ab7e400f47 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1652,6 +1652,12 @@ void Generator::generatePluginMetaData() jsonObjectToCbor(&map, o); } + if (!cdef->pluginData.uri.isEmpty()) { + dev.nextItem("\"URI\""); + cbor_encode_int(&map, int(QtPluginMetaDataKeys::URI)); + cbor_encode_text_string(&map, cdef->pluginData.uri.constData(), cdef->pluginData.uri.size()); + } + // Add -M args from the command line: for (auto it = cdef->pluginData.metaArgs.cbegin(), end = cdef->pluginData.metaArgs.cend(); it != end; ++it) { const QJsonArray &a = it.value(); diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 2f52dd6ca0..7f43917f7e 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1311,6 +1311,9 @@ void Moc::parsePluginData(ClassDef *def) if (l == "IID") { next(STRING_LITERAL); def->pluginData.iid = unquotedLexem(); + } else if (l == "URI") { + next(STRING_LITERAL); + def->pluginData.uri = unquotedLexem(); } else if (l == "FILE") { next(STRING_LITERAL); QByteArray metaDataFile = unquotedLexem(); @@ -1351,6 +1354,7 @@ void Moc::parsePluginData(ClassDef *def) + " does not contain a valid JSON object. Declaration will be ignored"; warning(msg.constData()); def->pluginData.iid = QByteArray(); + def->pluginData.uri = QByteArray(); return; } } diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 2bba8a5bb9..bb1c9501fe 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -167,6 +167,7 @@ struct ClassDef : BaseDef { struct PluginData { QByteArray iid; + QByteArray uri; QMap<QString, QJsonArray> metaArgs; QJsonDocument metaData; } pluginData; |