From 3a31b41edcbac0f06f5f4a784071130b30cf4728 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 8 May 2011 03:24:45 +0300 Subject: Add font cache size to /cacheinfo chat command. --- src/commandhandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 537d9645a..a20944ff2 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -1066,20 +1066,23 @@ void CommandHandler::handleCacheInfo(const std::string &args _UNUSED_, if (!cache) return; + int all = 0; debugChatTab->chatLog(_("font cache size")); std::string str; for (int f = 0; f < 256; f ++) { if (!cache[f].empty()) { + all += cache[f].size(); str += strprintf("%d: %u, ", f, static_cast(cache[f].size())); } } debugChatTab->chatLog(str); + debugChatTab->chatLog(strprintf("%s %d", _("Cache size:"), all)); #ifdef DEBUG_FONT_COUNTERS debugChatTab->chatLog(""); - debugChatTab->chatLog(_("Created: ") + toString(font->getCreateCounter())); - debugChatTab->chatLog(_("Deleted: ") + toString(font->getDeleteCounter())); + debugChatTab->chatLog(strprintf("%s %d", _("Created:"), font->getCreateCounter())); + debugChatTab->chatLog(strprintf("%s %d", _("Deleted:"), font->getDeleteCounter())); #endif } -- cgit v1.2.3-60-g2f50