projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS: Add list of user-visible changes so far.
[pulseview.git]
/
android
/
assetreader.cpp
diff --git
a/android/assetreader.cpp
b/android/assetreader.cpp
index f14e7b65117933b5a153c0cf704e2af5dad191fb..71aafae5c46d784de3451f164b26f0775cc1beff 100644
(file)
--- a/
android/assetreader.cpp
+++ b/
android/assetreader.cpp
@@
-18,18
+18,21
@@
*/
#include "assetreader.hpp"
*/
#include "assetreader.hpp"
-#include <libsigrok/libsigrok.h>
+
#include <memory>
#include <memory>
+
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QStandardPaths>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QStandardPaths>
+#include <libsigrok/libsigrok.h>
+
using namespace pv;
using namespace pv;
-AndroidAssetReader::~AndroidAssetReader()
-{}
+using std::string;
+using std::unique_ptr;
-void AndroidAssetReader::open(struct sr_resource *res, st
d::st
ring name)
+void AndroidAssetReader::open(struct sr_resource *res, string name)
{
if (res->type == SR_RESOURCE_FIRMWARE) {
auto path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
{
if (res->type == SR_RESOURCE_FIRMWARE) {
auto path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
@@
-37,7
+40,7
@@
void AndroidAssetReader::open(struct sr_resource *res, std::string name)
if (path.isEmpty())
path = QString::fromStdString("assets:/sigrok-firmware/" + name);
if (path.isEmpty())
path = QString::fromStdString("assets:/sigrok-firmware/" + name);
-
std::
unique_ptr<QFile> file {new QFile{path}};
+ unique_ptr<QFile> file {new QFile{path}};
if (!file->open(QIODevice::ReadOnly))
throw sigrok::Error{SR_ERR};
if (!file->open(QIODevice::ReadOnly))
throw sigrok::Error{SR_ERR};
@@
-60,7
+63,7
@@
void AndroidAssetReader::close(struct sr_resource *res)
qCritical("AndroidAssetReader: Invalid handle");
throw sigrok::Error{SR_ERR_ARG};
}
qCritical("AndroidAssetReader: Invalid handle");
throw sigrok::Error{SR_ERR_ARG};
}
- const
std::
unique_ptr<QFile> file {static_cast<QFile*>(res->handle)};
+ const unique_ptr<QFile> file {static_cast<QFile*>(res->handle)};
res->handle = nullptr;
file->close();
res->handle = nullptr;
file->close();