projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: quit on SIGINT
[pulseview.git]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index a7ab89fbf7422ada41d7050ac57715ce33f7f05d..54a69fd75550eb3485861bd471d27f6e2d6497a7 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-34,6
+34,8
@@
extern "C" {
#include "config.h"
#include "config.h"
+// Global pointer to our QApplication
+QApplication *g_app = NULL;
void usage()
{
fprintf(stderr,
void usage()
{
fprintf(stderr,
@@
-52,10
+54,11
@@
void usage()
void sigint(int param)
{
(void) param;
void sigint(int param)
{
(void) param;
-
+
qDebug("pv: Recieved SIGINT");
qDebug("pv: Recieved SIGINT");
-
- /* TODO: Handle SIGINT */
+
+ if (g_app)
+ g_app->quit();
}
int main(int argc, char *argv[])
}
int main(int argc, char *argv[])
@@
-67,6
+70,8
@@
int main(int argc, char *argv[])
signal (SIGINT, sigint);
QApplication a(argc, argv);
signal (SIGINT, sigint);
QApplication a(argc, argv);
+ // Now we have an application to populate our global pointer
+ g_app = &a;
// Set some application metadata
QApplication::setApplicationVersion(PV_VERSION_STRING);
// Set some application metadata
QApplication::setApplicationVersion(PV_VERSION_STRING);