mirror of https://notabug.org/acetone/ircabot.git
weight KB and B
parent
8271895221
commit
2e4c48627d
|
@ -995,8 +995,17 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
|
||||||
if (yearIsOk and monthIsOk and dayIsOk) {
|
if (yearIsOk and monthIsOk and dayIsOk) {
|
||||||
nameOfDay = QLocale().standaloneDayName(dateOfDay.dayOfWeek());
|
nameOfDay = QLocale().standaloneDayName(dateOfDay.dayOfWeek());
|
||||||
}
|
}
|
||||||
auto logFileSize = QFile(fsPath.path() + global::slash + a +".txt").size();
|
auto logFileSizeBytes = QFile(fsPath.path() + global::slash + a +".txt").size();
|
||||||
replaceTag(onePoint, "POINT_CONTENT", "<b>" + a + "</b> (" + nameOfDay + ") " + QString::number(logFileSize) + " bytes");
|
auto logFileSizeinKb = logFileSizeBytes/1000;
|
||||||
|
QString logFileSizeString;
|
||||||
|
if (logFileSizeinKb != 0) {
|
||||||
|
logFileSizeString = QString::number(logFileSizeinKb)+"."+
|
||||||
|
QString::number((logFileSizeBytes - logFileSizeinKb*1000)/10)+
|
||||||
|
" KB";
|
||||||
|
} else {
|
||||||
|
logFileSizeString = QString::number(logFileSizeBytes)+" B";
|
||||||
|
}
|
||||||
|
replaceTag(onePoint, "POINT_CONTENT", "<b>" + a + "</b> (" + nameOfDay + ") " + logFileSizeString);
|
||||||
replaceTag(onePoint, "POINT_LINK", "/"+server+"/"+channel+"/"+year+"/"+month+"/"+a);
|
replaceTag(onePoint, "POINT_LINK", "/"+server+"/"+channel+"/"+year+"/"+month+"/"+a);
|
||||||
payloadBlock += onePoint;
|
payloadBlock += onePoint;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue