projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix an isnan() issue on (at least) MinGW and Mac OS X.
[pulseview.git]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index 07d6dc3f8f7c308443c03032f967feea587b1b59..74d13fdc4af1b0eeb9e9b3d3e1d64169597b8dd9 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-23,22
+23,22
@@
#endif
#include <stdint.h>
#endif
#include <stdint.h>
-#include <libsigrok/libsigrok.h>
+#include <libsigrok/libsigrok.h
pp
>
#include <getopt.h>
#include <getopt.h>
-#include <QApplication>
#include <QDebug>
#ifdef ENABLE_SIGNALS
#include <QDebug>
#ifdef ENABLE_SIGNALS
-#include "signalhandler.h"
+#include "signalhandler.h
pp
"
#endif
#endif
-#include "pv/devicemanager.h"
-#include "pv/mainwindow.h"
+#include "pv/application.hpp"
+#include "pv/devicemanager.hpp"
+#include "pv/mainwindow.hpp"
#ifdef ANDROID
#include <libsigrokandroidutils/libsigrokandroidutils.h>
#ifdef ANDROID
#include <libsigrokandroidutils/libsigrokandroidutils.h>
-#include "android/loghandler.h"
+#include "android/loghandler.h
pp
"
#endif
#include "config.h"
#endif
#include "config.h"
@@
-65,15
+65,10
@@
void usage()
int main(int argc, char *argv[])
{
int ret = 0;
int main(int argc, char *argv[])
{
int ret = 0;
- st
ruct sr_context *sr_ctx = NULL
;
+ st
d::shared_ptr<sigrok::Context> context
;
const char *open_file = NULL;
const char *open_file = NULL;
- QApplication a(argc, argv);
-
- // Set some application metadata
- QApplication::setApplicationVersion(PV_VERSION_STRING);
- QApplication::setApplicationName("PulseView");
- QApplication::setOrganizationDomain("sigrok.org");
+ Application a(argc, argv);
#ifdef ANDROID
srau_init_environment();
#ifdef ANDROID
srau_init_environment();
@@
-98,7
+93,7
@@
int main(int argc, char *argv[])
case 'l':
{
const int loglevel = atoi(optarg);
case 'l':
{
const int loglevel = atoi(optarg);
-
sr_log_loglevel_set(loglevel
);
+
context->set_log_level(sigrok::LogLevel::get(loglevel)
);
#ifdef ENABLE_DECODE
srd_log_loglevel_set(loglevel);
#ifdef ENABLE_DECODE
srd_log_loglevel_set(loglevel);
@@
-126,10
+121,7
@@
int main(int argc, char *argv[])
open_file = argv[argc - 1];
// Initialise libsigrok
open_file = argv[argc - 1];
// Initialise libsigrok
- if (sr_init(&sr_ctx) != SR_OK) {
- qDebug() << "ERROR: libsigrok init failed.";
- return 1;
- }
+ context = sigrok::Context::create();
do {
do {
@@
-146,7
+138,7
@@
int main(int argc, char *argv[])
try {
// Create the device manager, initialise the drivers
try {
// Create the device manager, initialise the drivers
- pv::DeviceManager device_manager(
sr_ctx
);
+ pv::DeviceManager device_manager(
context
);
// Initialise the main window
pv::MainWindow w(device_manager, open_file);
// Initialise the main window
pv::MainWindow w(device_manager, open_file);
@@
-162,7
+154,7
@@
int main(int argc, char *argv[])
QObject::connect(handler,
SIGNAL(term_received()),
&w, SLOT(close()));
QObject::connect(handler,
SIGNAL(term_received()),
&w, SLOT(close()));
- } else {
+ } else {
qWarning() <<
"Could not prepare signal handler.";
}
qWarning() <<
"Could not prepare signal handler.";
}
@@
-182,9
+174,5
@@
int main(int argc, char *argv[])
} while (0);
} while (0);
- // Destroy libsigrok
- if (sr_ctx)
- sr_exit(sr_ctx);
-
return ret;
}
return ret;
}