diff --git a/launcher/include/processwatcher.h b/launcher/include/processwatcher.h index 5f71790..ef5ded6 100644 --- a/launcher/include/processwatcher.h +++ b/launcher/include/processwatcher.h @@ -3,7 +3,6 @@ #pragma once -#include #include /// Listens and waits for a process to finish. @@ -11,7 +10,7 @@ class ProcessWatcher : public QObject { Q_OBJECT public: - explicit ProcessWatcher(const int PID); + explicit ProcessWatcher(qint64 PID, QObject *parent = nullptr); Q_SIGNALS: void finished(); diff --git a/launcher/src/processwatcher.cpp b/launcher/src/processwatcher.cpp index 69339f8..245943f 100644 --- a/launcher/src/processwatcher.cpp +++ b/launcher/src/processwatcher.cpp @@ -7,9 +7,10 @@ #include "moc_processwatcher.cpp" -ProcessWatcher::ProcessWatcher(const int PID) +ProcessWatcher::ProcessWatcher(const qint64 PID, QObject *parent) + : QObject(parent) { - m_timer = new QTimer(); + m_timer = new QTimer(this); connect(m_timer, &QTimer::timeout, this, [this, PID] { const auto info = KProcessList::processInfo(PID); // If we can't find the PID, bail! @@ -19,6 +20,6 @@ ProcessWatcher::ProcessWatcher(const int PID) Q_EMIT finished(); } }); - m_timer->setInterval(std::chrono::seconds(30)); + m_timer->setInterval(std::chrono::seconds(5)); m_timer->start(); } \ No newline at end of file