# HG changeset patch # User alberth # Date 2013-03-17 15:42:50 # Node ID 60d8306e833acb054321dc828957fab50e2fcb6a # Parent 96e17e721ea3c1cc3a6b67ac8d2e6ed50d8bd623 (svn r25095) -Codechange: Immediately save the sort order of the town directory instead of when closing the window. diff --git a/src/town_gui.cpp b/src/town_gui.cpp --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -703,11 +703,6 @@ public: this->FinishInitNested(desc, 0); } - ~TownDirectoryWindow() - { - this->last_sorting = this->towns.GetListing(); - } - virtual void SetStringParameters(int widget) const { switch (widget) { @@ -826,6 +821,7 @@ public: switch (widget) { case WID_TD_SORT_ORDER: // Click on sort order button this->towns.ToggleSortOrder(); + this->last_sorting = this->towns.GetListing(); // Store new sorting order. this->SetDirty(); break; @@ -855,6 +851,7 @@ public: if (this->towns.SortType() != index) { this->towns.SetSortType(index); + this->last_sorting = this->towns.GetListing(); // Store new sorting order. this->BuildSortTownList(); } }