projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1325ce4
)
Fix #1203 by catching the boost exception thrown on error
author
Soeren Apel
<soeren@apelpie.net>
Sat, 26 May 2018 18:49:37 +0000
(20:49 +0200)
committer
Soeren Apel
<soeren@apelpie.net>
Sat, 26 May 2018 18:49:37 +0000
(20:49 +0200)
pv/views/trace/view.cpp
patch
|
blob
|
history
diff --git
a/pv/views/trace/view.cpp
b/pv/views/trace/view.cpp
index 861eac0f6065e7f4ef93c7e14039173dd9ad0235..8eb3b8dedcd7388555e4574ae4d79501a6a512b6 100644
(file)
--- a/
pv/views/trace/view.cpp
+++ b/
pv/views/trace/view.cpp
@@
-367,10
+367,13
@@
void View::restore_settings(QSettings &settings)
stringstream ss;
ss << settings.value("ruler_shift").toString().toStdString();
stringstream ss;
ss << settings.value("ruler_shift").toString().toStdString();
- boost::archive::text_iarchive ia(ss);
- ia >> boost::serialization::make_nvp("ruler_shift", shift);
-
- ruler_shift_ = shift;
+ try {
+ boost::archive::text_iarchive ia(ss);
+ ia >> boost::serialization::make_nvp("ruler_shift", shift);
+ ruler_shift_ = shift;
+ } catch (boost::archive::archive_exception) {
+ qDebug() << "Could not restore the view ruler shift";
+ }
}
if (settings.contains("offset")) {
}
if (settings.contains("offset")) {
@@
-378,11
+381,14
@@
void View::restore_settings(QSettings &settings)
stringstream ss;
ss << settings.value("offset").toString().toStdString();
stringstream ss;
ss << settings.value("offset").toString().toStdString();
- boost::archive::text_iarchive ia(ss);
- ia >> boost::serialization::make_nvp("offset", offset);
-
- // This also updates ruler_offset_
- set_offset(offset);
+ try {
+ boost::archive::text_iarchive ia(ss);
+ ia >> boost::serialization::make_nvp("offset", offset);
+ // This also updates ruler_offset_
+ set_offset(offset);
+ } catch (boost::archive::archive_exception) {
+ qDebug() << "Could not restore the view offset";
+ }
}
if (settings.contains("splitter_state"))
}
if (settings.contains("splitter_state"))