From: Mikko Rasa Date: Mon, 18 Nov 2013 18:46:25 +0000 (+0200) Subject: Populate the import list when TrainListDialog is created X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d5de37274a309d55706b5077cfcc60ef753fa97d;p=r2c2.git Populate the import list when TrainListDialog is created --- diff --git a/source/engineer/trainlistdialog.cpp b/source/engineer/trainlistdialog.cpp index e84fc88..a29bc30 100644 --- a/source/engineer/trainlistdialog.cpp +++ b/source/engineer/trainlistdialog.cpp @@ -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));