From 01b9aee7788540c1d1a6b6520825de2b59eae1ab Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 9 Nov 2021 15:36:47 +0800 Subject: [PATCH] none --- DSView/pv/device/devinst.cpp | 4 ++-- DSView/pv/devicemanager.h | 3 --- DSView/pv/mainwindow.cpp | 5 +++-- DSView/pv/view/analogsignal.cpp | 1 - DSView/pv/view/devmode.cpp | 7 +++++-- DSView/pv/view/dsosignal.cpp | 8 ++------ DSView/pv/view/groupsignal.cpp | 3 +-- DSView/pv/view/header.cpp | 7 ++----- DSView/pv/view/lissajoustrace.cpp | 2 +- DSView/pv/view/ruler.cpp | 3 +-- DSView/pv/view/viewport.cpp | 3 +-- DSView/pv/view/viewstatus.cpp | 2 +- DSView/pv/view/xcursor.cpp | 4 +--- libsigrokdecode4DSL/srd.c | 2 +- 14 files changed, 21 insertions(+), 33 deletions(-) diff --git a/DSView/pv/device/devinst.cpp b/DSView/pv/device/devinst.cpp index b0bf7d5a..1fe1b2f4 100755 --- a/DSView/pv/device/devinst.cpp +++ b/DSView/pv/device/devinst.cpp @@ -214,8 +214,8 @@ bool DevInst::is_usable() } void DevInst::destroy(){ - release(); - delete this; + release(); + //delete this; //do not to destroy } } // device diff --git a/DSView/pv/devicemanager.h b/DSView/pv/devicemanager.h index 4862a455..79f3502d 100755 --- a/DSView/pv/devicemanager.h +++ b/DSView/pv/devicemanager.h @@ -29,9 +29,6 @@ #include #include #include - -#include - #include #include diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 5186f719..0ca0bc70 100755 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -599,8 +599,9 @@ void MainWindow::device_changed(bool close) _sampling_bar->set_sampling(false); _session->set_default_device(boost::bind(&MainWindow::session_error, this, QString(tr("Set Default Device failed")), _1)); - } - update_device_list(); + } + + update_device_list(); } void MainWindow::on_run_stop() diff --git a/DSView/pv/view/analogsignal.cpp b/DSView/pv/view/analogsignal.cpp index 0368932f..745834ad 100755 --- a/DSView/pv/view/analogsignal.cpp +++ b/DSView/pv/view/analogsignal.cpp @@ -30,7 +30,6 @@ #include "../view/view.h" #include "../device/devinst.h" -using namespace boost; using namespace std; #define byte(x) uint##x##_t diff --git a/DSView/pv/view/devmode.cpp b/DSView/pv/view/devmode.cpp index 9ca629b1..58b31fe5 100755 --- a/DSView/pv/view/devmode.cpp +++ b/DSView/pv/view/devmode.cpp @@ -35,6 +35,7 @@ #include #include #include "../config/appconfig.h" +#include "../ui/msgbox.h" namespace pv { @@ -196,8 +197,10 @@ void DevMode::on_close() DevInst *dev_inst = _session->get_device(); assert(dev_inst); - _session->close_file(dev_inst); - dev_changed(true); + if (MsgBox::Confirm("are you sure to close the device?")){ + _session->close_file(dev_inst); + dev_changed(true); + } } void DevMode::mousePressEvent(QMouseEvent *event) diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/pv/view/dsosignal.cpp index 3a33628e..f4d748ba 100755 --- a/DSView/pv/view/dsosignal.cpp +++ b/DSView/pv/view/dsosignal.cpp @@ -28,14 +28,10 @@ #include "pv/data/dsosnapshot.h" #include "view.h" #include "../sigsession.h" -#include "../device/devinst.h" - - - +#include "../device/devinst.h" #include #include - -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/groupsignal.cpp b/DSView/pv/view/groupsignal.cpp index 0c5870aa..898d455c 100755 --- a/DSView/pv/view/groupsignal.cpp +++ b/DSView/pv/view/groupsignal.cpp @@ -26,8 +26,7 @@ #include "pv/data/group.h" #include "pv/data/groupsnapshot.h" #include "view.h" - -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/header.cpp b/DSView/pv/view/header.cpp index e5244e67..3eecd685 100755 --- a/DSView/pv/view/header.cpp +++ b/DSView/pv/view/header.cpp @@ -34,9 +34,7 @@ #include "../device/devinst.h" #include - - - + #include #include #include @@ -45,8 +43,7 @@ #include #include #include - -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/lissajoustrace.cpp b/DSView/pv/view/lissajoustrace.cpp index 5e091820..81d8d33f 100755 --- a/DSView/pv/view/lissajoustrace.cpp +++ b/DSView/pv/view/lissajoustrace.cpp @@ -35,7 +35,7 @@ #include #include -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/ruler.cpp b/DSView/pv/view/ruler.cpp index 41b9a98c..100292c4 100755 --- a/DSView/pv/view/ruler.cpp +++ b/DSView/pv/view/ruler.cpp @@ -40,8 +40,7 @@ #include #include - -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp index 95a2ff46..fcd8baad 100755 --- a/DSView/pv/view/viewport.cpp +++ b/DSView/pv/view/viewport.cpp @@ -42,8 +42,7 @@ #include "../config/appconfig.h" #include "../dsvdef.h" - -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/viewstatus.cpp b/DSView/pv/view/viewstatus.cpp index cfad21d2..6ca30b86 100755 --- a/DSView/pv/view/viewstatus.cpp +++ b/DSView/pv/view/viewstatus.cpp @@ -34,7 +34,7 @@ #include "../view/trace.h" #include "../dialogs/dsomeasure.h" -using namespace boost; + using namespace std; namespace pv { diff --git a/DSView/pv/view/xcursor.cpp b/DSView/pv/view/xcursor.cpp index decdc14c..1148dfb5 100755 --- a/DSView/pv/view/xcursor.cpp +++ b/DSView/pv/view/xcursor.cpp @@ -28,9 +28,7 @@ #include "dsosignal.h" #include - - -using namespace boost; + using namespace std; namespace pv { diff --git a/libsigrokdecode4DSL/srd.c b/libsigrokdecode4DSL/srd.c index 6b2569d2..38bb803e 100755 --- a/libsigrokdecode4DSL/srd.c +++ b/libsigrokdecode4DSL/srd.c @@ -202,7 +202,7 @@ SRD_API int srd_init(const char *path) PyImport_AppendInittab("sigrokdecode", PyInit_sigrokdecode); /* Initialize the Python interpreter. */ - Py_InitializeEx(0); + Py_InitializeEx(0); /* Locations relative to the XDG system data directories. */ sys_datadirs = g_get_system_data_dirs();