mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 15:45:04 -04:00
*redesign of dwl queue - dwls will be enqueued and picked from there;
*changes to display the dwl queue in the transfers dialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1447 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fdfc02a1c1
commit
e68d874406
9 changed files with 201 additions and 142 deletions
|
@ -14,32 +14,31 @@
|
|||
#include <list>
|
||||
#include <string>
|
||||
|
||||
enum DwlPriority { Low = 0, Normal, High, Auto };
|
||||
|
||||
/* class which encapsulates download details */
|
||||
class DwlDetails {
|
||||
public:
|
||||
DwlDetails() { return; }
|
||||
DwlDetails(std::string fname, std::string hash, int count, std::string dest,
|
||||
uint32_t flags, std::list<std::string> srcIds, DwlPriority priority)
|
||||
: fname(fname), hash(hash), count(count), dest(dest), flags(flags),
|
||||
srcIds(srcIds), retries(0), priority(priority), paused(false) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* download details */
|
||||
std::string fname;
|
||||
std::string hash;
|
||||
int count;
|
||||
std::string dest;
|
||||
uint32_t flags;
|
||||
std::list<std::string> srcIds;
|
||||
unsigned int retries;
|
||||
|
||||
/* internally used in download queue */
|
||||
DwlPriority priority;
|
||||
bool paused;
|
||||
};
|
||||
//enum DwlPriority { Low = 0, Normal, High, Auto };
|
||||
//
|
||||
///* class which encapsulates download details */
|
||||
//class DwlDetails {
|
||||
//public:
|
||||
// DwlDetails() { return; }
|
||||
// DwlDetails(std::string fname, std::string hash, int count, std::string dest,
|
||||
// uint32_t flags, std::list<std::string> srcIds, DwlPriority priority)
|
||||
// : fname(fname), hash(hash), count(count), dest(dest), flags(flags),
|
||||
// srcIds(srcIds), priority(priority), retries(0) { return; }
|
||||
//
|
||||
// /* download details */
|
||||
// std::string fname;
|
||||
// std::string hash;
|
||||
// int count;
|
||||
// std::string dest;
|
||||
// uint32_t flags;
|
||||
// std::list<std::string> srcIds;
|
||||
//
|
||||
// /* internally used in download queue */
|
||||
// DwlPriority priority;
|
||||
//
|
||||
// /* how many times a failed dwl will be requeued */
|
||||
// unsigned int retries;
|
||||
//};
|
||||
|
||||
/* comparator class used when sorting list */
|
||||
class PriorityCompare {
|
||||
|
@ -89,6 +88,7 @@ public:
|
|||
virtual bool getPriority(const std::string hash, DwlPriority & priority);
|
||||
virtual bool clearDownload(const std::string hash);
|
||||
virtual void clearQueue();
|
||||
virtual void getDwlDetails(std::list<DwlDetails> & details);
|
||||
|
||||
private:
|
||||
unsigned int downloadLimit;
|
||||
|
@ -99,7 +99,6 @@ private:
|
|||
RsMutex prmtx;
|
||||
std::list<DwlDetails> priorities;
|
||||
|
||||
unsigned int totalQueuedDwl();
|
||||
unsigned int totalSystemDwl();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue