From: Daniel Elstner Date: Thu, 1 Oct 2015 12:59:03 +0000 (+0200) Subject: android: Check for firmware in standard locations, too X-Git-Tag: pulseview-0.3.0~107 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=059599e8fd59e4439cc1b29ab92f79abcf2487ea;p=pulseview.git android: Check for firmware in standard locations, too --- diff --git a/android/assetreader.cpp b/android/assetreader.cpp index bf76704a..f14e7b65 100644 --- a/android/assetreader.cpp +++ b/android/assetreader.cpp @@ -22,6 +22,7 @@ #include #include #include +#include using namespace pv; @@ -31,7 +32,11 @@ AndroidAssetReader::~AndroidAssetReader() void AndroidAssetReader::open(struct sr_resource *res, std::string name) { if (res->type == SR_RESOURCE_FIRMWARE) { - const auto path = QString::fromStdString("assets:/sigrok-firmware/" + name); + auto path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, + QString::fromStdString("sigrok-firmware/" + name)); + if (path.isEmpty()) + path = QString::fromStdString("assets:/sigrok-firmware/" + name); + std::unique_ptr file {new QFile{path}}; if (!file->open(QIODevice::ReadOnly))