X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Fsessionfile.cpp;h=e6920ff5e299a6a5b5e437b2768d3d020549f2e0;hp=687c52bdcd5a225a29d1cdfaeffac104b7c4c9a3;hb=4d6c6ea3e6b069787c270d4911083dae05eae4c6;hpb=b485408f20c39ae8d05372a5faffe15653c74705 diff --git a/pv/devices/sessionfile.cpp b/pv/devices/sessionfile.cpp index 687c52bd..e6920ff5 100644 --- a/pv/devices/sessionfile.cpp +++ b/pv/devices/sessionfile.cpp @@ -27,24 +27,24 @@ namespace pv { namespace devices { -SessionFile::SessionFile(const std::shared_ptr &context, +SessionFile::SessionFile(const std::shared_ptr context, const std::string &file_name) : - context_(context), - file_name_(file_name) { + File(file_name), + context_(context) { } -std::string SessionFile::full_name() const { - return boost::filesystem::path(file_name_).filename().string(); -} - -std::string SessionFile::display_name(const DeviceManager&) const { - return SessionFile::full_name(); -} +void SessionFile::open() { + if (session_) + close(); -void SessionFile::create() { session_ = context_->load_session(file_name_); device_ = session_->devices()[0]; } +void SessionFile::close() { + if (session_) + session_->remove_devices(); +} + } // namespace devices } // namespace pv