save and load server description in favorites (#783)

This commit is contained in:
stonedDiscord 2022-06-06 20:03:00 +02:00 committed by GitHub
parent a545561343
commit 06db93bd0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -152,6 +152,7 @@ void AOApplication::add_favorite_server(int p_server)
l_favorite_ini.setValue("name", fav_server.name);
l_favorite_ini.setValue("address", fav_server.ip);
l_favorite_ini.setValue("port", fav_server.port);
l_favorite_ini.setValue("desc", fav_server.desc);
if (fav_server.socket_type == TCP) {
l_favorite_ini.setValue("protocol", "tcp");

View File

@ -256,6 +256,7 @@ QVector<server_type> AOApplication::read_serverlist_txt()
f_server.ip = l_favorite_ini.value("address", "127.0.0.1").toString();
f_server.port = l_favorite_ini.value("port", 27016).toInt();
f_server.name = l_favorite_ini.value("name", "Missing Name").toString();
f_server.desc = l_favorite_ini.value("desc", "No description").toString();
f_server.socket_type = to_connection_type.value(l_favorite_ini.value("protocol", "tcp").toString());
f_server_list.append(f_server);
l_favorite_ini.endGroup();