History

Fix warnings related to deprecated usage of multiple keys in QHash and QMap

This replaces those uses with QMultiHash and QMultiMap

Dale Glass committed 5 years ago

Commit d77c8bb1 parent 57167cd17 files · +226 −221Browse files

Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 17 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngines.cpp+5−5
@@ -69,7 +69,7 @@ ScriptEngines::ScriptEngines(ScriptEngine::Context context, const QUrl& defaultS · 68 unmodified lines
6969 : _context(context), _defaultScriptsOverride(defaultScriptsOverride)
7070 {
7171 scriptGatekeeper.initialize();
72−
72+
7373 _scriptsModelFilter.setSourceModel(&_scriptsModel);
7474 _scriptsModelFilter.sort(0, Qt::AscendingOrder);
7575 _scriptsModelFilter.setDynamicSortFilter(true);
@@ -198,7 +198,7 @@ void ScriptEngines::shutdownScripting() { · 122 unmodified lines
198198 * @typedef {object} ScriptDiscoveryService.PublicScript
199199 * @property {string} name - The script's file name.
200200 * @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,
202202 * <code>"script"</code>.</p>
203203 * @property {ScriptDiscoveryService.PublicScript[]} [children] - Only present if <code>type == "folder"</code>.
204204 * <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
266266 /*@jsdoc
267267 * Information on a running script.
268268 * @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>
270270 * if it isn't (e.g., the scheme is "http").
271271 * @property {string} name - The script's file name.
272272 * @property {string} path - The script's path and file name &mdash; excluding the scheme if a local file.
@@ -448,7 +448,7 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) { · 175 unmodified lines
448448
449449 QReadLocker lock(&_scriptEnginesHashLock);
450450 if (_scriptEnginesHash.contains(scriptURL)) {
451− ScriptEnginePointer scriptEngine = _scriptEnginesHash[scriptURL];
451+ ScriptEnginePointer scriptEngine = _scriptEnginesHash.value(scriptURL);
452452 if (restart) {
453453 bool isUserLoaded = scriptEngine->isUserLoaded();
454454 ScriptEngine::Type type = scriptEngine->getType();
@@ -561,7 +561,7 @@ void ScriptEngines::onScriptEngineLoaded(const QString& rawScriptURL) { · 106 unmodified lines
561561 QWriteLocker lock(&_scriptEnginesHashLock);
562562 QUrl url = QUrl(rawScriptURL);
563563 QUrl normalized = normalizeScriptURL(url);
564− _scriptEnginesHash.insertMulti(normalized, scriptEngine);
564+ _scriptEnginesHash.insert(normalized, scriptEngine);
565565 }
566566
567567 // Update settings with new script