kdeconnect-kde/plugins/sftp/mountloop.cpp

36 lines
580 B
C++
Raw Normal View History

2014-01-21 19:49:50 +00:00
/**
* SPDX-FileCopyrightText: 2014 Samoilenko Yuri <kinnalru@gmail.com>
2014-01-21 19:49:50 +00:00
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
2014-01-21 19:49:50 +00:00
*/
#include "mountloop.h"
MountLoop::MountLoop()
: QEventLoop()
{
}
2014-01-21 19:49:50 +00:00
bool MountLoop::exec(QEventLoop::ProcessEventsFlags flags)
{
return QEventLoop::exec(flags) == 0;
}
void MountLoop::failed()
{
2018-11-06 22:29:39 +00:00
Q_EMIT result(false);
2014-01-21 19:49:50 +00:00
exit(1);
}
2020-08-06 12:51:31 +01:00
void MountLoop::succeeded()
2014-01-21 19:49:50 +00:00
{
2018-11-06 22:29:39 +00:00
Q_EMIT result(true);
2014-01-21 19:49:50 +00:00
exit(0);
}
void MountLoop::exitWith(bool status)
{
2018-11-06 22:29:39 +00:00
Q_EMIT result(status);
2014-01-21 19:49:50 +00:00
exit(status ? 0 : 1);
}