MCPcopy Create free account
hub / github.com/OneMoreGres/ScreenTranslator / loadLegacySubstitutions

Function loadLegacySubstitutions

src/settings.cpp:94–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94Substitutions loadLegacySubstitutions()
95{
96 Substitutions result;
97
98 QFile f("st_subs.csv");
99 if (!f.open(QFile::ReadOnly))
100 return result;
101
102 const auto data = f.readAll();
103
104 const auto lines = QString::fromUtf8(data).split('\n', Qt::SkipEmptyParts);
105 for (const auto& line : lines) {
106 const auto parts = line.mid(1, line.size() - 2).split("\",\""); // remove "
107 if (parts.size() < 3)
108 continue;
109 result.emplace(parts[0], Substitution{parts[1], parts[2]});
110 }
111 return result;
112}
113
114void cleanupOutdated(QSettings& settings)
115{

Callers 1

loadMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected