src/station_gui.cpp
changeset 10621 3edd349d9c14
parent 10595 7957c71b0dfe
child 10641 13148f508e6d
--- a/src/station_gui.cpp	Sun May 18 14:12:16 2008 +0000
+++ b/src/station_gui.cpp	Sun May 18 16:51:44 2008 +0000
@@ -168,39 +168,6 @@
 typedef GUIList<const Station*> GUIStationList;
 
 /**
- * Set the station sort flag for all station-list windows.
- * @param sl_flag Sort list flag to set for all station-list windows
- */
-static void SetStationListsFlag(SortListFlags sl_flag)
-{
-	Window *const *wz;
-
-	FOR_ALL_WINDOWS(wz) {
-		Window *w = *wz;
-		if (w->window_class == WC_STATION_LIST) {
-			dynamic_cast<GUIStationList*>(w)->flags |= sl_flag;
-			w->SetDirty();
-		}
-	}
-}
-
-/**
- * Set the 'VL_REBUILD' flag for all station lists
- */
-void RebuildStationLists()
-{
-	SetStationListsFlag(VL_REBUILD);
-}
-
-/**
- * Set the 'VL_RESORT' flag for all station lists
- */
-void ResortStationLists()
-{
-	SetStationListsFlag(VL_RESORT);
-}
-
-/**
  * Rebuild station list if the VL_REBUILD flag is set
  *
  * @param sl pointer to plstations_d (station list and flags)
@@ -605,6 +572,11 @@
 	{
 		this->vscroll.cap += delta.y / 10;
 	}
+
+	virtual void OnInvalidateData(int data)
+	{
+		this->flags |= (data == 0 ? VL_REBUILD : VL_RESORT);
+	}
 };
 
 Listing PlayerStationsWindow::station_sort = {0, 0};