using std::list;
using std::map;
-using std::pair;
using std::shared_ptr;
using std::string;
devices.push_back(selected_device);
assert(selected_device);
- list< pair< shared_ptr<Device>, string> > device_list;
-
- for (auto device : devices)
- device_list.push_back(make_pair(
- device, device_manager_.get_display_name(device)));
-
- sampling_bar_->set_device_list(device_list, selected_device);
+ sampling_bar_->set_device_list(devices, selected_device);
}
void MainWindow::closeEvent(QCloseEvent *event)
}
void SamplingBar::set_device_list(
- const std::list< std::pair<std::shared_ptr<sigrok::Device>, std::string> > &devices,
+ const std::list< std::shared_ptr<sigrok::Device> > &devices,
shared_ptr<Device> selected)
{
int selected_index = -1;
device_selector_.clear();
- for (auto entry : devices) {
- auto device = entry.first;
- auto display_name = entry.second;
-
+ for (auto device : devices) {
assert(device);
+ string display_name =
+ session_.device_manager().get_display_name(device);
+
if (selected == device)
selected_index = device_selector_.count();
SamplingBar(Session &session, pv::MainWindow &main_window);
void set_device_list(
- const std::list< std::pair<std::shared_ptr<sigrok::Device>, std::string> > &devices,
+ const std::list< std::shared_ptr<sigrok::Device> > &devices,
std::shared_ptr<sigrok::Device> selected);
std::shared_ptr<sigrok::Device> get_selected_device() const;