diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:13:41 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:13:41 -0600 |
commit | a90eb215f53c95d81f95b32255098066d90556d9 (patch) | |
tree | 333389b0dad6c75eb0f6b5649ec9adcabb18c268 /libktorrent | |
parent | 42a9872891eba166e81cf4f8c062261cc77398f8 (diff) | |
download | ktorrent-a90eb215f53c95d81f95b32255098066d90556d9.tar.gz ktorrent-a90eb215f53c95d81f95b32255098066d90556d9.zip |
Rename old tq methods that no longer need a unique name
Diffstat (limited to 'libktorrent')
-rw-r--r-- | libktorrent/interfaces/torrentinterface.h | 6 | ||||
-rw-r--r-- | libktorrent/labelview.cpp | 6 | ||||
-rw-r--r-- | libktorrent/labelview.h | 2 | ||||
-rw-r--r-- | libktorrent/labelviewitembase.ui | 2 | ||||
-rw-r--r-- | libktorrent/pluginmanagerwidget.ui | 2 | ||||
-rw-r--r-- | libktorrent/torrent/chunk.cpp | 2 | ||||
-rw-r--r-- | libktorrent/torrent/chunk.h | 14 | ||||
-rw-r--r-- | libktorrent/torrent/chunkdownload.cpp | 24 | ||||
-rw-r--r-- | libktorrent/torrent/chunkdownload.h | 4 | ||||
-rw-r--r-- | libktorrent/torrent/chunkmanager.cpp | 40 | ||||
-rw-r--r-- | libktorrent/torrent/chunkselector.cpp | 2 | ||||
-rw-r--r-- | libktorrent/torrent/downloader.cpp | 16 | ||||
-rw-r--r-- | libktorrent/torrent/multifilecache.cpp | 10 | ||||
-rw-r--r-- | libktorrent/torrent/peersourcemanager.cpp | 16 | ||||
-rw-r--r-- | libktorrent/torrent/peersourcemanager.h | 2 | ||||
-rw-r--r-- | libktorrent/torrent/singlefilecache.cpp | 14 | ||||
-rw-r--r-- | libktorrent/torrent/torrentcontrol.cpp | 14 | ||||
-rw-r--r-- | libktorrent/util/log.cpp | 2 |
18 files changed, 89 insertions, 89 deletions
diff --git a/libktorrent/interfaces/torrentinterface.h b/libktorrent/interfaces/torrentinterface.h index 14ad532..4ab3c74 100644 --- a/libktorrent/interfaces/torrentinterface.h +++ b/libktorrent/interfaces/torrentinterface.h @@ -44,7 +44,7 @@ namespace kt class TorrentFileInterface; class PeerSource; - enum TorrenttqStatus + enum TorrentStatus { NOT_STARTED, SEEDING_COMPLETE, @@ -118,8 +118,8 @@ namespace kt Uint32 leechers_total; /// Num leechers connected to Uint32 leechers_connected_to; - /// tqStatus of the download - TorrenttqStatus status; + /// Status of the download + TorrentStatus status; /// The status of the tracker TQString trackerstatus; /// The number of bytes downloaded in this session diff --git a/libktorrent/labelview.cpp b/libktorrent/labelview.cpp index b46de3a..3823516 100644 --- a/libktorrent/labelview.cpp +++ b/libktorrent/labelview.cpp @@ -184,11 +184,11 @@ namespace kt selected = 0; // update odd status of each item - updateOddtqStatus(); + updateOddStatus(); } } - void LabelView::updateOddtqStatus() + void LabelView::updateOddStatus() { bool odd = true; LabelViewItr i = items.begin(); @@ -250,7 +250,7 @@ namespace kt { items.sort(LabelViewItemCmp()); item_box->sorted(items); - updateOddtqStatus(); + updateOddStatus(); } } diff --git a/libktorrent/labelview.h b/libktorrent/labelview.h index 550e2d5..eba2036 100644 --- a/libktorrent/labelview.h +++ b/libktorrent/labelview.h @@ -110,7 +110,7 @@ namespace kt void onItemClicked(LabelViewItem* it); private: - void updateOddtqStatus(); + void updateOddStatus(); signals: /// The current item has changed diff --git a/libktorrent/labelviewitembase.ui b/libktorrent/labelviewitembase.ui index cb6821c..861f703 100644 --- a/libktorrent/labelviewitembase.ui +++ b/libktorrent/labelviewitembase.ui @@ -23,7 +23,7 @@ <property name="name"> <cstring>icon_lbl</cstring> </property> - <property name="tqminimumSize"> + <property name="minimumSize"> <size> <width>64</width> <height>64</height> diff --git a/libktorrent/pluginmanagerwidget.ui b/libktorrent/pluginmanagerwidget.ui index aae2416..a43575b 100644 --- a/libktorrent/pluginmanagerwidget.ui +++ b/libktorrent/pluginmanagerwidget.ui @@ -82,7 +82,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="tqsizeHint"> + <property name="sizeHint"> <size> <width>20</width> <height>31</height> diff --git a/libktorrent/torrent/chunk.cpp b/libktorrent/torrent/chunk.cpp index aaee35e..6873713 100644 --- a/libktorrent/torrent/chunk.cpp +++ b/libktorrent/torrent/chunk.cpp @@ -37,7 +37,7 @@ namespace bt clear(); } - void Chunk::setData(Uint8* d,tqStatus nstatus) + void Chunk::setData(Uint8* d,Status nstatus) { clear(); status = nstatus; diff --git a/libktorrent/torrent/chunk.h b/libktorrent/torrent/chunk.h index 08d63c3..0896e96 100644 --- a/libktorrent/torrent/chunk.h +++ b/libktorrent/torrent/chunk.h @@ -45,7 +45,7 @@ namespace bt Chunk(unsigned int index,Uint32 size); ~Chunk(); - enum tqStatus + enum Status { MMAPPED, BUFFERED, @@ -54,13 +54,13 @@ namespace bt }; /// Get the chunks status. - tqStatus gettqStatus() const; + Status getStatus() const; /** * Set the chunks status * @param s */ - void settqStatus(tqStatus s); + void setStatus(Status s); /// Get the data const Uint8* getData() const; @@ -69,7 +69,7 @@ namespace bt Uint8* getData(); /// Set the data and the new status - void setData(Uint8* d,tqStatus nstatus); + void setData(Uint8* d,Status nstatus); /// Clear the chunk (delete data depending on the mode) void clear(); @@ -118,7 +118,7 @@ namespace bt virtual void unmapped(); private: - tqStatus status; + Status status; Uint32 index; Uint8* data; Uint32 size; @@ -126,12 +126,12 @@ namespace bt Priority priority; }; - inline Chunk::tqStatus Chunk::gettqStatus() const + inline Chunk::Status Chunk::getStatus() const { return status; } - inline void Chunk::settqStatus(Chunk::tqStatus s) + inline void Chunk::setStatus(Chunk::Status s) { status = s; } diff --git a/libktorrent/torrent/chunkdownload.cpp b/libktorrent/torrent/chunkdownload.cpp index 04eb87f..3475441 100644 --- a/libktorrent/torrent/chunkdownload.cpp +++ b/libktorrent/torrent/chunkdownload.cpp @@ -35,17 +35,17 @@ namespace bt { - class DownloadtqStatus : public std::set<Uint32> + class DownloadStatus : public std::set<Uint32> { public: // typedef std::set<Uint32>::iterator iterator; - DownloadtqStatus() + DownloadStatus() { } - ~DownloadtqStatus() + ~DownloadStatus() { } @@ -111,7 +111,7 @@ namespace bt return false; - DownloadtqStatus* ds = dstatus.find(p.getPeer()); + DownloadStatus* ds = dstatus.find(p.getPeer()); if (ds) ds->remove(pp); @@ -169,7 +169,7 @@ namespace bt pd->grab(); pdown.append(pd); - dstatus.insert(pd->getPeer()->getID(),new DownloadtqStatus()); + dstatus.insert(pd->getPeer()->getID(),new DownloadStatus()); sendRequests(pd); connect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& ))); connect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& ))); @@ -179,7 +179,7 @@ namespace bt void ChunkDownload::notDownloaded(const Request & r,bool reject) { // find the peer - DownloadtqStatus* ds = dstatus.find(r.getPeer()); + DownloadStatus* ds = dstatus.find(r.getPeer()); if (ds) { // Out() << "ds != 0" << endl; @@ -216,7 +216,7 @@ namespace bt void ChunkDownload::sendRequests(PeerDownloader* pd) { timer.update(); - DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); if (!ds) return; @@ -262,11 +262,11 @@ namespace bt void ChunkDownload::sendCancels(PeerDownloader* pd) { - DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); if (!ds) return; - DownloadtqStatus::iterator itr = ds->begin(); + DownloadStatus::iterator itr = ds->begin(); while (itr != ds->end()) { Uint32 i = *itr; @@ -287,7 +287,7 @@ namespace bt while (i != pdown.end()) { PeerDownloader* pd = *i; - DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); Uint32 pp = p.getOffset() / MAX_PIECE_LEN; if (ds && ds->contains(pp)) { @@ -360,7 +360,7 @@ namespace bt ChunkDownloadHeader hdr; hdr.index = chunk->getIndex(); hdr.num_bits = pieces.getNumBits(); - hdr.buffered = chunk->gettqStatus() == Chunk::BUFFERED ? 1 : 0; + hdr.buffered = chunk->getStatus() == Chunk::BUFFERED ? 1 : 0; // save the chunk header file.write(&hdr,sizeof(ChunkDownloadHeader)); // save the bitset @@ -370,7 +370,7 @@ namespace bt // if it's a buffered chunk, save the contents to file.write(chunk->getData(),chunk->getSize()); chunk->clear(); - chunk->settqStatus(Chunk::ON_DISK); + chunk->setStatus(Chunk::ON_DISK); } } diff --git a/libktorrent/torrent/chunkdownload.h b/libktorrent/torrent/chunkdownload.h index c8bd2ae..83fd3e3 100644 --- a/libktorrent/torrent/chunkdownload.h +++ b/libktorrent/torrent/chunkdownload.h @@ -41,7 +41,7 @@ namespace bt class Peer; class Request; class PeerDownloader; - class DownloadtqStatus; + class DownloadStatus; struct ChunkDownloadHeader { @@ -193,7 +193,7 @@ namespace bt Uint32 last_size; Timer timer; TQPtrList<PeerDownloader> pdown; - PtrMap<Uint32,DownloadtqStatus> dstatus; + PtrMap<Uint32,DownloadStatus> dstatus; std::set<Uint32> piece_providers; diff --git a/libktorrent/torrent/chunkmanager.cpp b/libktorrent/torrent/chunkmanager.cpp index ac45be5..a0849a4 100644 --- a/libktorrent/torrent/chunkmanager.cpp +++ b/libktorrent/torrent/chunkmanager.cpp @@ -189,7 +189,7 @@ namespace bt Chunk* c = getChunk(hdr.index); if (c) { - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); bitset.set(hdr.index,true); todo.set(hdr.index,false); recalc_chunks_left = true; @@ -209,7 +209,7 @@ namespace bt for (unsigned int i = 0;i < tor.getNumChunks();i++) { Chunk* c = getChunk(i); - if (c->gettqStatus() != Chunk::NOT_DOWNLOADED) + if (c->getStatus() != Chunk::NOT_DOWNLOADED) { NewChunkHeader hdr; hdr.index = i; @@ -267,16 +267,16 @@ namespace bt for (Uint32 i = 0;i < bitset.getNumBits();i++) { Chunk* c = chunks[i]; - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) { cache->save(c); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); } - else if (c->gettqStatus() == Chunk::BUFFERED) + else if (c->getStatus() == Chunk::BUFFERED) { c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); } } cache->close(); @@ -288,11 +288,11 @@ namespace bt return 0; Chunk* c = chunks[i]; - if (c->gettqStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded()) + if (c->getStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded()) { return 0; } - else if (c->gettqStatus() == Chunk::ON_DISK) + else if (c->getStatus() == Chunk::ON_DISK) { // load the chunk if it is on disk cache->load(c); @@ -338,10 +338,10 @@ namespace bt Chunk* c = chunks[i]; if (!c->taken()) { - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); loaded.remove(i); } } @@ -352,10 +352,10 @@ namespace bt return; Chunk* c = chunks[i]; - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->settqStatus(Chunk::NOT_DOWNLOADED); + c->setStatus(Chunk::NOT_DOWNLOADED); bitset.set(i,false); todo.set(i,!excluded_chunks.get(i) && !only_seed_chunks.get(i)); loaded.remove(i); @@ -372,10 +372,10 @@ namespace bt // get rid of chunk if nobody asked for it in the last 5 seconds if (!c->taken() && bt::GetCurrentTime() - i.data() > 5000) { - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); TQMap<Uint32,TimeStamp>::iterator j = i; i++; loaded.erase(j); @@ -413,7 +413,7 @@ namespace bt else { c->clear(); - c->settqStatus(Chunk::NOT_DOWNLOADED); + c->setStatus(Chunk::NOT_DOWNLOADED); Out(SYS_DIO|LOG_IMPORTANT) << "Warning: attempted to save a chunk which was excluded" << endl; } } @@ -1016,7 +1016,7 @@ namespace bt bool ChunkManager::prepareChunk(Chunk* c,bool allways) { - if (!allways && c->gettqStatus() != Chunk::NOT_DOWNLOADED) + if (!allways && c->getStatus() != Chunk::NOT_DOWNLOADED) return false; return cache->prep(c); @@ -1044,7 +1044,7 @@ namespace bt bitset.set(i,true); todo.set(i,false); // the chunk must be on disk - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); tor.updateFilePercentage(i,bitset); } else if (!ok_chunks.get(i) && bitset.get(i)) @@ -1053,12 +1053,12 @@ namespace bt // We think we have a chunk, but we don't bitset.set(i,false); todo.set(i,!only_seed_chunks.get(i) && !excluded_chunks.get(i)); - if (c->gettqStatus() == Chunk::ON_DISK) + if (c->getStatus() == Chunk::ON_DISK) { - c->settqStatus(Chunk::NOT_DOWNLOADED); + c->setStatus(Chunk::NOT_DOWNLOADED); tor.updateFilePercentage(i,bitset); } - else if (c->gettqStatus() == Chunk::MMAPPED || c->gettqStatus() == Chunk::BUFFERED) + else if (c->getStatus() == Chunk::MMAPPED || c->getStatus() == Chunk::BUFFERED) { resetChunk(i); } diff --git a/libktorrent/torrent/chunkselector.cpp b/libktorrent/torrent/chunkselector.cpp index 9c05629..b1c42fa 100644 --- a/libktorrent/torrent/chunkselector.cpp +++ b/libktorrent/torrent/chunkselector.cpp @@ -165,7 +165,7 @@ namespace bt for (Uint32 i = from;i <= to;i++) { bool in_chunks = std::find(chunks.begin(),chunks.end(),i) != chunks.end(); - if (!in_chunks && cman.getChunk(i)->gettqStatus() != Chunk::ON_DISK) + if (!in_chunks && cman.getChunk(i)->getStatus() != Chunk::ON_DISK) { // Out(SYS_DIO|LOG_DEBUG) << "ChunkSelector::reIncluded " << i << endl; chunks.push_back(i); diff --git a/libktorrent/torrent/downloader.cpp b/libktorrent/torrent/downloader.cpp index a63163e..582fa7e 100644 --- a/libktorrent/torrent/downloader.cpp +++ b/libktorrent/torrent/downloader.cpp @@ -87,7 +87,7 @@ namespace bt } // if the chunk is not in memory, reload it - if (cd->getChunk()->gettqStatus() == Chunk::ON_DISK) + if (cd->getChunk()->getStatus() == Chunk::ON_DISK) { cman.prepareChunk(cd->getChunk(),true); } @@ -119,7 +119,7 @@ namespace bt downloaded += p.getLength(); // save to disk again, if it is idle - if (cd->isIdle() && cd->getChunk()->gettqStatus() == Chunk::MMAPPED) + if (cd->isIdle() && cd->getChunk()->getStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -160,7 +160,7 @@ namespace bt if (cd->isIdle()) // idle chunks do not need to be in memory { Chunk* c = cd->getChunk(); - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -169,7 +169,7 @@ namespace bt { cd->releaseAllPDs(); Chunk* c = cd->getChunk(); - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -277,7 +277,7 @@ namespace bt if (sel) { // if it is on disk, reload it - if (sel->getChunk()->gettqStatus() == Chunk::ON_DISK) + if (sel->getChunk()->getStatus() == Chunk::ON_DISK) cman.prepareChunk(sel->getChunk(),true); sel->assignPeer(pd); @@ -341,7 +341,7 @@ namespace bt if (cdmin) { // if it is on disk, reload it - if (cdmin->getChunk()->gettqStatus() == Chunk::ON_DISK) + if (cdmin->getChunk()->getStatus() == Chunk::ON_DISK) { cman.prepareChunk(cdmin->getChunk(),true); } @@ -438,10 +438,10 @@ namespace bt { Uint32 ch = i->first; Chunk* c = i->second->getChunk(); - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) cman.saveChunk(ch,false); - c->settqStatus(Chunk::NOT_DOWNLOADED); + c->setStatus(Chunk::NOT_DOWNLOADED); } current_chunks.clear(); } diff --git a/libktorrent/torrent/multifilecache.cpp b/libktorrent/torrent/multifilecache.cpp index b7dae26..e842560 100644 --- a/libktorrent/torrent/multifilecache.cpp +++ b/libktorrent/torrent/multifilecache.cpp @@ -425,7 +425,7 @@ namespace bt { // if mmap fails or is not possible use buffered mode c->allocate(); - c->settqStatus(Chunk::BUFFERED); + c->setStatus(Chunk::BUFFERED); } else { @@ -436,7 +436,7 @@ namespace bt { // just allocate it c->allocate(); - c->settqStatus(Chunk::BUFFERED); + c->setStatus(Chunk::BUFFERED); } return true; } @@ -446,7 +446,7 @@ namespace bt TQValueList<Uint32> tflist; tor.calcChunkPos(c->getIndex(),tflist); - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) { // mapped chunks are easy CacheFile* fd = files.find(tflist[0]); @@ -455,7 +455,7 @@ namespace bt fd->unmap(c->getData(),c->getSize()); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); return; } @@ -506,7 +506,7 @@ namespace bt // set the chunk to on disk and clear it c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); } void MultiFileCache::downloadStatusChanged(TorrentFile* tf, bool download) diff --git a/libktorrent/torrent/peersourcemanager.cpp b/libktorrent/torrent/peersourcemanager.cpp index 44303c4..136d9e5 100644 --- a/libktorrent/torrent/peersourcemanager.cpp +++ b/libktorrent/torrent/peersourcemanager.cpp @@ -386,7 +386,7 @@ namespace bt // 30 minutes curr->setInterval(FINAL_WAIT_TIME); timer.start(FINAL_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } else if (curr->failureCount() > 2) { @@ -394,14 +394,14 @@ namespace bt // a minute or 5, no need for hammering every 30 seconds curr->setInterval(LONGER_WAIT_TIME); timer.start(LONGER_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } else { // lets not hammer and wait 30 seconds curr->setInterval(INITIAL_WAIT_TIME); timer.start(INITIAL_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } } else @@ -418,7 +418,7 @@ namespace bt { curr->setInterval(FINAL_WAIT_TIME); timer.start(FINAL_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } else if (trk->failureCount() > 2) { @@ -426,14 +426,14 @@ namespace bt // wait 5 minutes and try again curr->setInterval(LONGER_WAIT_TIME); timer.start(LONGER_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } else { // wait 30 seconds and try again curr->setInterval(INITIAL_WAIT_TIME); timer.start(INITIAL_WAIT_TIME * 1000,true); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } } } @@ -449,7 +449,7 @@ namespace bt pending = false; if (started) statusChanged(i18n("OK")); - request_time = TQDateTime::tqcurrentDateTime(); + request_time = TQDateTime::currentDateTime(); } void PeerSourceManager::onTrackerRequestPending() @@ -504,7 +504,7 @@ namespace bt if (pending || !started || !curr) return 0; - return curr->getInterval() - request_time.secsTo(TQDateTime::tqcurrentDateTime()); + return curr->getInterval() - request_time.secsTo(TQDateTime::currentDateTime()); } Uint32 PeerSourceManager::getNumSeeders() const diff --git a/libktorrent/torrent/peersourcemanager.h b/libktorrent/torrent/peersourcemanager.h index c46bbb8..d256397 100644 --- a/libktorrent/torrent/peersourcemanager.h +++ b/libktorrent/torrent/peersourcemanager.h @@ -165,7 +165,7 @@ namespace bt signals: /** - * tqStatus has changed of the tracker. + * Status has changed of the tracker. * @param ns The new status */ void statusChanged(const TQString & ns); diff --git a/libktorrent/torrent/singlefilecache.cpp b/libktorrent/torrent/singlefilecache.cpp index 4843c1f..8986f98 100644 --- a/libktorrent/torrent/singlefilecache.cpp +++ b/libktorrent/torrent/singlefilecache.cpp @@ -76,7 +76,7 @@ namespace bt { // mmap continuously fails, so stop using it c->allocate(); - c->settqStatus(Chunk::BUFFERED); + c->setStatus(Chunk::BUFFERED); } else { @@ -88,7 +88,7 @@ namespace bt // buffer it if mmapping fails Out(SYS_GEN|LOG_IMPORTANT) << "Warning : mmap failure, falling back to buffered mode" << endl; c->allocate(); - c->settqStatus(Chunk::BUFFERED); + c->setStatus(Chunk::BUFFERED); } else { @@ -105,7 +105,7 @@ namespace bt if (mmap_failures >= 3 || !(buf = (Uint8*)fd->map(c,off,c->getSize(),CacheFile::READ))) { c->allocate(); - c->settqStatus(Chunk::BUFFERED); + c->setStatus(Chunk::BUFFERED); fd->read(c->getData(),c->getSize(),off); if (mmap_failures < 3) mmap_failures++; @@ -119,18 +119,18 @@ namespace bt void SingleFileCache::save(Chunk* c) { // unmap the chunk if it is mapped - if (c->gettqStatus() == Chunk::MMAPPED) + if (c->getStatus() == Chunk::MMAPPED) { fd->unmap(c->getData(),c->getSize()); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); } - else if (c->gettqStatus() == Chunk::BUFFERED) + else if (c->getStatus() == Chunk::BUFFERED) { Uint64 off = c->getIndex() * tor.getChunkSize(); fd->write(c->getData(),c->getSize(),off); c->clear(); - c->settqStatus(Chunk::ON_DISK); + c->setStatus(Chunk::ON_DISK); } } diff --git a/libktorrent/torrent/torrentcontrol.cpp b/libktorrent/torrent/torrentcontrol.cpp index a586356..590a517 100644 --- a/libktorrent/torrent/torrentcontrol.cpp +++ b/libktorrent/torrent/torrentcontrol.cpp @@ -200,7 +200,7 @@ namespace bt if (stats.completed && !comp) { pman->killSeeders(); - TQDateTime now = TQDateTime::tqcurrentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); istats.running_time_dl += istats.time_started_dl.secsTo(now); updateStatusMsg(); updateStats(); @@ -228,7 +228,7 @@ namespace bt else psman->manualUpdate(); istats.last_announce = bt::GetCurrentTime(); - istats.time_started_dl = TQDateTime::tqcurrentDateTime(); + istats.time_started_dl = TQDateTime::currentDateTime(); } updateStatusMsg(); @@ -351,7 +351,7 @@ namespace bt throw; } - istats.time_started_ul = istats.time_started_dl = TQDateTime::tqcurrentDateTime(); + istats.time_started_ul = istats.time_started_dl = TQDateTime::currentDateTime(); resetTrackerStats(); if (prealloc) @@ -408,7 +408,7 @@ namespace bt void TorrentControl::stop(bool user,WaitJob* wjob) { - TQDateTime now = TQDateTime::tqcurrentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); if(!stats.completed) istats.running_time_dl += istats.time_started_dl.secsTo(now); istats.running_time_ul += istats.time_started_ul.secsTo(now); @@ -992,7 +992,7 @@ namespace bt if (stats.running) { - TQDateTime now = TQDateTime::tqcurrentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); st.write("RUNNING_TIME_DL",TQString("%1").tqarg(istats.running_time_dl + istats.time_started_dl.secsTo(now))); st.write("RUNNING_TIME_UL",TQString("%1").tqarg(istats.running_time_ul + istats.time_started_ul.secsTo(now))); } @@ -1222,7 +1222,7 @@ namespace bt if (!stats.running || stats.completed) return istats.running_time_dl; else - return istats.running_time_dl + istats.time_started_dl.secsTo(TQDateTime::tqcurrentDateTime()); + return istats.running_time_dl + istats.time_started_dl.secsTo(TQDateTime::currentDateTime()); } Uint32 TorrentControl::getRunningTimeUL() const @@ -1230,7 +1230,7 @@ namespace bt if (!stats.running) return istats.running_time_ul; else - return istats.running_time_ul + istats.time_started_ul.secsTo(TQDateTime::tqcurrentDateTime()); + return istats.running_time_ul + istats.time_started_ul.secsTo(TQDateTime::currentDateTime()); } Uint32 TorrentControl::getNumFiles() const diff --git a/libktorrent/util/log.cpp b/libktorrent/util/log.cpp index 6030e99..2cb53da 100644 --- a/libktorrent/util/log.cpp +++ b/libktorrent/util/log.cpp @@ -116,7 +116,7 @@ namespace bt // this could result in the loss of some messages if (!rotate_job) { - *out << TQDateTime::tqcurrentDateTime().toString() << ": " << tmp << ::endl; + *out << TQDateTime::currentDateTime().toString() << ": " << tmp << ::endl; fptr.flush(); if (to_cout) std::cout << TQString(tmp.local8Bit()) << std::endl; |