! \internal */
| 791 | \internal |
| 792 | */ |
| 793 | void 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 |
nothing calls this directly
no test coverage detected