mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 05:32:31 +00:00
* Changing priority of a directory changes the priority for all files
within that directory. * Removed a buggy hack in FileListIterator::operator++(). * Cleaned up display of file sizes. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@835 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -93,7 +93,6 @@ public:
|
||||
void print_char(const chtype ch) { waddch(m_window, ch); }
|
||||
void print_char(unsigned int x, unsigned int y, const chtype ch) { mvwaddch(m_window, y, x, ch); }
|
||||
|
||||
void set_attr(int attr, int color) { wattr_set(m_window, attr, color, NULL); }
|
||||
void set_attr(unsigned int x, unsigned int y, unsigned int n, int attr, int color) { mvwchgat(m_window, y, x, n, attr, color, NULL); }
|
||||
|
||||
// Initialize stdscr.
|
||||
|
||||
@@ -82,14 +82,14 @@ TextElementValueBase::print(char* first, char* last, Canvas::attributes_list* at
|
||||
|
||||
} else if (m_flags & flag_xb) {
|
||||
|
||||
if (val < (int64_t(1) << 20))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f Kb", (double)val / (int64_t(1) << 10)), 0);
|
||||
else if (val < (int64_t(1) << 30))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f Mb", (double)val / (int64_t(1) << 20)), 0);
|
||||
else if (val < (int64_t(1) << 40))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f Gb", (double)val / (int64_t(1) << 30)), 0);
|
||||
if (val < (int64_t(1000) << 10))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f KB", (double)val / (int64_t(1) << 10)), 0);
|
||||
else if (val < (int64_t(1000) << 20))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f MB", (double)val / (int64_t(1) << 20)), 0);
|
||||
else if (val < (int64_t(1000) << 30))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f GB", (double)val / (int64_t(1) << 30)), 0);
|
||||
else
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f Tb", (double)val / (int64_t(1) << 40)), 0);
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f TB", (double)val / (int64_t(1) << 40)), 0);
|
||||
|
||||
} else if (m_flags & flag_timer) {
|
||||
if (val == 0)
|
||||
|
||||
@@ -114,22 +114,16 @@ WindowFileList::redraw() {
|
||||
|
||||
int64_t val = e->size_bytes();
|
||||
|
||||
if (val < (int64_t(1) << 30))
|
||||
m_canvas->print(8, pos, "%5.1fMb", (double)val / (int64_t(1) << 20));
|
||||
else if (val < (int64_t(1) << 40))
|
||||
m_canvas->print(8, pos, "%5.1fGb", (double)val / (int64_t(1) << 30));
|
||||
if (val < (int64_t(1000) << 20))
|
||||
m_canvas->print(8, pos, "%5.1f M", (double)val / (int64_t(1) << 20));
|
||||
else if (val < (int64_t(1000) << 30))
|
||||
m_canvas->print(8, pos, "%5.1f G", (double)val / (int64_t(1) << 30));
|
||||
else
|
||||
m_canvas->print(8, pos, "%5.1fTb", (double)val / (int64_t(1) << 40));
|
||||
m_canvas->print(8, pos, "%5.1f T", (double)val / (int64_t(1) << 40));
|
||||
|
||||
m_canvas->print(16 + itr.depth(), pos, "| %s",
|
||||
itr.depth() < (*itr)->path()->size() ? (*itr)->path()->at(itr.depth()).c_str() : "UNKNOWN");
|
||||
|
||||
// %6.1f %s %3d %9s",
|
||||
// (double)e->size_bytes() / (double)(1 << 20),
|
||||
// priority.c_str(),
|
||||
// done_percentage(e),
|
||||
// e->path()->encoding().c_str());
|
||||
|
||||
// m_canvas->print(104, pos, "%i - %i %c%c %u %u",
|
||||
// e->range().first,
|
||||
// e->range().first != e->range().second ? (e->range().second - 1) : e->range().second,
|
||||
|
||||
Reference in New Issue
Block a user