diff --git a/apps/browser/ServerModel.cpp b/apps/browser/ServerModel.cpp index 3ffd6f7f7..d2d340b75 100644 --- a/apps/browser/ServerModel.cpp +++ b/apps/browser/ServerModel.cpp @@ -131,7 +131,7 @@ bool ServerModel::setData(const QModelIndex &index, const QVariant &value, int r sd.SetPassword(value.toBool()); break; case ServerData::VERSION: - sd.SetVersion(value.toString().toLatin1()); + sd.SetVersion(value.toString().toUtf8()); ok = !sd.addr.isEmpty(); break; case ServerData::PLAYERS: @@ -141,14 +141,14 @@ bool ServerModel::setData(const QModelIndex &index, const QVariant &value, int r sd.SetMaxPlayers(value.toInt(&ok)); break; case ServerData::HOSTNAME: - sd.SetName(value.toString().toLatin1()); + sd.SetName(value.toString().toUtf8()); ok = !sd.addr.isEmpty(); break; case ServerData::PING: sd.ping = value.toInt(&ok); break; case ServerData::MODNAME: - sd.SetGameMode(value.toString().toLatin1()); + sd.SetGameMode(value.toString().toUtf8()); break; default: return false; @@ -165,9 +165,7 @@ bool ServerModel::insertRows(int position, int count, const QModelIndex &index) Q_UNUSED(index); beginInsertRows(QModelIndex(), position, position + count - 1); - for (int row = 0; row < count; ++row) { - myData.insert(position, {}); - } + myData.insert(position, count, {}); endInsertRows(); return true;