Exit even loop if KAuth job finishes with error.

This commit is contained in:
Andrius Štikonas 2018-03-28 02:15:46 +01:00
parent e3aae714a2
commit 9218b55c57
1 changed files with 1 additions and 0 deletions

View File

@ -78,6 +78,7 @@ void CoreBackendManager::startExternalCommandHelper()
QEventLoop loop;
auto exitLoop = [&] () {loop.exit();};
auto conn = QObject::connect(job(), &KAuth::ExecuteJob::newData, exitLoop);
QObject::connect(job(), &KJob::finished, [=] () { if(job()->error()) exitLoop(); } );
loop.exec();
QObject::disconnect(conn);