MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / readDependencyEntry

Method readDependencyEntry

lib/extensionsystem/pluginspec.cpp:793–822  ·  view source on GitHub ↗

! \internal */

Source from the content-addressed store, hash-verified

791 \internal
792*/
793void PluginSpecPrivate::readDependencyEntry(QXmlStreamReader &reader)
794{
795 PluginDependency dep;
796 dep.name = reader.attributes().value(QLatin1String(DEPENDENCY_NAME)).toString();
797 if (dep.name.isEmpty()) {
798 reader.raiseError(msgAttributeMissing(DEPENDENCY, DEPENDENCY_NAME));
799 return;
800 }
801 dep.version = reader.attributes().value(QLatin1String(DEPENDENCY_VERSION)).toString();
802 if (!dep.version.isEmpty() && !isValidVersion(dep.version)) {
803 reader.raiseError(msgInvalidFormat(DEPENDENCY_VERSION));
804 return;
805 }
806 dep.type = PluginDependency::Required;
807 if (reader.attributes().hasAttribute(QLatin1String(DEPENDENCY_TYPE))) {
808 const QStringRef typeValue = reader.attributes().value(QLatin1String(DEPENDENCY_TYPE));
809 if (typeValue == QLatin1String(DEPENDENCY_TYPE_HARD)) {
810 dep.type = PluginDependency::Required;
811 } else if (typeValue == QLatin1String(DEPENDENCY_TYPE_SOFT)) {
812 dep.type = PluginDependency::Optional;
813 } else {
814 reader.raiseError(msgInvalidFormat(DEPENDENCY_TYPE));
815 return;
816 }
817 }
818 dependencies.append(dep);
819 reader.readNext();
820 if (reader.tokenType() != QXmlStreamReader::EndElement)
821 reader.raiseError(msgUnexpectedToken());
822}
823
824/*!
825 \internal

Callers

nothing calls this directly

Calls 5

msgAttributeMissingFunction · 0.85
msgInvalidFormatFunction · 0.85
msgUnexpectedTokenFunction · 0.85
isEmptyMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected