]> git.tdb.fi Git - r2c2.git/commitdiff
Populate the import list when TrainListDialog is created
authorMikko Rasa <tdb@tdb.fi>
Mon, 18 Nov 2013 18:46:25 +0000 (20:46 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 18 Nov 2013 18:46:25 +0000 (20:46 +0200)
source/engineer/trainlistdialog.cpp

index e84fc883df04252fd8dfd9d7378531bbb68a64b3..a29bc304c34cb822076bcdd175ea2cd755c2b482 100644 (file)
@@ -62,6 +62,10 @@ TrainListDialog::TrainListDialog(Engineer &e):
                Driver &driver = layout.get_driver();
                driver.signal_locomotive_detected.connect(sigc::mem_fun(this, &TrainListDialog::locomotive_detected));
                driver.signal_locomotive_gone.connect(sigc::mem_fun(this, &TrainListDialog::locomotive_gone));
+
+               unsigned i = 0;
+               while(const Driver::DetectedLocomotive *loco = driver.enumerate_detected_locos(i++))
+                       detected_locos.append(loco);
        }
        layout.signal_train_added.connect(sigc::mem_fun(this, &TrainListDialog::train_added));
        layout.signal_train_removed.connect(sigc::mem_fun(this, &TrainListDialog::train_removed));