Fix special chars in filenames breaking config creation

experimental/UWP_Inject
Peter Repukat 3 years ago
parent 6f47020ec1
commit f1412aad77

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,2,006008097710
PRODUCTVERSION 0,0,2,006008097710
FILEVERSION 0,0,3,101006047020
PRODUCTVERSION 0,0,3,101006047020
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - Config"
VALUE "FileVersion", "0.0.2.0-6-g8d9771f"
VALUE "FileVersion", "0.0.3.1-1-g6f47020"
VALUE "InternalName", "GlosSIConfig"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSIConfig.exe"
VALUE "ProductName", "GlosSi"
VALUE "ProductVersion", "0.0.2.0-6-g8d9771f"
VALUE "ProductVersion", "0.0.3.1-1-g6f47020"
END
END
BLOCK "VarFileInfo"
@ -294,6 +294,38 @@ END

@ -58,7 +58,7 @@ void UIModel::readConfigs()
std::for_each(entries.begin(), entries.end(), [this](const auto& name) {
auto path = config_path_;
path /= config_dir_name_.toStdString();
path /= name.toStdString();
path /= name.toStdWString();
QFile file(path);
if (!file.open(QIODevice::Text | QIODevice::ReadOnly)) {
// meh
@ -248,8 +248,8 @@ void UIModel::setAcrylicEffect(bool has_acrylic_affect)
void UIModel::writeTarget(const QJsonObject& json, const QString& name)
{
auto path = config_path_;
path /= config_dir_name_.toStdString();
path /= (name + ".json").toStdString();
path /= config_dir_name_.toStdWString();
path /= (name + ".json").toStdWString();
QFile file(path);
if (!file.open(QIODevice::Text | QIODevice::ReadWrite)) {
// meh

Loading…
Cancel
Save