Revert "Create a timer to wait for system to free resources"

This reverts commit 2627d476f4.
This commit is contained in:
Andrius Štikonas 2019-09-26 23:47:34 +01:00
parent 467ea50aeb
commit 76ca72eccd
2 changed files with 2 additions and 12 deletions

View File

@ -119,12 +119,13 @@ void ExternalCommand::setup()
*/ */
bool ExternalCommand::start(int timeout) bool ExternalCommand::start(int timeout)
{ {
Q_UNUSED(timeout)
if (command().isEmpty()) if (command().isEmpty())
return false; return false;
if (!QDBusConnection::systemBus().isConnected()) { if (!QDBusConnection::systemBus().isConnected()) {
qWarning() << QDBusConnection::systemBus().lastError().message(); qWarning() << QDBusConnection::systemBus().lastError().message();
QTimer::singleShot(timeout, this, &ExternalCommand::quit);
return false; return false;
} }
@ -167,8 +168,6 @@ bool ExternalCommand::start(int timeout)
connect(watcher, &QDBusPendingCallWatcher::finished, exitLoop); connect(watcher, &QDBusPendingCallWatcher::finished, exitLoop);
loop.exec(); loop.exec();
QTimer::singleShot(timeout, this, &ExternalCommand::quit);
return rval; return rval;
} }
@ -340,12 +339,6 @@ void ExternalCommand::setExitCode(int i)
d->m_ExitCode = i; d->m_ExitCode = i;
} }
/**< Dummy function for QTimer when needed. */
void ExternalCommand::quit()
{
}
bool ExternalCommand::startHelper() bool ExternalCommand::startHelper()
{ {
if (!QDBusConnection::systemBus().isConnected()) { if (!QDBusConnection::systemBus().isConnected()) {

View File

@ -104,9 +104,6 @@ public:
void emitReport(const QVariantMap& report) { emit reportSignal(report); } void emitReport(const QVariantMap& report) { emit reportSignal(report); }
/**< Dummy function for QTimer when needed. */
void quit();
// KAuth // KAuth
/**< start ExternalCommand Helper */ /**< start ExternalCommand Helper */
bool startHelper(); bool startHelper();