| 102 | } |
| 103 | |
| 104 | bool constraintsMatch( const KPluginMetaData& info, const QVariantMap& constraints) |
| 105 | { |
| 106 | for (auto it = constraints.begin(); it != constraints.end(); ++it) { |
| 107 | const auto property = info.rawData().value(it.key()).toVariant(); |
| 108 | |
| 109 | if (!property.isValid()) { |
| 110 | return false; |
| 111 | } else if (property.canConvert<QStringList>()) { |
| 112 | const QSet<QString> values = stringSet(property); |
| 113 | const QSet<QString> expected = stringSet(it.value()); |
| 114 | if (!values.contains(expected)) { |
| 115 | return false; |
| 116 | } |
| 117 | } else if (it.value() != property) { |
| 118 | return false; |
| 119 | } |
| 120 | } |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | struct Dependency |
| 125 | { |