* Replaced the old File with the EntryListNode code, and cleaned it

up. The user now uses File* instead of File.

* Changed apply_low_diskspace to use
torrent::Download::free_diskspace() instead of the old file path hack.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@809 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-11-21 14:05:36 +00:00
parent 4819162ffa
commit e3f59ee9e4
4 changed files with 19 additions and 25 deletions
+12 -12
View File
@@ -98,9 +98,9 @@ WindowFileList::redraw() {
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, fl.size(), m_canvas->height() - pos);
while (range.first != range.second) {
torrent::File e = fl.get(range.first);
torrent::File* e = fl.get(range.first);
std::string path = e.path_str();
std::string path = e->path()->as_string();
if (path.length() <= 50)
path = path + std::string(50 - path.length(), ' ');
@@ -109,7 +109,7 @@ WindowFileList::redraw() {
std::string priority;
switch (e.priority()) {
switch (e->priority()) {
case torrent::PRIORITY_OFF:
priority = "off";
break;
@@ -130,16 +130,16 @@ WindowFileList::redraw() {
m_canvas->print(0, pos, "%c %s %6.1f %s %3d %9s",
range.first == *m_focus ? '*' : ' ',
path.c_str(),
(double)e.size_bytes() / (double)(1 << 20),
(double)e->size_bytes() / (double)(1 << 20),
priority.c_str(),
done_percentage(e),
e.path()->encoding().c_str());
e->path()->encoding().c_str());
m_canvas->print(84, pos, "%i - %i %c%c",
e.chunk_begin(),
e.chunk_begin() != e.chunk_end() ? (e.chunk_end() - 1) : e.chunk_end(),
e.is_created() ? 'E' : 'M',
e.is_correct_size() ? 'C' : 'W');
e->range().first,
e->range().first != e->range().second ? (e->range().second - 1) : e->range().second,
e->is_created() ? 'E' : 'M',
e->is_correct_size() ? 'C' : 'W');
++range.first;
++pos;
@@ -148,10 +148,10 @@ WindowFileList::redraw() {
}
int
WindowFileList::done_percentage(torrent::File& e) {
int chunks = e.chunk_end() - e.chunk_begin();
WindowFileList::done_percentage(torrent::File* e) {
int chunks = e->range().second - e->range().first;
return chunks ? (e.completed_chunks() * 100) / chunks : 100;
return chunks ? (e->completed_chunks() * 100) / chunks : 100;
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ public:
virtual void redraw();
private:
int done_percentage(torrent::File& e);
int done_percentage(torrent::File* e);
core::Download* m_download;