mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-20 10:20:50 +00:00
Merge branch 'commas-arent-special' into 'master'
Don't give commas special meaning when matching comments to openmw.cfg values Closes #8287 See merge request OpenMW/openmw!4507
This commit is contained in:
commit
73161e6b64
@ -310,6 +310,7 @@
|
|||||||
Feature #8109: Expose commitCrime to Lua API
|
Feature #8109: Expose commitCrime to Lua API
|
||||||
Feature #8130: Launcher: Add the ability to open a selected data directory in the file browser
|
Feature #8130: Launcher: Add the ability to open a selected data directory in the file browser
|
||||||
Feature #8145: Starter spell flag is not exposed
|
Feature #8145: Starter spell flag is not exposed
|
||||||
|
Feature #8287: Launcher: Special handling for comma in openmw.cfg entries is unintuitive and should be removed
|
||||||
Task #5859: User openmw-cs.cfg has comment talking about settings.cfg
|
Task #5859: User openmw-cs.cfg has comment talking about settings.cfg
|
||||||
Task #5896: Do not use deprecated MyGUI properties
|
Task #5896: Do not use deprecated MyGUI properties
|
||||||
Task #6085: Replace boost::filesystem with std::filesystem
|
Task #6085: Replace boost::filesystem with std::filesystem
|
||||||
|
@ -274,9 +274,8 @@ bool Config::GameSettings::isOrderedLine(const QString& line)
|
|||||||
// - Always ignore a line beginning with '#' or empty lines; added above a config
|
// - Always ignore a line beginning with '#' or empty lines; added above a config
|
||||||
// entry.
|
// entry.
|
||||||
//
|
//
|
||||||
// - If a line in file exists with matching key and first part of value (before ',',
|
// - If a line in file exists with matching key and value, then replace the line with that of mUserSettings.
|
||||||
// '\n', etc) also matches, then replace the line with that of mUserSettings.
|
// - else if only the key matches, remove comment
|
||||||
// - else remove line
|
|
||||||
//
|
//
|
||||||
// - If there is no corresponding line in file, add at the end
|
// - If there is no corresponding line in file, add at the end
|
||||||
//
|
//
|
||||||
@ -325,7 +324,7 @@ bool Config::GameSettings::writeFileWithComments(QFile& file)
|
|||||||
// +----------------------------------------------------------+
|
// +----------------------------------------------------------+
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
QRegularExpression settingRegex("^([^=]+)\\s*=\\s*([^,]+)(.*)$");
|
QRegularExpression settingRegex("^([^=]+)\\s*=\\s*(.+?)\\s*$");
|
||||||
std::vector<QString> comments;
|
std::vector<QString> comments;
|
||||||
auto commentStart = fileCopy.end();
|
auto commentStart = fileCopy.end();
|
||||||
std::map<QString, std::vector<QString>> commentsMap;
|
std::map<QString, std::vector<QString>> commentsMap;
|
||||||
@ -395,8 +394,7 @@ bool Config::GameSettings::writeFileWithComments(QFile& file)
|
|||||||
// look for a key in the line
|
// look for a key in the line
|
||||||
if (!match.hasMatch() || settingRegex.captureCount() < 2)
|
if (!match.hasMatch() || settingRegex.captureCount() < 2)
|
||||||
{
|
{
|
||||||
// no key or first part of value found in line, replace with a null string which
|
// no key or no value found in line, replace with a null string which will be removed later
|
||||||
// will be removed later
|
|
||||||
*iter = QString();
|
*iter = QString();
|
||||||
comments.clear();
|
comments.clear();
|
||||||
commentStart = fileCopy.end();
|
commentStart = fileCopy.end();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user