mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Fix important memory usage problem in log tab
This commit is contained in:
@@ -1692,25 +1692,25 @@ void QBtSession::addConsoleMessage(QString msg, QString) {
|
||||
emit newConsoleMessage(QDateTime::currentDateTime().toString("dd/MM/yyyy hh:mm:ss") + " - " + msg);
|
||||
#else
|
||||
void QBtSession::addConsoleMessage(QString msg, QColor color) {
|
||||
if(consoleMessages.size() > 100) {
|
||||
consoleMessages.removeLast();
|
||||
if(consoleMessages.size() > MAX_LOG_MESSAGES) {
|
||||
consoleMessages.removeFirst();
|
||||
}
|
||||
msg = "<font color='grey'>"+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + "</font> - <font color='" + color.name() + "'><i>" + msg + "</i></font>";
|
||||
consoleMessages.prepend(msg);
|
||||
consoleMessages.append(msg);
|
||||
emit newConsoleMessage(msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QBtSession::addPeerBanMessage(QString ip, bool from_ipfilter) {
|
||||
if(peerBanMessages.size() > 100) {
|
||||
peerBanMessages.removeLast();
|
||||
if(peerBanMessages.size() > MAX_LOG_MESSAGES) {
|
||||
peerBanMessages.removeFirst();
|
||||
}
|
||||
QString msg;
|
||||
if(from_ipfilter)
|
||||
msg = "<font color='grey'>" + QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + "</font> - " + tr("<font color='red'>%1</font> <i>was blocked due to your IP filter</i>", "x.y.z.w was blocked").arg(ip);
|
||||
else
|
||||
msg = "<font color='grey'>" + QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + "</font> - " + tr("<font color='red'>%1</font> <i>was banned due to corrupt pieces</i>", "x.y.z.w was banned").arg(ip);
|
||||
peerBanMessages.prepend(msg);
|
||||
peerBanMessages.append(msg);
|
||||
emit newBanMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user