mirror of
https://github.com/transmission/transmission
synced 2025-02-23 06:30:38 +00:00
rearrange the class' fields by size, saving a few bytes off each Peer and TrackerStat struct.
This commit is contained in:
parent
e6a64636a2
commit
996670c4f2
1 changed files with 49 additions and 48 deletions
97
qt/torrent.h
97
qt/torrent.h
|
@ -40,21 +40,21 @@ class QStyle;
|
||||||
|
|
||||||
struct Peer
|
struct Peer
|
||||||
{
|
{
|
||||||
QString address;
|
bool clientIsChoked;
|
||||||
QString clientName;
|
bool clientIsInterested;
|
||||||
bool clientIsChoked;
|
bool isDownloadingFrom;
|
||||||
bool clientIsInterested;
|
bool isEncrypted;
|
||||||
QString flagStr;
|
bool isIncoming;
|
||||||
bool isDownloadingFrom;
|
bool isUploadingTo;
|
||||||
bool isEncrypted;
|
bool peerIsChoked;
|
||||||
bool isIncoming;
|
bool peerIsInterested;
|
||||||
bool isUploadingTo;
|
QString address;
|
||||||
bool peerIsChoked;
|
QString clientName;
|
||||||
bool peerIsInterested;
|
QString flagStr;
|
||||||
int port;
|
int port;
|
||||||
double progress;
|
Speed rateToClient;
|
||||||
Speed rateToClient;
|
Speed rateToPeer;
|
||||||
Speed rateToPeer;
|
double progress;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<Peer> PeerList;
|
typedef QList<Peer> PeerList;
|
||||||
|
@ -63,32 +63,32 @@ Q_DECLARE_METATYPE(PeerList)
|
||||||
|
|
||||||
struct TrackerStat
|
struct TrackerStat
|
||||||
{
|
{
|
||||||
QString announce;
|
bool hasAnnounced;
|
||||||
int announceState;
|
bool hasScraped;
|
||||||
int downloadCount;
|
bool isBackup;
|
||||||
bool hasAnnounced;
|
bool lastAnnounceSucceeded;
|
||||||
bool hasScraped;
|
bool lastAnnounceTimedOut;
|
||||||
QString host;
|
bool lastScrapeSucceeded;
|
||||||
int id;
|
bool lastScrapeTimedOut;
|
||||||
bool isBackup;
|
int announceState;
|
||||||
int lastAnnouncePeerCount;
|
int downloadCount;
|
||||||
QString lastAnnounceResult;
|
int id;
|
||||||
int lastAnnounceStartTime;
|
int lastAnnouncePeerCount;
|
||||||
bool lastAnnounceSucceeded;
|
int lastAnnounceStartTime;
|
||||||
int lastAnnounceTime;
|
int lastAnnounceTime;
|
||||||
bool lastAnnounceTimedOut;
|
int lastScrapeStartTime;
|
||||||
QString lastScrapeResult;
|
int lastScrapeTime;
|
||||||
int lastScrapeStartTime;
|
int leecherCount;
|
||||||
bool lastScrapeSucceeded;
|
int nextAnnounceTime;
|
||||||
int lastScrapeTime;
|
int nextScrapeTime;
|
||||||
bool lastScrapeTimedOut;
|
int scrapeState;
|
||||||
int leecherCount;
|
int seederCount;
|
||||||
int nextAnnounceTime;
|
int tier;
|
||||||
int nextScrapeTime;
|
QString announce;
|
||||||
int scrapeState;
|
QString host;
|
||||||
int seederCount;
|
QString lastAnnounceResult;
|
||||||
int tier;
|
QString lastScrapeResult;
|
||||||
QPixmap getFavicon( ) const;
|
QPixmap getFavicon( ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<TrackerStat> TrackerStatsList;
|
typedef QList<TrackerStat> TrackerStatsList;
|
||||||
|
@ -97,13 +97,14 @@ Q_DECLARE_METATYPE(TrackerStatsList)
|
||||||
|
|
||||||
struct TrFile
|
struct TrFile
|
||||||
{
|
{
|
||||||
TrFile(): index(-1), priority(0), wanted(true), size(0), have(0) { }
|
TrFile(): wanted(true), index(-1), priority(0), size(0), have(0) { }
|
||||||
int index;
|
|
||||||
int priority;
|
bool wanted;
|
||||||
bool wanted;
|
int index;
|
||||||
uint64_t size;
|
int priority;
|
||||||
uint64_t have;
|
QString filename;
|
||||||
QString filename;
|
uint64_t size;
|
||||||
|
uint64_t have;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<TrFile> FileList;
|
typedef QList<TrFile> FileList;
|
||||||
|
|
Loading…
Reference in a new issue