MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / INISettingsObject

Method INISettingsObject

launcher/settings/INISettingsObject.cpp:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include <QFile>
21
22INISettingsObject::INISettingsObject(QStringList paths, QObject* parent) : SettingsObject(parent)
23{
24 auto first_path = paths.constFirst();
25 for (auto path : paths) {
26 if (!QFile::exists(path))
27 continue;
28
29 if (path != first_path && QFile::exists(path)) {
30 // Copy the fallback to the preferred path.
31 QFile::copy(path, first_path);
32 qDebug() << "Copied settings from" << path << "to" << first_path;
33 break;
34 }
35 }
36
37 m_filePath = first_path;
38 m_ini.loadFile(first_path);
39}
40
41INISettingsObject::INISettingsObject(QString path, QObject* parent) : SettingsObject(parent)
42{

Callers

nothing calls this directly

Calls 2

copyClass · 0.85
loadFileMethod · 0.80

Tested by

no test coverage detected