diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h index 91ec06679..b5d9bec65 100644 --- a/launcher/tasks/Task.h +++ b/launcher/tasks/Task.h @@ -179,7 +179,7 @@ class Task : public QObject, public QRunnable { protected slots: //! The Task subclass must call this method when the task has succeeded 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(); //! The Task subclass must call this method when the task has failed virtual void emitFailed(QString reason = ""); diff --git a/launcher/ui/pages/instance/ServersPage.cpp b/launcher/ui/pages/instance/ServersPage.cpp index b6ca9fe07..f00821cbd 100644 --- a/launcher/ui/pages/instance/ServersPage.cpp +++ b/launcher/ui/pages/instance/ServersPage.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include 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)); // Update the model when the task is done - connect(task, &Task::finished, this, [this, task, row, &server]() { - server.m_currentPlayers = task->m_outputOnlinePlayers; + connect(task, &Task::finished, this, [this, task, row]() { + if (m_servers.size() < row) return; + m_servers[row].m_currentPlayers = task->m_outputOnlinePlayers; emit dataChanged(index(row, 0), index(row, COLUMN_COUNT - 1)); }); row++;