~ubuntu-branches/ubuntu/quantal/transmission/quantal

« back to all changes in this revision

Viewing changes to qt/torrent.h

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2010-07-24 23:31:01 UTC
  • mfrom: (1.1.37 upstream) (2.1.21 sid)
  • Revision ID: james.westby@ubuntu.com-20100724233101-s1w4xpfbt9g10vxo
Tags: 2.03-0ubuntu1
* New upstream release (LP: #599126) 
* Fixes bugs:
  - duplicate quit confirmation dialog on closing transmission (LP: #603426)
  - disk read/write scheduling (LP: #567181)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * This exemption does not extend to derived works not owned by
8
8
 * the Transmission project.
9
9
 *
10
 
 * $Id: torrent.h 10713 2010-05-31 15:30:44Z Longinus00 $
 
10
 * $Id: torrent.h 10873 2010-06-26 17:48:57Z Longinus00 $
11
11
 */
12
12
 
13
13
#ifndef QTR_TORRENT_H
42
42
    QString clientName;
43
43
    bool clientIsChoked;
44
44
    bool clientIsInterested;
 
45
    QString flagStr;
45
46
    bool isDownloadingFrom;
46
47
    bool isEncrypted;
47
48
    bool isIncoming;
198
199
 
199
200
        static Property myProperties[];
200
201
 
 
202
        bool magnetTorrent;
 
203
 
201
204
    public:
202
205
        typedef QList<const char*> KeyList;
203
206
        static const KeyList& getInfoKeys( );
251
254
        uint64_t leftUntilDone( ) const { return getSize( LEFT_UNTIL_DONE ); }
252
255
        uint64_t pieceSize( ) const { return getSize( PIECE_SIZE ); }
253
256
        bool hasMetadata( ) const { return getDouble( METADATA_PERCENT_DONE ) >= 1.0; }
 
257
        bool isMagnet( ) const { return magnetTorrent; }
254
258
        int  pieceCount( ) const { return getInt( PIECE_COUNT ); }
255
259
        double ratio( ) const { return getDouble( RATIO ); }
256
260
        double percentComplete( ) const { return haveTotal() / (double)totalSize(); }
305
309
 
306
310
    public:
307
311
        void update( tr_benc * dict );
 
312
        void setMagnet( bool magnet ) { magnetTorrent = magnet; }
308
313
 
309
314
    private:
310
315
        const char * getMimeTypeString( ) const;