From: Joel Holdsworth Date: Sun, 12 Apr 2015 15:32:38 +0000 (+0100) Subject: Moved default device selection into MainWindow X-Git-Tag: pulseview-0.3.0~192 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=859ca3070b30afde85ac345e8761ebf3b10017b1;p=pulseview.git Moved default device selection into MainWindow --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 767ab6f3..eb567af8 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -194,7 +194,10 @@ void MainWindow::run_stop() void MainWindow::select_device(shared_ptr device) { try { - session_.set_device(device); + if (device) + session_.set_device(device); + else + session_.set_default_device(); } catch(const QString &e) { QMessageBox msg(this); msg.setText(e); @@ -540,10 +543,8 @@ void MainWindow::restore_ui_settings() const shared_ptr device = device_manager_.find_device_from_info(dev_info); - if (device) { - select_device(device); - update_device_list(); - } + select_device(device); + update_device_list(); settings.endGroup(); } diff --git a/pv/session.cpp b/pv/session.cpp index 08bec08e..d6fef9a7 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -90,7 +90,6 @@ Session::Session(DeviceManager &device_manager) : capture_state_(Stopped), cur_samplerate_(0) { - set_default_device(); } Session::~Session()