Author: mir3x Date: Sun Nov 1 18:56:10 2015 New Revision: 30358 URL: http://svn.gna.org/viewcvs/freeciv?rev=30358&view=rev Log: Changed all html tags <Yxx> in chat output (usually player nicknames were treated as html) to non-html tags [Yxx] if Y is uppercase letter in Qt-client.
See patch #6505 Modified: trunk/client/gui-qt/chatline.cpp Modified: trunk/client/gui-qt/chatline.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/chatline.cpp?rev=30358&r1=30357&r2=30358&view=diff ============================================================================== --- trunk/client/gui-qt/chatline.cpp (original) +++ trunk/client/gui-qt/chatline.cpp Sun Nov 1 18:56:10 2015 @@ -390,6 +390,7 @@ static QString replace_html(QString str) { QString s, s2; + int i, j; conn_list_iterate(game.all_connections, pconn){ s = pconn->username; s = "<(" + s + ")>"; @@ -420,6 +421,24 @@ str = str.replace(s, s2); } } players_iterate_end; + /* replace all <X...> where X is uppercase letter + * with [X ....], its definitely message from server + * not html tag */ + j = 0; + while (1) { + QChar c; + i = str.indexOf('<', j); + j = str.indexOf('>', i); + if (i + 1 >= str.length() || i == -1 || j == -1) { + break; + } + c = str.at(i + 1); + if (c.isUpper()) { + str.replace(i, 1 , '['); + str.replace(j, 1 , ']'); + } + j++; + } return str; } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits