projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added Ctrl-Q and Ctrl-W shortcuts.
[pulseview.git]
/
pv
/
devices
/
sessionfile.cpp
diff --git
a/pv/devices/sessionfile.cpp
b/pv/devices/sessionfile.cpp
index 687c52bdcd5a225a29d1cdfaeffac104b7c4c9a3..1e8c3acda039f3184e32e701972f16b7f5617bfd 100644
(file)
--- a/
pv/devices/sessionfile.cpp
+++ b/
pv/devices/sessionfile.cpp
@@
-14,8
+14,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <libsigrokcxx/libsigrokcxx.hpp>
*/
#include <libsigrokcxx/libsigrokcxx.hpp>
@@
-27,24
+26,27
@@
namespace pv {
namespace devices {
namespace pv {
namespace devices {
-SessionFile::SessionFile(const std::shared_ptr<sigrok::Context>
&
context,
+SessionFile::SessionFile(const std::shared_ptr<sigrok::Context> context,
const std::string &file_name) :
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];
}
session_ = context_->load_session(file_name_);
device_ = session_->devices()[0];
}
+void SessionFile::close()
+{
+ if (session_)
+ session_->remove_devices();
+}
+
} // namespace devices
} // namespace pv
} // namespace devices
} // namespace pv