Reorganized, moing stuff to src/utils subdir.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@290 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-19 17:27:29 +00:00
parent aa405810db
commit a5f23adc7b
22 changed files with 62 additions and 43 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
#include <stdexcept>
#include <algorithm>
#include "functional.h"
#include "utils/functional.h"
#include "canvas.h"
#include "manager.h"
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef RTORRENT_WINDOW_BASE_H
#define RTORRENT_WINDOW_BASE_H
#include "timer.h"
#include "utils/timer.h"
namespace display {
@@ -40,7 +40,7 @@ protected:
bool m_dynamic;
int m_minHeight;
Timer m_lastDraw;
utils::Timer m_lastDraw;
};
}
+2 -2
View File
@@ -14,10 +14,10 @@ WindowDownloadList::WindowDownloadList(DList* l, DList::iterator* f) :
void
WindowDownloadList::redraw() {
if (Timer::cache() - m_lastDraw < 1000000)
if (utils::Timer::cache() - m_lastDraw < 1000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
+2 -2
View File
@@ -15,10 +15,10 @@ WindowDownloadStatusbar::WindowDownloadStatusbar(core::Download* d) :
void
WindowDownloadStatusbar::redraw() {
if (Timer::cache() - m_lastDraw < 1000000)
if (utils::Timer::cache() - m_lastDraw < 1000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
+5 -5
View File
@@ -6,7 +6,7 @@
#include "core/http_queue.h"
#include "canvas.h"
#include "functional.h"
#include "utils/functional.h"
#include "window_http_queue.h"
namespace display {
@@ -22,10 +22,10 @@ WindowHttpQueue::WindowHttpQueue(core::HttpQueue* q) :
void
WindowHttpQueue::redraw() {
if (Timer::cache() - m_lastDraw < 1000000)
if (utils::Timer::cache() - m_lastDraw < 1000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
cleanup_list();
@@ -62,7 +62,7 @@ WindowHttpQueue::redraw() {
void
WindowHttpQueue::cleanup_list() {
for (Container::iterator itr = m_container.begin(); itr != m_container.end();)
if (itr->m_http == NULL && itr->m_timer < Timer::cache())
if (itr->m_http == NULL && itr->m_timer < utils::Timer::cache())
itr = m_container.erase(itr);
else
++itr;
@@ -112,7 +112,7 @@ WindowHttpQueue::receive_erase(core::CurlGet* h) {
throw std::logic_error("WindowHttpQueue::receive_erase(...) tried to remove an object we don't have");
itr->m_http = NULL;
itr->m_timer = Timer::cache() + 10000000;
itr->m_timer = utils::Timer::cache() + 10000000;
mark_dirty();
}
+1 -1
View File
@@ -32,7 +32,7 @@ private:
core::CurlGet* m_http;
std::string m_name;
Timer m_timer;
utils::Timer m_timer;
};
typedef std::list<Node> Container;
+1 -1
View File
@@ -18,7 +18,7 @@ WindowInput::redraw() {
if (!is_dirty())
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
m_canvas->print(0, 0, "> %s", m_input->c_str());
+5 -5
View File
@@ -4,7 +4,7 @@
#include "core/download.h"
#include "parse.h"
#include "utils/parse.h"
#include "canvas.h"
#include "window_peer_info.h"
@@ -19,15 +19,15 @@ WindowPeerInfo::WindowPeerInfo(core::Download* d, PList* l, PList::iterator* f)
void
WindowPeerInfo::redraw() {
if (Timer::cache() - m_lastDraw < 1000000)
if (utils::Timer::cache() - m_lastDraw < 1000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
int y = 0;
m_canvas->print(0, y++, "Hash: %s", escape_string(m_download->get_download().get_hash()).c_str());
m_canvas->print(0, y++, "Hash: %s", utils::escape_string(m_download->get_download().get_hash()).c_str());
m_canvas->print(0, y++, "Chunks: %u / %u * %u",
m_download->get_download().get_chunks_done(),
m_download->get_download().get_chunks_total(),
@@ -42,7 +42,7 @@ WindowPeerInfo::redraw() {
}
m_canvas->print(0, y++, "DNS: %s:%hu", (*m_focus)->get_dns().c_str(), (*m_focus)->get_port());
m_canvas->print(0, y++, "Id: %s" , escape_string((*m_focus)->get_id()).c_str());
m_canvas->print(0, y++, "Id: %s" , utils::escape_string((*m_focus)->get_id()).c_str());
m_canvas->print(0, y++, "Snubbed: %s", (*m_focus)->get_snubbed() ? "Yes" : "No");
m_canvas->print(0, y++, "Done: %i%", (*m_focus)->get_chunks_done());
+2 -2
View File
@@ -15,10 +15,10 @@ WindowPeerList::WindowPeerList(PList* l, PList::iterator* f) :
void
WindowPeerList::redraw() {
if (Timer::cache() - m_lastDraw < 1000000)
if (utils::Timer::cache() - m_lastDraw < 1000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
int x = 2;
+2 -2
View File
@@ -16,10 +16,10 @@ void
WindowStatusbar::redraw() {
m_counter++;
if (Timer::cache() - m_lastDraw < 10000000)
if (utils::Timer::cache() - m_lastDraw < 10000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
m_canvas->print(0, 0, "Throttle: %i Listen: %s:%i Handshakes: %i Select: %u",
+2 -2
View File
@@ -12,10 +12,10 @@ WindowTitle::WindowTitle(const std::string& s) :
void
WindowTitle::redraw() {
if (Timer::cache() - m_lastDraw < 10000000)
if (utils::Timer::cache() - m_lastDraw < 10000000)
return;
m_lastDraw = Timer::cache();
m_lastDraw = utils::Timer::cache();
m_canvas->erase();
m_canvas->print(std::max(0, (m_canvas->get_width() - (int)m_title.size()) / 2 - 4), 0,