From e912734c80a7b4398400bbda51567b55148594b3 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 23 Apr 2024 14:27:12 +0800 Subject: [PATCH] remove: load the device first time not by timer --- DSView/pv/mainwindow.cpp | 21 +++++++-------------- DSView/pv/mainwindow.h | 1 - 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 62b6c0b4..22e86f53 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -317,24 +317,17 @@ namespace pv } } - // Load the device after the view is ready. - connect(&_load_device_timer, SIGNAL(timeout()), this, SLOT(on_load_device_first())); - _load_device_timer.start(100); + on_load_device_first(); } void MainWindow::on_load_device_first() { - if (_view->view_is_ready()) - { - if (tmp_file != ""){ - on_load_file(tmp_file); - tmp_file = ""; - } - else{ - _session->set_default_device(); - } - - _load_device_timer.stop(); + if (tmp_file != ""){ + on_load_file(tmp_file); + tmp_file = ""; + } + else{ + _session->set_default_device(); } } diff --git a/DSView/pv/mainwindow.h b/DSView/pv/mainwindow.h index 116ee7b2..0415c1b2 100644 --- a/DSView/pv/mainwindow.h +++ b/DSView/pv/mainwindow.h @@ -244,7 +244,6 @@ private: int _key_value; bool _key_vaild; - QTimer _load_device_timer; }; } // namespace pv