History

Move helpers to their own file

Atlante45 committed 10 years ago

Commit e5d54fc1 parent eaca3b64 files · +323 −307Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngines.cpp+0−37
@@ -283,43 +283,6 @@ void ScriptEngines::loadScripts() { · 282 unmodified lines
283283
284284 // loads all saved scripts
285285 Settings settings;
286−
287−
288− // START of backward compatibility code
289− // This following if statement is only meant to update the settings file still using the old setting key.
290− // If you read that comment and it has been more than a couple months since it was merged,
291− // then by all means, feel free to remove it.
292− if (!settings.childGroups().contains(SETTINGS_KEY)) {
293− qWarning() << "Detected old script settings config, loading from previous location";
294− const QString oldKey = "Settings";
295−
296− // Load old scripts array from settings
297− int size = settings.beginReadArray(oldKey);
298− for (int i = 0; i < size; ++i) {
299− settings.setArrayIndex(i);
300− QString string = settings.value("script").toString();
301− if (!string.isEmpty()) {
302− loadScript(string);
303− }
304− }
305− settings.endArray();
306−
307− // Cleanup old scripts array from settings
308− settings.beginWriteArray(oldKey);
309− for (int i = 0; i < size; ++i) {
310− settings.setArrayIndex(i);
311− settings.remove("");
312− }
313− settings.endArray();
314− settings.beginGroup(oldKey);
315− settings.remove("size");
316− settings.endGroup();
317−
318− return;
319− }
320− // END of backward compatibility code
321−
322−
323286 int size = settings.beginReadArray(SETTINGS_KEY);
324287 for (int i = 0; i < size; ++i) {
325288 settings.setArrayIndex(i);