mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
Cleanup of log time display.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@346 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <ctime>
|
||||
|
||||
#include "canvas.h"
|
||||
#include "utils.h"
|
||||
#include "window_log_complete.h"
|
||||
|
||||
namespace display {
|
||||
@@ -34,17 +35,10 @@ WindowLogComplete::redraw() {
|
||||
|
||||
m_canvas->print(std::max(0, (int)m_canvas->get_width() / 2 - 5), pos++, "*** Log ***");
|
||||
|
||||
for (core::Log::iterator itr = m_log->begin(), e = m_log->end(); itr != e && pos < m_canvas->get_height(); ++itr) {
|
||||
std::tm *t = std::localtime(&itr->first.tval().tv_sec);
|
||||
|
||||
if (t == NULL)
|
||||
m_canvas->print(0, pos++, "(time error) %s",
|
||||
itr->second.c_str());
|
||||
else
|
||||
m_canvas->print(0, pos++, "(%02i:%02i:%02i) %s",
|
||||
t->tm_hour, t->tm_min, t->tm_sec,
|
||||
itr->second.c_str());
|
||||
}
|
||||
for (core::Log::iterator itr = m_log->begin(), e = m_log->end(); itr != e && pos < m_canvas->get_height(); ++itr)
|
||||
m_canvas->print(0, pos++, "(%s) %s",
|
||||
print_hhmmss(itr->first).c_str(),
|
||||
itr->second.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user