From 3711a37786772de13152f9515f6e1e612c72f87d Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 12 Aug 2014 18:30:46 +0200 Subject: [PATCH] fix return code --- src/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f01d1e9..723ff6e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,15 +70,16 @@ int main ( int argc, char *argv[] ) core.broadcastNotification(n); int returnCode = -1; - if(!parser.isSet(silent)) - { - app.connect(&core, &SnoreCore::notificationClosed, [&returnCode](Notification noti){ + + app.connect(&core, &SnoreCore::notificationClosed, [&returnCode,&parser](Notification noti){ + if(!parser.isSet(silent)) + { QString reason; QDebug(&reason) << noti.closeReason(); std::cout << qPrintable(reason) << std::endl; - returnCode = noti.closeReason(); - }); - } + } + returnCode = noti.closeReason(); + }); app.connect(&core, &SnoreCore::notificationClosed, &app, &QApplication::quit); app.exec(); return returnCode;