11#include " lobby.h"
22
33#include " aoapplication.h"
4+ #include " aoutils.h"
45#include " demoserver.h"
56#include " gui_utils.h"
67#include " networkmanager.h"
@@ -568,13 +569,11 @@ void Lobby::check_for_updates()
568569 QVersionNumber current_version = QVersionNumber::fromString (ao_app->get_version_string ());
569570 QVersionNumber master_version = QVersionNumber::fromString (version);
570571
571- static QRegularExpression regexp_links (" \\ b(https?://\\ S+\\ .\\ S+)\\ b" );
572-
573572 if (current_version < master_version)
574573 {
575574 ui_game_version_lbl->setText (tr (" Version: %1 [OUTDATED]" ).arg (current_version.toString ()));
576575 setWindowTitle (tr (" [Your client is outdated]" ));
577- const QString download_url = QString ( " https://github.com/AttorneyOnline/AO2-Client/releases/latest" ). replace (regexp_links, " <a href=' \\ 1'> \\ 1</a> " );
576+ const QString download_url = AOUtils::convert_to_html ( QStringLiteral ( " https://github.com/AttorneyOnline/AO2-Client/releases/latest" ));
578577 const QString message = QString (" Your client is outdated!<br>Your Version: %1<br>Current Version: %2<br>Download the latest version at<br>%3" ).arg (current_version.toString (), master_version.toString (), download_url);
579578 QMessageBox::warning (this , " Your client is outdated!" , message);
580579 }
@@ -590,9 +589,7 @@ void Lobby::set_player_count(int players_online, int max_players)
590589void Lobby::set_server_description (const QString &server_description)
591590{
592591 ui_server_description_text->clear ();
593- static QRegularExpression regexp_links (" \\ b(https?://\\ S+\\ .\\ S+)\\ b" );
594- QString result = server_description.toHtmlEscaped ().replace (" \n " , " <br>" ).replace (regexp_links, " <a href='\\ 1'>\\ 1</a>" );
595- ui_server_description_text->insertHtml (result);
592+ ui_server_description_text->insertHtml (AOUtils::convert_to_html (server_description));
596593}
597594
598595Lobby::~Lobby ()
0 commit comments