From edc1a9d72bffa047b2583f4d5f8d97f8a9eb24ee Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 25 Jun 2020 10:33:02 -0400 Subject: [PATCH] feat: appname --- lib/include/DOtherSide/DOtherSide.h | 2 +- lib/src/DOtherSide.cpp | 5 ++--- test/test_dotherside.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/include/DOtherSide/DOtherSide.h b/lib/include/DOtherSide/DOtherSide.h index 187af0d..63d169f 100644 --- a/lib/include/DOtherSide/DOtherSide.h +++ b/lib/include/DOtherSide/DOtherSide.h @@ -86,7 +86,7 @@ DOS_API void DOS_CALL dos_qguiapplication_delete(void); /// \brief Create a QApplication /// \note The created QApplication should be freed by calling dos_qapplication_delete() -DOS_API void DOS_CALL dos_qapplication_create(void); +DOS_API void DOS_CALL dos_qapplication_create(char *filename); /// \brief Calls the QApplication::exec() function of the current QGuiApplication /// \note A QApplication should have been already created through dos_qapplication_create() diff --git a/lib/src/DOtherSide.cpp b/lib/src/DOtherSide.cpp index b19bd5b..8addf4a 100644 --- a/lib/src/DOtherSide.cpp +++ b/lib/src/DOtherSide.cpp @@ -101,11 +101,10 @@ void dos_qguiapplication_quit() qGuiApp->quit(); } -void dos_qapplication_create() +void dos_qapplication_create(char *appName) { static int argc = 1; - static char empty[1] = {0}; - static char *argv[] = {empty}; + static char *argv[] = {appName}; register_meta_types(); diff --git a/test/test_dotherside.cpp b/test/test_dotherside.cpp index 7ae79b3..27a5608 100644 --- a/test/test_dotherside.cpp +++ b/test/test_dotherside.cpp @@ -75,7 +75,7 @@ private slots: void testExecution() { bool quit = false; - dos_qapplication_create(); + dos_qapplication_create("test"); QTimer::singleShot(100, [&quit]() { quit = true; dos_qapplication_quit();