Author: mir3x Date: Sun Nov 1 18:55:45 2015 New Revision: 30356 URL: http://svn.gna.org/viewcvs/freeciv?rev=30356&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: branches/S2_5/client/gui-qt/chatline.cpp Modified: branches/S2_5/client/gui-qt/chatline.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/chatline.cpp?rev=30356&r1=30355&r2=30356&view=diff ============================================================================== --- branches/S2_5/client/gui-qt/chatline.cpp (original) +++ branches/S2_5/client/gui-qt/chatline.cpp Sun Nov 1 18:55:45 2015 @@ -389,6 +389,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 + ")>"; @@ -419,6 +420,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