Changeset 8930 for trunk/libtransmission/torrent.c
- Timestamp:
- Aug 14, 2009, 2:41:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r8917 r8930 117 117 assert( tr_isDirection( dir ) ); 118 118 119 tr_bandwidthSetDesiredSpeed( tor->bandwidth, dir, KiB_sec ); 120 121 tr_torrentSetDirty( tor ); 119 if( tr_bandwidthSetDesiredSpeed( tor->bandwidth, dir, KiB_sec ) ) 120 tr_torrentSetDirty( tor ); 122 121 } 123 122 … … 137 136 assert( tr_isDirection( dir ) ); 138 137 139 tr_bandwidthSetLimited( tor->bandwidth, dir, do_use ); 140 141 tr_torrentSetDirty( tor ); 138 if( tr_bandwidthSetLimited( tor->bandwidth, dir, do_use ) ) 139 tr_torrentSetDirty( tor ); 142 140 } 143 141 … … 154 152 tr_torrentUseSessionLimits( tr_torrent * tor, tr_bool doUse ) 155 153 { 156 assert( tr_isTorrent( tor ) ); 157 158 tr_bandwidthHonorParentLimits( tor->bandwidth, TR_UP, doUse ); 159 tr_bandwidthHonorParentLimits( tor->bandwidth, TR_DOWN, doUse ); 160 161 tr_torrentSetDirty( tor ); 154 tr_bool changed; 155 156 assert( tr_isTorrent( tor ) ); 157 158 changed = tr_bandwidthHonorParentLimits( tor->bandwidth, TR_UP, doUse ); 159 changed |= tr_bandwidthHonorParentLimits( tor->bandwidth, TR_DOWN, doUse ); 160 161 if( changed ) 162 tr_torrentSetDirty( tor ); 162 163 } 163 164 … … 180 181 assert( mode==TR_RATIOLIMIT_GLOBAL || mode==TR_RATIOLIMIT_SINGLE || mode==TR_RATIOLIMIT_UNLIMITED ); 181 182 182 tor->ratioLimitMode = mode; 183 tor->needsSeedRatioCheck = TRUE; 184 185 tr_torrentSetDirty( tor ); 183 if( mode != tor->ratioLimitMode ) 184 { 185 tor->ratioLimitMode = mode; 186 tor->needsSeedRatioCheck = TRUE; 187 188 tr_torrentSetDirty( tor ); 189 } 186 190 } 187 191 … … 199 203 assert( tr_isTorrent( tor ) ); 200 204 201 tor->desiredRatio = desiredRatio; 202 203 tor->needsSeedRatioCheck = TRUE; 204 205 tr_torrentSetDirty( tor ); 205 if( (int)(desiredRatio*100.0) != (int)(tor->desiredRatio*100.0) ) 206 { 207 tor->desiredRatio = desiredRatio; 208 209 tor->needsSeedRatioCheck = TRUE; 210 211 tr_torrentSetDirty( tor ); 212 } 206 213 } 207 214 … … 1792 1799 assert( tr_isPriority( priority ) ); 1793 1800 1794 tor->bandwidth->priority = priority; 1795 1796 tr_torrentSetDirty( tor ); 1801 if( tor->bandwidth->priority != priority ) 1802 { 1803 tor->bandwidth->priority = priority; 1804 1805 tr_torrentSetDirty( tor ); 1806 } 1797 1807 } 1798 1808 … … 2056 2066 2057 2067 void 2058 tr_torrentSetActivityDate( tr_torrent * tor, 2059 time_t t ) 2068 tr_torrentSetActivityDate( tr_torrent * tor, time_t t ) 2060 2069 { 2061 2070 assert( tr_isTorrent( tor ) ); … … 2063 2072 tor->activityDate = t; 2064 2073 tor->anyDate = MAX( tor->anyDate, tor->activityDate ); 2065 tr_torrentSetDirty( tor );2066 2074 } 2067 2075
Note: See TracChangeset
for help on using the changeset viewer.