]> sigrok.org Git - pulseview.git/commitdiff
Style fixes
authorSoeren Apel <redacted>
Mon, 22 Apr 2019 13:39:13 +0000 (15:39 +0200)
committerSoeren Apel <redacted>
Mon, 22 Apr 2019 13:39:13 +0000 (15:39 +0200)
main.cpp
pv/mainwindow.cpp
pv/mainwindow.hpp
pv/session.cpp
pv/session.hpp
pv/toolbars/mainbar.cpp

index 1e4fe577dc11328b4b07167b3ce1c42d16fdd075..4bbddcc644bdf4c5bbb7ebf6398ed8e58da75b16 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -340,8 +340,7 @@ int main(int argc, char *argv[])
                                w.add_default_session();
                        else
                                for (string& open_file : open_files)
-                                       w.add_session_with_file(open_file, open_file_format,
-                                               open_setup_file);
+                                       w.add_session_with_file(open_file, open_file_format, open_setup_file);
 
 #ifdef ENABLE_SIGNALS
                        if (SignalHandler::prepare_signals()) {
index 638d75b5179fbb63c2e0151d6c6d09ff215b95c5..fb749f5701724e37be0fffae8d55c3edd3d22a7e 100644 (file)
@@ -399,13 +399,10 @@ void MainWindow::remove_session(shared_ptr<Session> session)
 }
 
 void MainWindow::add_session_with_file(string open_file_name,
-       string open_file_format,
-       string open_setup_file_name)
+       string open_file_format, string open_setup_file_name)
 {
        shared_ptr<Session> session = add_session();
-       session->load_init_file(open_file_name,
-               open_file_format,
-               open_setup_file_name);
+       session->load_init_file(open_file_name, open_file_format, open_setup_file_name);
 }
 
 void MainWindow::add_default_session()
index bf8be0ade1caa3b40caa765c721ebd71bcffc8ca..92fba45f622a93d96337d0937fd0248a62a0435f 100644 (file)
@@ -92,8 +92,7 @@ public:
 
        void remove_session(shared_ptr<Session> session);
 
-       void add_session_with_file(string open_file_name,
-               string open_file_format,
+       void add_session_with_file(string open_file_name, string open_file_format,
                string open_setup_file_name);
 
        void add_default_session();
index e412f501bdf8a59c846994c1fa62ee0bf788585d..c2fd21498b248f36086580466ccf2356bd64bc87 100644 (file)
@@ -526,8 +526,7 @@ Session::input_format_options(vector<string> user_spec,
 }
 
 void Session::load_init_file(const string &file_name,
-       const string &format,
-       const string &setup_file_name)
+       const string &format, const string &setup_file_name)
 {
        shared_ptr<InputFormat> input_format;
        map<string, Glib::VariantBase> input_opts;
@@ -551,15 +550,12 @@ void Session::load_init_file(const string &file_name,
                        input_format->options());
        }
 
-       load_file(QString::fromStdString(file_name),
-               QString::fromStdString(setup_file_name),
+       load_file(QString::fromStdString(file_name), QString::fromStdString(setup_file_name),
                input_format, input_opts);
 }
 
-void Session::load_file(QString file_name,
-       QString setup_file_name,
-       shared_ptr<sigrok::InputFormat> format,
-       const map<string, Glib::VariantBase> &options)
+void Session::load_file(QString file_name, QString setup_file_name,
+       shared_ptr<sigrok::InputFormat> format, const map<string, Glib::VariantBase> &options)
 {
        const QString errorMessage(
                QString("Failed to load file %1").arg(file_name));
@@ -587,13 +583,13 @@ void Session::load_file(QString file_name,
                return;
        }
 
-       // Default the setup filename with a .pvs extension if none is provided
+       // Use the input file with .pvs extension if no setup file was given
        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
+
        if (QFileInfo::exists(setup_file_name) && QFileInfo(setup_file_name).isReadable()) {
                QSettings settings_storage(setup_file_name, QSettings::IniFormat);
                restore_setup(settings_storage);
index 7d9375a7451f414b14975557f6c49a3705361171..211fe1b32fcf2bba13e1963bf5b67c9066cba0df 100644 (file)
@@ -172,12 +172,10 @@ public:
 
        void set_default_device();
 
-       void load_init_file(const string &file_name,
-               const string &format,
+       void load_init_file(const string &file_name, const string &format,
                const string &setup_file_name);
 
-       void load_file(QString file_name,
-               QString setup_file_name = nullptr,
+       void load_file(QString file_name, QString setup_file_name = QString(),
                shared_ptr<sigrok::InputFormat> format = nullptr,
                const map<string, Glib::VariantBase> &options =
                        map<string, Glib::VariantBase>());
index 026610233c131a5a74a1f6eec39c5e5eed2ff4ca..666c28d3049f7bd6b8a9ff7ccc35dc902b69814b 100644 (file)
@@ -705,7 +705,7 @@ void MainBar::import_file(shared_ptr<InputFormat> format)
                options = dlg.options();
        }
 
-       session_.load_file(file_name, nullptr, format, options);
+       session_.load_file(file_name, "", format, options);
 
        const QString abs_path = QFileInfo(file_name).absolutePath();
        settings.setValue(SettingOpenDirectory, abs_path);