~ubuntu-branches/ubuntu/maverick/transmission/maverick-updates

« back to all changes in this revision

Viewing changes to libtransmission/torrent-ctor.c

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-12-08 10:49:11 UTC
  • mfrom: (1.1.29 upstream) (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20091208104911-06gio45n2nla3vpg
Tags: 1.80~b1-0ubuntu1
* New upstream release (LP: #460620), rebased on debian unstable
  remaining changes:
  - debian/control:
    + Added replaces & provides clutch (now included as part of transmission).
      Can be removed in lucid+1
    + Added quilt, liblaunchpad-integration-dev and lsb-release to Build-Depends
  - debian/rules:
    + create a po template during package build.
  - debian/patches/01_lpi.patch:
    + integrate transmission with launchpad
  - debian/patches/20_add_x-ubuntu-gettext-domain.diff:
    + add x-ubuntu-gettext-domain to .desktop file.
  - debian/transmission-daemon.default:
    - remove --auth from OPTIONS
* Fixes bugs:
  - tray menu shows wrong status for "main window" when started minimized
    (LP: #451415)
* Refreshed patches:
  - dont_build_libevent.patch
  - 99_autoreconf.patch
* Removed patches:
  - 21_onPortTested.diff, 23_tr_torrentNext.diff and
    24_tr_torrentDeleteLocalData_do_move.diff
* debian/patches/21_fix_inhibition.patch:
  - The right value for suspend inhibition is 4
* debian/control:
  - Build-Depend on libgconf2-dev to enable magnet link registration and on
    libcanberra-gtk-dev for notification sound.
* debian/watch:
  - make it detect beta versions, to be removed after 1.80 is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * This file Copyright (C) 2007-2009 Charles Kerr <charles@transmissionbt.com>
 
2
 * This file Copyright (C) 2007-2009 Mnemosyne LLC
3
3
 *
4
4
 * This file is licensed by the GPL version 2.  Works owned by the
5
5
 * Transmission project are granted a special exemption to clause 2(b)
7
7
 * This exemption does not extend to derived works not owned by
8
8
 * the Transmission project.
9
9
 *
10
 
 * $Id: torrent-ctor.c 8602 2009-06-03 16:59:32Z charles $
 
10
 * $Id: torrent-ctor.c 9671 2009-12-05 02:19:24Z charles $
11
11
 */
12
12
 
13
13
#include <errno.h>
14
14
#include "transmission.h"
15
15
#include "bencode.h"
 
16
#include "magnet.h"
16
17
#include "platform.h"
17
18
#include "session.h" /* tr_sessionFindTorrentFile() */
18
19
#include "torrent.h" /* tr_ctorGetSave() */
42
43
    tr_benc                 metainfo;
43
44
    char *                  sourceFile;
44
45
 
 
46
    tr_magnet_info        * magnetInfo;
 
47
 
45
48
    struct optional_args    optionalArgs[2];
46
49
 
 
50
    char                  * incompleteDir;
 
51
 
47
52
    tr_file_index_t       * want;
48
53
    tr_file_index_t         wantSize;
49
54
    tr_file_index_t       * notWant;
100
105
}
101
106
 
102
107
int
 
108
tr_ctorSetMagnet( tr_ctor * ctor, const char * uri )
 
109
{
 
110
    int err;
 
111
 
 
112
    if( ctor->magnetInfo != NULL )
 
113
        tr_magnetFree( ctor->magnetInfo );
 
114
 
 
115
    ctor->magnetInfo = tr_magnetParse( uri );
 
116
 
 
117
    err = ctor->magnetInfo == NULL;
 
118
    return err;
 
119
}
 
120
 
 
121
int
103
122
tr_ctorSetMetainfoFromFile( tr_ctor *    ctor,
104
123
                            const char * filename )
105
124
{
300
319
    }
301
320
}
302
321
 
 
322
void
 
323
tr_ctorSetIncompleteDir( tr_ctor * ctor, const char * directory )
 
324
{
 
325
    tr_free( ctor->incompleteDir );
 
326
    ctor->incompleteDir = tr_strdup( directory );
 
327
}
 
328
 
303
329
int
304
330
tr_ctorGetPeerLimit( const tr_ctor * ctor,
305
331
                     tr_ctorMode     mode,
306
332
                     uint16_t *      setmeCount )
307
333
{
308
 
    int                          err = 0;
 
334
    int err = 0;
309
335
    const struct optional_args * args = &ctor->optionalArgs[mode];
310
336
 
311
337
    if( !args->isSet_connected )
349
375
}
350
376
 
351
377
int
 
378
tr_ctorGetIncompleteDir( const tr_ctor  * ctor,
 
379
                         const char    ** setmeIncompleteDir )
 
380
{
 
381
    int err = 0;
 
382
 
 
383
    if( ctor->incompleteDir == NULL )
 
384
        err = 1;
 
385
    else
 
386
        *setmeIncompleteDir = ctor->incompleteDir;
 
387
 
 
388
    return err;
 
389
}
 
390
 
 
391
int
 
392
tr_ctorGetMagnet( const tr_ctor * ctor, const tr_magnet_info ** setme )
 
393
{
 
394
    int err = 0;
 
395
 
 
396
    if( ctor->magnetInfo == NULL )
 
397
        err = 1;
 
398
    else
 
399
        *setme = ctor->magnetInfo;
 
400
 
 
401
    return err;
 
402
}
 
403
 
 
404
int
352
405
tr_ctorGetMetainfo( const tr_ctor *  ctor,
353
406
                    const tr_benc ** setme )
354
407
{
393
446
    clearMetainfo( ctor );
394
447
    tr_free( ctor->optionalArgs[1].downloadDir );
395
448
    tr_free( ctor->optionalArgs[0].downloadDir );
 
449
    tr_free( ctor->incompleteDir );
396
450
    tr_free( ctor->want );
397
451
    tr_free( ctor->notWant );
398
452
    tr_free( ctor->low );