mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Simplify app quitting implementation a bit
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "computermanager.h"
|
||||
#include "nvhttp.h"
|
||||
#include "settings/streamingpreferences.h"
|
||||
#include "streaming/session.h"
|
||||
|
||||
#include <Limelight.h>
|
||||
#include <QtEndian>
|
||||
@@ -479,11 +478,6 @@ void ComputerManager::quitRunningApp(NvComputer* computer)
|
||||
QThreadPool::globalInstance()->start(quit);
|
||||
}
|
||||
|
||||
void ComputerManager::quitRunningApp(Session *session)
|
||||
{
|
||||
quitRunningApp(session->getComputer());
|
||||
}
|
||||
|
||||
void ComputerManager::stopPollingAsync()
|
||||
{
|
||||
QWriteLocker lock(&m_Lock);
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include <QSettings>
|
||||
#include <QRunnable>
|
||||
|
||||
class Session;
|
||||
|
||||
class MdnsPendingComputer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -74,7 +72,6 @@ public:
|
||||
void pairHost(NvComputer* computer, QString pin);
|
||||
|
||||
void quitRunningApp(NvComputer* computer);
|
||||
Q_INVOKABLE void quitRunningApp(Session* session);
|
||||
|
||||
QVector<NvComputer*> getComputers();
|
||||
|
||||
|
||||
@@ -57,13 +57,8 @@ NvHTTP::getCurrentGame(QString serverInfo)
|
||||
// GFE 2.8 started keeping currentgame set to the last game played. As a result, it no longer
|
||||
// has the semantics that its name would indicate. To contain the effects of this change as much
|
||||
// as possible, we'll force the current game to zero if the server isn't in a streaming session.
|
||||
//
|
||||
// However, current game info must be available also in other states than just _SERVER_BUSY as
|
||||
// it is required for quitting currently running app. Quitting app occurs at end of stream if
|
||||
// configured so. At that point the server state may be in some other state than _SERVER_BUSY
|
||||
// for a short while, but that must not prevent quitting of the app.
|
||||
QString serverState = getXmlString(serverInfo, "state");
|
||||
if (serverState != nullptr && !serverState.endsWith("_SERVER_AVAILABLE"))
|
||||
if (serverState != nullptr && serverState.endsWith("_SERVER_BUSY"))
|
||||
{
|
||||
return getXmlString(serverInfo, "currentgame").toInt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user