projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove redundant isNull() check - isEmpty is a superset of isNull
[pulseview.git]
/
pv
/
session.cpp
diff --git
a/pv/session.cpp
b/pv/session.cpp
index 245889d65488e5c54f41eff9f9e4664c26b98c41..e412f501bdf8a59c846994c1fa62ee0bf788585d 100644
(file)
--- a/
pv/session.cpp
+++ b/
pv/session.cpp
@@
-525,7
+525,9
@@
Session::input_format_options(vector<string> user_spec,
return result;
}
return result;
}
-void Session::load_init_file(const string &file_name, const string &format)
+void Session::load_init_file(const string &file_name,
+ const string &format,
+ const string &setup_file_name)
{
shared_ptr<InputFormat> input_format;
map<string, Glib::VariantBase> input_opts;
{
shared_ptr<InputFormat> input_format;
map<string, Glib::VariantBase> input_opts;
@@
-549,10
+551,13
@@
void Session::load_init_file(const string &file_name, const string &format)
input_format->options());
}
input_format->options());
}
- load_file(QString::fromStdString(file_name), input_format, input_opts);
+ load_file(QString::fromStdString(file_name),
+ QString::fromStdString(setup_file_name),
+ input_format, input_opts);
}
void Session::load_file(QString file_name,
}
void Session::load_file(QString file_name,
+ QString setup_file_name,
shared_ptr<sigrok::InputFormat> format,
const map<string, Glib::VariantBase> &options)
{
shared_ptr<sigrok::InputFormat> format,
const map<string, Glib::VariantBase> &options)
{
@@
-582,10
+587,13
@@
void Session::load_file(QString file_name,
return;
}
return;
}
+ // Default the setup filename with a .pvs extension if none is provided
+ if (setup_file_name.isEmpty()) {
+ setup_file_name = file_name;
+ setup_file_name.truncate(setup_file_name.lastIndexOf('.'));
+ setup_file_name.append(".pvs");
+ }
// Auto-load the setup if one exists
// Auto-load the setup if one exists
- QString setup_file_name = file_name;
- setup_file_name.truncate(setup_file_name.lastIndexOf('.'));
- setup_file_name.append(".pvs");
if (QFileInfo::exists(setup_file_name) && QFileInfo(setup_file_name).isReadable()) {
QSettings settings_storage(setup_file_name, QSettings::IniFormat);
restore_setup(settings_storage);
if (QFileInfo::exists(setup_file_name) && QFileInfo(setup_file_name).isReadable()) {
QSettings settings_storage(setup_file_name, QSettings::IniFormat);
restore_setup(settings_storage);