diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2014-06-30 09:38:31 +0200 |
---|---|---|
committer | Sven Wegener <sven.wegener@stealer.net> | 2014-06-30 09:38:31 +0200 |
commit | 79de83205964ee0182940ef7cec86b46896ed0e6 (patch) | |
tree | ccf532205a550ac926e52069649a1cc41aa555a6 /DSLogic-gui/pv/devicemanager.cpp | |
parent | 3de7dbb24c71c0d894dbd734ddf9258683d9e2e1 (diff) |
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Diffstat (limited to 'DSLogic-gui/pv/devicemanager.cpp')
-rw-r--r-- | DSLogic-gui/pv/devicemanager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/DSLogic-gui/pv/devicemanager.cpp b/DSLogic-gui/pv/devicemanager.cpp index 4a17ca9..66e3500 100644 --- a/DSLogic-gui/pv/devicemanager.cpp +++ b/DSLogic-gui/pv/devicemanager.cpp @@ -29,12 +29,15 @@ #include <stdexcept> #include <string> +#include <QtGui/QApplication> #include <QObject> #include <QDebug> +#include <QDir> #include <libsigrok4DSLogic/libsigrok.h> using namespace std; +char config_path[256]; namespace pv { @@ -98,6 +101,15 @@ list<sr_dev_inst*> DeviceManager::driver_scan( // Release this driver and all it's attached devices release_driver(driver); + // Check If DSLogic driver + if (strcmp(driver->name, "DSLogic") == 0) { + QDir dir(QApplication::applicationDirPath()); + if (!dir.cd("res")) + return driver_devices; + std::string str = dir.absolutePath().toStdString() + "/"; + strcpy(config_path, str.c_str()); + } + // Do the scan GSList *const devices = sr_driver_scan(driver, drvopts); for (GSList *l = devices; l; l = l->next) |