@@ -20,12 +20,15 @@ namespace Config
20
20
constexpr char sSettingsSection [] = " Settings" ;
21
21
constexpr char sGeneralSection [] = " General" ;
22
22
constexpr char sProfilesSection [] = " Profiles" ;
23
+ constexpr char sImporterSection [] = " Importer" ;
23
24
constexpr char sLanguageKey [] = " language" ;
24
25
constexpr char sCurrentProfileKey [] = " currentprofile" ;
25
26
constexpr char sDataKey [] = " data" ;
26
27
constexpr char sArchiveKey [] = " fallback-archive" ;
27
28
constexpr char sContentKey [] = " content" ;
28
29
constexpr char sFirstRunKey [] = " firstrun" ;
30
+ constexpr char sImportContentSetupKey [] = " importcontentsetup" ;
31
+ constexpr char sImportFontSetupKey [] = " importfontsetup" ;
29
32
constexpr char sMainWindowWidthKey [] = " MainWindow/width" ;
30
33
constexpr char sMainWindowHeightKey [] = " MainWindow/height" ;
31
34
constexpr char sMainWindowPosXKey [] = " MainWindow/posx" ;
@@ -143,6 +146,16 @@ namespace Config
143
146
return false ;
144
147
}
145
148
149
+ bool parseImporterSection (const QString& key, const QString& value, LauncherSettings::Importer& importer)
150
+ {
151
+ if (key == sImportContentSetupKey )
152
+ return parseBool (value, importer.mImportContentSetup );
153
+ if (key == sImportFontSetupKey )
154
+ return parseBool (value, importer.mImportFontSetup );
155
+
156
+ return false ;
157
+ }
158
+
146
159
template <std::size_t size>
147
160
void writeSectionHeader (const char (&name)[size], QTextStream& stream)
148
161
{
@@ -202,6 +215,13 @@ namespace Config
202
215
writeKeyValue (sMainWindowPosXKey , value.mMainWindow .mPosX , stream);
203
216
writeKeyValue (sMainWindowHeightKey , value.mMainWindow .mHeight , stream);
204
217
}
218
+
219
+ void writeImporter (const LauncherSettings::Importer& value, QTextStream& stream)
220
+ {
221
+ writeSectionHeader (sImporterSection , stream);
222
+ writeKeyValue (sImportContentSetupKey , value.mImportContentSetup , stream);
223
+ writeKeyValue (sImportFontSetupKey , value.mImportFontSetup , stream);
224
+ }
205
225
}
206
226
}
207
227
@@ -210,6 +230,7 @@ void Config::LauncherSettings::writeFile(QTextStream& stream) const
210
230
writeSettings (mSettings , stream);
211
231
writeProfiles (mProfiles , stream);
212
232
writeGeneral (mGeneral , stream);
233
+ writeImporter (mImporter , stream);
213
234
}
214
235
215
236
QStringList Config::LauncherSettings::getContentLists ()
@@ -335,6 +356,8 @@ bool Config::LauncherSettings::setValue(const QString& sectionPrefix, const QStr
335
356
return parseProfilesSection (key, value, mProfiles );
336
357
if (sectionPrefix == sGeneralSection )
337
358
return parseGeneralSection (key, value, mGeneral );
359
+ if (sectionPrefix == sImporterSection )
360
+ return parseImporterSection (key, value, mImporter );
338
361
339
362
return false ;
340
363
}
@@ -390,4 +413,5 @@ void Config::LauncherSettings::clear()
390
413
mSettings = Settings{};
391
414
mGeneral = General{};
392
415
mProfiles = Profiles{};
416
+ mImporter = Importer{};
393
417
}
0 commit comments