]> sigrok.org Git - pulseview.git/blobdiff - pv/device/file.cpp
Don't use Qt-defined keywords, they can cause problems with other headers.
[pulseview.git] / pv / device / file.cpp
index 190b53846bc08071d60df99cd1e759b070b060be..0286a2581471225fae43fa0ea4f793b23e1ee1af 100644 (file)
@@ -22,6 +22,8 @@
 #include "inputfile.h"
 #include "sessionfile.h"
 
+#include <boost/filesystem.hpp>
+
 #include <libsigrok/libsigrok.h>
 
 using std::string;
@@ -36,15 +38,15 @@ File::File(const std::string path) :
 
 std::string File::format_device_title() const
 {
-       return _path;
+       return boost::filesystem::path(_path).filename().string();
 }
 
 File* File::create(const string &name)
 {
-       if (sr_session_load(name.c_str()) == SR_OK) {
+       if (sr_session_load(name.c_str(), &SigSession::_sr_session) == SR_OK) {
                GSList *devlist = NULL;
-               sr_session_dev_list(&devlist);
-               sr_session_destroy();
+               sr_session_dev_list(SigSession::_sr_session, &devlist);
+               sr_session_destroy(SigSession::_sr_session);
 
                if (devlist) {
                        sr_dev_inst *const sdi = (sr_dev_inst*)devlist->data;