Skip to content

Commit

Permalink
Pretty print cloud cache path in recent files
Browse files Browse the repository at this point in the history
Similarly to how $HOME is handled, shorten and pretty-print path to
files stored in Poedit's cache of cloud-synced files.
  • Loading branch information
vslavik committed Dec 11, 2023
1 parent 053f80d commit a83de5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/recent_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ wxString pretty_print_path(wxFileName f)
// shorten the path for visual use:
auto path = f.GetPath();

auto cloud = wxFileName::DirName(PoeditApp::GetCacheDir("Cloud"));
cloud.ReplaceHomeDir();
if (path.StartsWith(cloud.GetFullPath()))
path = _("Cloud") + L"" + path.substr(cloud.GetFullPath().length());

#ifdef __WXMSW__
// ReplaceHomeDir() puts tilde at the beginning to replace $HOME, but this is uncommon on Windows,
// so remove it and just use plain path:
Expand Down

0 comments on commit a83de5e

Please sign in to comment.