fix return code

This commit is contained in:
Patrick von Reth 2014-08-12 18:30:46 +02:00
parent 7e36686d1a
commit 3711a37786
1 changed files with 7 additions and 6 deletions

View File

@ -70,15 +70,16 @@ int main ( int argc, char *argv[] )
core.broadcastNotification(n);
int returnCode = -1;
app.connect(&core, &SnoreCore::notificationClosed, [&returnCode,&parser](Notification noti){
if(!parser.isSet(silent))
{
app.connect(&core, &SnoreCore::notificationClosed, [&returnCode](Notification noti){
QString reason;
QDebug(&reason) << noti.closeReason();
std::cout << qPrintable(reason) << std::endl;
}
returnCode = noti.closeReason();
});
}
app.connect(&core, &SnoreCore::notificationClosed, &app, &QApplication::quit);
app.exec();
return returnCode;