mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-13 05:37:42 +02:00
@ -179,7 +179,7 @@ class Task : public QObject, public QRunnable {
|
|||||||
protected slots:
|
protected slots:
|
||||||
//! The Task subclass must call this method when the task has succeeded
|
//! The Task subclass must call this method when the task has succeeded
|
||||||
virtual void emitSucceeded();
|
virtual void emitSucceeded();
|
||||||
//! **The Task subclass** must call this method when the task has succeeded. External code should call abort() instead.
|
//! **The Task subclass** must call this method when the task has aborted. External code should call abort() instead.
|
||||||
virtual void emitAborted();
|
virtual void emitAborted();
|
||||||
//! The Task subclass must call this method when the task has failed
|
//! The Task subclass must call this method when the task has failed
|
||||||
virtual void emitFailed(QString reason = "");
|
virtual void emitFailed(QString reason = "");
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QFutureWatcher>
|
|
||||||
#include <tasks/ConcurrentTask.h>
|
#include <tasks/ConcurrentTask.h>
|
||||||
|
|
||||||
static const int COLUMN_COUNT = 3; // 3 , TBD: latency and other nice things.
|
static const int COLUMN_COUNT = 3; // 3 , TBD: latency and other nice things.
|
||||||
@ -469,8 +468,9 @@ class ServersModel : public QAbstractListModel {
|
|||||||
currentQueryTask->addTask(Task::Ptr(task));
|
currentQueryTask->addTask(Task::Ptr(task));
|
||||||
|
|
||||||
// Update the model when the task is done
|
// Update the model when the task is done
|
||||||
connect(task, &Task::finished, this, [this, task, row, &server]() {
|
connect(task, &Task::finished, this, [this, task, row]() {
|
||||||
server.m_currentPlayers = task->m_outputOnlinePlayers;
|
if (m_servers.size() < row) return;
|
||||||
|
m_servers[row].m_currentPlayers = task->m_outputOnlinePlayers;
|
||||||
emit dataChanged(index(row, 0), index(row, COLUMN_COUNT - 1));
|
emit dataChanged(index(row, 0), index(row, COLUMN_COUNT - 1));
|
||||||
});
|
});
|
||||||
row++;
|
row++;
|
||||||
|
Reference in New Issue
Block a user