This replaces those uses with QMultiHash and QMultiMap
Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 17 files). Show all
Unified · Split
| @@ -69,7 +69,7 @@ ScriptEngines::ScriptEngines(ScriptEngine::Context context, const QUrl& defaultS · 68 unmodified lines | ||
| 69 | 69 | : _context(context), _defaultScriptsOverride(defaultScriptsOverride) |
| 70 | 70 | { |
| 71 | 71 | scriptGatekeeper.initialize(); |
| 72 | − | |
| 72 | + | |
| 73 | 73 | _scriptsModelFilter.setSourceModel(&_scriptsModel); |
| 74 | 74 | _scriptsModelFilter.sort(0, Qt::AscendingOrder); |
| 75 | 75 | _scriptsModelFilter.setDynamicSortFilter(true); |
| @@ -198,7 +198,7 @@ void ScriptEngines::shutdownScripting() { · 122 unmodified lines | ||
| 198 | 198 | * @typedef {object} ScriptDiscoveryService.PublicScript |
| 199 | 199 | * @property {string} name - The script's file name. |
| 200 | 200 | * @property {string} type - <code>"script"</code> or <code>"folder"</code>. |
| 201 | − * <p class="important">Deprecated: This property is deprecated and will be removed. It currently always has the value, | |
| 201 | + * <p class="important">Deprecated: This property is deprecated and will be removed. It currently always has the value, | |
| 202 | 202 | * <code>"script"</code>.</p> |
| 203 | 203 | * @property {ScriptDiscoveryService.PublicScript[]} [children] - Only present if <code>type == "folder"</code>. |
| 204 | 204 | * <p class="important">Deprecated: This property is deprecated and will be removed. It currently is never present. |
| @@ -266,7 +266,7 @@ QVariantList ScriptEngines::getLocal() { · 61 unmodified lines | ||
| 266 | 266 | /*@jsdoc |
| 267 | 267 | * Information on a running script. |
| 268 | 268 | * @typedef {object} ScriptDiscoveryService.RunningScript |
| 269 | − * @property {boolean} local - <code>true</code> if the script is a local file (i.e., the scheme is "file"), <code>false</code> | |
| 269 | + * @property {boolean} local - <code>true</code> if the script is a local file (i.e., the scheme is "file"), <code>false</code> | |
| 270 | 270 | * if it isn't (e.g., the scheme is "http"). |
| 271 | 271 | * @property {string} name - The script's file name. |
| 272 | 272 | * @property {string} path - The script's path and file name — excluding the scheme if a local file. |
| @@ -448,7 +448,7 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) { · 175 unmodified lines | ||
| 448 | 448 | |
| 449 | 449 | QReadLocker lock(&_scriptEnginesHashLock); |
| 450 | 450 | if (_scriptEnginesHash.contains(scriptURL)) { |
| 451 | − ScriptEnginePointer scriptEngine = _scriptEnginesHash[scriptURL]; | |
| 451 | + ScriptEnginePointer scriptEngine = _scriptEnginesHash.value(scriptURL); | |
| 452 | 452 | if (restart) { |
| 453 | 453 | bool isUserLoaded = scriptEngine->isUserLoaded(); |
| 454 | 454 | ScriptEngine::Type type = scriptEngine->getType(); |
| @@ -561,7 +561,7 @@ void ScriptEngines::onScriptEngineLoaded(const QString& rawScriptURL) { · 106 unmodified lines | ||
| 561 | 561 | QWriteLocker lock(&_scriptEnginesHashLock); |
| 562 | 562 | QUrl url = QUrl(rawScriptURL); |
| 563 | 563 | QUrl normalized = normalizeScriptURL(url); |
| 564 | − _scriptEnginesHash.insertMulti(normalized, scriptEngine); | |
| 564 | + _scriptEnginesHash.insert(normalized, scriptEngine); | |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | // Update settings with new script |