Skip to content

Commit

Permalink
Modernize watchedpaths (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo authored Sep 11, 2024
1 parent 8db448f commit 5da7455
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct System {
int sortcolumn;
int sortxs;
int sortdescending;
wxHashMapBool watchedpaths;
std::set<wxString> watchedpaths;
bool insidefiledialog {false};
struct TimerStruct : wxTimer {
void Notify() {
Expand Down Expand Up @@ -395,8 +395,7 @@ struct System {
doc->lastmodificationtime = wxFileName(filename).GetModificationTime();
const wxString &d =
wxFileName(filename).GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
if (watchedpaths.find(d) == watchedpaths.end()) {
watchedpaths[d] = true;
if (watchedpaths.insert(d).second) {
frame->watcher->Add(wxFileName(d), wxFSW_EVENT_ALL);
}
}
Expand Down

0 comments on commit 5da7455

Please sign in to comment.