Changeset 9337


Ignore:
Timestamp:
Oct 20, 2009, 4:43:51 AM (12 years ago)
Author:
charles
Message:

(trunk libT) change the new public API a little bit -- clearer, but a little wordier

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r9335 r9337  
    108108            base = tor->currentDir;
    109109
    110             if( tr_sessionIsPartialFilenamesEnabled( tor->session ) )
     110            if( tr_sessionIsIncompleteFileNamingEnabled( tor->session ) )
    111111                subpath = tr_torrentBuildPartial( tor, fileIndex );
    112112            else
  • trunk/libtransmission/session.c

    r9335 r9337  
    447447    tr_bencDictAddReal( d, TR_PREFS_KEY_RATIO,                    s->desiredRatio );
    448448    tr_bencDictAddBool( d, TR_PREFS_KEY_RATIO_ENABLED,            s->isRatioLimited );
    449     tr_bencDictAddBool( d, TR_PREFS_KEY_RENAME_PARTIAL_FILES,     tr_sessionIsPartialFilenamesEnabled( s ) );
     449    tr_bencDictAddBool( d, TR_PREFS_KEY_RENAME_PARTIAL_FILES,     tr_sessionIsIncompleteFileNamingEnabled( s ) );
    450450    tr_bencDictAddBool( d, TR_PREFS_KEY_RPC_AUTH_REQUIRED,        tr_sessionIsRPCPasswordEnabled( s ) );
    451451    tr_bencDictAddStr ( d, TR_PREFS_KEY_RPC_BIND_ADDRESS,         tr_sessionGetRPCBindAddress( s ) );
     
    705705    found = tr_bencDictFindBool( &settings, TR_PREFS_KEY_RENAME_PARTIAL_FILES, &boolVal );
    706706    assert( found );
    707     tr_sessionSetPartialFilenamesEnabled( session, boolVal );
     707    tr_sessionSetIncompleteFileNamingEnabled( session, boolVal );
    708708
    709709    found = tr_bencDictFindBool( &settings, TR_PREFS_KEY_PROXY_ENABLED, &boolVal );
     
    938938
    939939void
    940 tr_sessionSetPartialFilenamesEnabled( tr_session * session, tr_bool b )
     940tr_sessionSetIncompleteFileNamingEnabled( tr_session * session, tr_bool b )
    941941{
    942942    assert( tr_isSession( session ) );
    943943    assert( tr_isBool( b ) );
    944944
    945     session->isPartialNamesEnabled = b;
     945    session->isIncompleteFileNamingEnabled = b;
    946946}
    947947
    948948tr_bool
    949 tr_sessionIsPartialFilenamesEnabled( const tr_session * session )
    950 {
    951     assert( tr_isSession( session ) );
    952 
    953     return session->isPartialNamesEnabled;
     949tr_sessionIsIncompleteFileNamingEnabled( const tr_session * session )
     950{
     951    assert( tr_isSession( session ) );
     952
     953    return session->isIncompleteFileNamingEnabled;
    954954}
    955955
  • trunk/libtransmission/session.h

    r9335 r9337  
    5252    tr_bool                      isWaiting;
    5353    tr_bool                      useLazyBitfield;
    54     tr_bool                      isPartialNamesEnabled;
     54    tr_bool                      isIncompleteFileNamingEnabled;
    5555    tr_bool                      isRatioLimited;
    5656    tr_bool                      isIncompleteDirEnabled;
  • trunk/libtransmission/torrent.h

    r9335 r9337  
    361361
    362362
    363 /* Like tr_torrentFindFile(), but splits the filename into base
    364  * (tr_torrent.incompleteDir or tr_torrent.downloadDir)  and subpath */
     363/**
     364 * @brief Like tr_torrentFindFile(), but splits the filename into base and subpath;
     365 *
     366 * If the file is found, "tr_buildPath( base, subpath, NULL )"
     367 * will generate the complete filename.
     368 *
     369 * @return true if the file is found, false otherwise.
     370 *
     371 * @param base if the torrent is found, this will be either
     372 *             tor->downloadDir or tor->incompleteDir
     373 * @param subpath on success, this pointer is assigned a newly-allocated
     374 *                string holding the second half of the filename.
     375 */
    365376tr_bool tr_torrentFindFile2( const tr_torrent *, tr_file_index_t fileNo,
    366377                             const char ** base, char ** subpath );
    367378
    368379
    369 /* Returns a newly-allocated string that's been munged to the form
    370  * that denotes to humans that it's a partial file.
    371  * This is like the filenames in tr_torrent.info.files --
    372  * it's not a complete filename by itself, but a fragment that
    373  * can be passed to tr_buildPath() */
     380/* Returns a newly-allocated version of the tr_file.name string
     381 * that's been modified to denote that it's not a complete file yet.
     382 * In the current implementation this is done by appending ".part"
     383 * a la Firefox. */
    374384char* tr_torrentBuildPartial( const tr_torrent *, tr_file_index_t fileNo );
    375385
    376386
    377 
    378 
    379387#endif
  • trunk/libtransmission/transmission.h

    r9335 r9337  
    362362
    363363/**
    364  * @brief When enabled, unfinished torrent content files created after
    365  *        this call will have ".part" appended to their filename
     364 * @brief When enabled, newly-created files will have ".part" appended
     365 *        to their filename until the file is fully downloaded
    366366 *
    367367 * This is not retroactive -- toggling this will not rename existing files.
    368368 * It only applies to new files created by Transmission after this API call.
    369369 *
    370  * @param session
    371  * @param enable
    372  */
    373 void tr_sessionSetPartialFilenamesEnabled( tr_session * session, tr_bool );
    374 
    375 tr_bool tr_sessionIsPartialFilenamesEnabled( const tr_session * session );
     370 * @see tr_sessionIsIncompleteFileNamingEnabled()
     371 */
     372void tr_sessionSetIncompleteFileNamingEnabled( tr_session * session, tr_bool );
     373
     374tr_bool tr_sessionIsIncompleteFileNamingEnabled( const tr_session * session );
    376375
    377376/**
     
    11301129
    11311130/** @brief Set a batch of files to be downloaded or not. */
    1132 void            tr_torrentSetFileDLs( tr_torrent       * torrent,
    1133                                       tr_file_index_t  * files,
    1134                                       tr_file_index_t    fileCount,
    1135                                       tr_bool            do_download );
     1131void tr_torrentSetFileDLs( tr_torrent       * torrent,
     1132                           tr_file_index_t  * files,
     1133                           tr_file_index_t    fileCount,
     1134                           tr_bool            do_download );
    11361135
    11371136
Note: See TracChangeset for help on using the changeset viewer.