Skip to content

Commit 41d5d08

Browse files
committed
Testing fixes
1 parent 2030002 commit 41d5d08

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

Fronter/Source/Configuration/RequiredFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RequiredFile: commonItems::parser
2626
[[nodiscard]] auto getID() const { return ID; }
2727

2828
void setID(const int theID) { ID = theID; }
29-
void setValue(const std::string& theValue) { value = theValue; }
29+
void setValue(const std::filesystem::path& theValue) { value = theValue; }
3030

3131
private:
3232
void registerKeys();

Fronter/Source/Configuration/RequiredFolder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RequiredFolder: commonItems::parser
1515
explicit RequiredFolder(std::istream& theStream);
1616

1717
void setID(const int theID) { ID = theID; }
18-
void setValue(const std::string& theValue) { value = theValue; }
18+
void setValue(const std::filesystem::path& theValue) { value = theValue; }
1919

2020
[[nodiscard]] const auto& getName() const { return name; }
2121
[[nodiscard]] const auto& getDisplayName() const { return displayName; }

Fronter/Source/Frames/Tabs/PathsTab.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,14 @@ void PathsTab::OnPathChanged(wxFileDirPickerEvent& evt)
148148
for (const auto& folder: configuration->getRequiredFolders() | std::ranges::views::values)
149149
if (folder->getID() == evt.GetId())
150150
{
151-
const auto validPath = commonItems::DoesFolderExist(path(commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring())));
151+
const auto validPath = commonItems::DoesFolderExist(path(evt.GetPath().ToStdWstring()));
152152
if (!validPath)
153153
{
154-
Log(LogLevel::Error) << "Cannot access folder: " << commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring())
155-
<< " - Onedrive and similar symlink folders are not supported!";
154+
Log(LogLevel::Error) << "Cannot access folder: " << evt.GetPath().ToStdWstring() << " - Onedrive and similar symlink folders are not supported!";
156155
// Not bailing. We may not be able to access it but who knows, maybe converter can.
157156
}
158-
const auto result = commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring());
159-
folder->setValue(result);
160-
Log(LogLevel::Info) << folder->getName() << " set to: " << commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring());
157+
folder->setValue(evt.GetPath().ToStdWstring());
158+
Log(LogLevel::Info) << folder->getName() << " set to: " << evt.GetPath().ToStdWstring();
161159
// Intermezzo for mod detection
162160
if (!configuration->getAutoGenerateModsFrom().empty() && folder->getName() == configuration->getAutoGenerateModsFrom())
163161
{
@@ -169,13 +167,11 @@ void PathsTab::OnPathChanged(wxFileDirPickerEvent& evt)
169167
for (const auto& file: configuration->getRequiredFiles() | std::ranges::views::values)
170168
if (file->getID() == evt.GetId())
171169
{
172-
if (!commonItems::DoesFileExist(path(commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring()))))
170+
if (!commonItems::DoesFileExist(path(evt.GetPath().ToStdWstring())))
173171
{
174-
Log(LogLevel::Error) << "Cannot access file: " << commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring())
175-
<< " - Onedrive and similar symlink folders are not supported!";
172+
Log(LogLevel::Error) << "Cannot access file: " << evt.GetPath().ToStdWstring() << " - Onedrive and similar symlink folders are not supported!";
176173
}
177-
auto result = commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring());
178-
file->setValue(result);
179-
Log(LogLevel::Info) << file->getName() << " set to: " << commonItems::UTF16ToUTF8(evt.GetPath().ToStdWstring());
174+
file->setValue(evt.GetPath().ToStdWstring());
175+
Log(LogLevel::Info) << file->getName() << " set to: " << evt.GetPath().ToStdWstring();
180176
}
181177
}

0 commit comments

Comments
 (0)