Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Hopefully fixed some highly questionable and confusing filesystem beh…
Browse files Browse the repository at this point in the history
…avior when installed
  • Loading branch information
PazerOP committed Jan 6, 2021
1 parent 44f678e commit a66171d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
5 changes: 1 addition & 4 deletions tf2_bot_detector/Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ std::filesystem::path Filesystem::ResolvePath(const std::filesystem::path& path,
}
else if (usage == PathUsage::Write)
{
if (!m_IsPortable)
return m_AppDataDir / path;

return m_WorkingDir / path;
return GetRealMutableDataDir() / path;
}
else
{
Expand Down
13 changes: 5 additions & 8 deletions tf2_bot_detector/Filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,15 @@ namespace tf2_bot_detector
{
return baseDataDir / "logs";
}
std::filesystem::path GetLogsDir() const
{
return GetLogsDir(GetMutableDataDir());
}
std::filesystem::path GetLogsDir() const { return GetLogsDir(GetMutableDataDir()); }
std::filesystem::path GetRealLogsDir() const { return GetLogsDir(GetRealMutableDataDir()); }

static std::filesystem::path GetConfigDir(const std::filesystem::path& baseDataDir)
{
return baseDataDir / "cfg";
}
std::filesystem::path GetConfigDir() const
{
return GetConfigDir(GetMutableDataDir());
}
std::filesystem::path GetConfigDir() const { return GetConfigDir(GetMutableDataDir()); }
std::filesystem::path GetRealConfigDir() const { return GetConfigDir(GetRealMutableDataDir()); }

bool Exists(const std::filesystem::path& path) const
{
Expand Down
4 changes: 2 additions & 2 deletions tf2_bot_detector/UI/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ void MainWindow::OnDrawMenuBar()
if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("Open Config Folder"))
Shell::ExploreTo(IFilesystem::GetConfigDir(IFilesystem::Get().GetRealMutableDataDir()));
Shell::ExploreTo(IFilesystem::Get().GetRealConfigDir());
if (ImGui::MenuItem("Open Logs Folder"))
Shell::ExploreTo(IFilesystem::GetLogsDir(IFilesystem::Get().GetRealMutableDataDir()));
Shell::ExploreTo(IFilesystem::Get().GetRealLogsDir());

ImGui::Separator();

Expand Down

0 comments on commit a66171d

Please sign in to comment.