From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: TQt4 port ktorrent This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- apps/ktcachecheck/cachecheck.cpp | 4 ++-- apps/ktcachecheck/cachechecker.cpp | 6 +++--- apps/ktcachecheck/cachechecker.h | 8 ++++---- apps/ktcachecheck/multicachechecker.cpp | 8 ++++---- apps/ktcachecheck/multicachechecker.h | 2 +- apps/ktcachecheck/singlecachechecker.cpp | 6 +++--- apps/ktcachecheck/singlecachechecker.h | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'apps/ktcachecheck') diff --git a/apps/ktcachecheck/cachecheck.cpp b/apps/ktcachecheck/cachecheck.cpp index 0a143c5..191ed7a 100644 --- a/apps/ktcachecheck/cachecheck.cpp +++ b/apps/ktcachecheck/cachecheck.cpp @@ -46,11 +46,11 @@ int main(int argc,char** argv) try { Torrent tor; - QString tor_file,cache,index; + TQString tor_file,cache,index; if (argc == 2) { - QString cache_dir = argv[1]; + TQString cache_dir = argv[1]; if (!cache_dir.endsWith(bt::DirSeparator())) cache_dir += bt::DirSeparator(); diff --git a/apps/ktcachecheck/cachechecker.cpp b/apps/ktcachecheck/cachechecker.cpp index 6cdf3e5..f05fb18 100644 --- a/apps/ktcachecheck/cachechecker.cpp +++ b/apps/ktcachecheck/cachechecker.cpp @@ -39,12 +39,12 @@ namespace ktdebug CacheChecker::~CacheChecker() {} - void CacheChecker::loadIndex(const QString & index_file) + void CacheChecker::loadIndex(const TQString & index_file) { this->index_file = index_file; File fptr; if (!fptr.open(index_file,"rb")) - throw Error(i18n("Cannot open index file %1 : %2").arg(index_file).arg(fptr.errorString())); + throw Error(i18n("Cannot open index file %1 : %2").tqarg(index_file).tqarg(fptr.errorString())); if (fptr.seek(File::END,0) != 0) { @@ -73,7 +73,7 @@ namespace ktdebug File fptr; if (!fptr.open(index_file,"wb")) - throw Error(i18n("Cannot open index file %1 : %2").arg(index_file).arg(fptr.errorString())); + throw Error(i18n("Cannot open index file %1 : %2").tqarg(index_file).tqarg(fptr.errorString())); std::set::iterator i; // first remove failed chunks from downloaded diff --git a/apps/ktcachecheck/cachechecker.h b/apps/ktcachecheck/cachechecker.h index def3e6d..27d58ac 100644 --- a/apps/ktcachecheck/cachechecker.h +++ b/apps/ktcachecheck/cachechecker.h @@ -21,7 +21,7 @@ #define DEBUGCACHECHECKER_H #include -#include +#include #include namespace bt @@ -41,15 +41,15 @@ namespace ktdebug CacheChecker(bt::Torrent & tor); virtual ~CacheChecker(); - void loadIndex(const QString & index_file); + void loadIndex(const TQString & index_file); void fixIndex(); bool foundFailedChunks() const {return failed_chunks.size() > 0;} bool foundExtraChunks() const {return extra_chunks.size() > 0;} - virtual void check(const QString & cache,const QString & index) = 0; + virtual void check(const TQString & cache,const TQString & index) = 0; protected: bt::Torrent & tor; - QString index_file; + TQString index_file; std::set downloaded_chunks; std::set failed_chunks; std::set extra_chunks; diff --git a/apps/ktcachecheck/multicachechecker.cpp b/apps/ktcachecheck/multicachechecker.cpp index df80535..3132e12 100644 --- a/apps/ktcachecheck/multicachechecker.cpp +++ b/apps/ktcachecheck/multicachechecker.cpp @@ -40,10 +40,10 @@ namespace ktdebug {} - void MultiCacheChecker::check(const QString& cache_dir, const QString& index) + void MultiCacheChecker::check(const TQString& cache_dir, const TQString& index) { loadIndex(index); - QString cache = cache_dir; + TQString cache = cache_dir; if (!cache.endsWith(bt::DirSeparator())) cache += bt::DirSeparator(); @@ -79,7 +79,7 @@ namespace ktdebug // we can read the chunk from this file File fptr; if (!fptr.open(cache + tf.getPath(),"rb")) - throw Error(QString("Cannot open %1 : %2").arg(cache + tf.getPath()).arg(fptr.errorString())); + throw Error(TQString("Cannot open %1 : %2").tqarg(cache + tf.getPath()).tqarg(fptr.errorString())); fptr.seek(File::BEGIN,curr_file_off); fptr.read(buf + bytes_offset,to_read); @@ -94,7 +94,7 @@ namespace ktdebug // Out() << "Partially reading " << to_read << endl; File fptr; if (!fptr.open(cache + tf.getPath(),"rb")) - throw Error(QString("Cannot open %1 : %2").arg(cache + tf.getPath()).arg(fptr.errorString())); + throw Error(TQString("Cannot open %1 : %2").tqarg(cache + tf.getPath()).tqarg(fptr.errorString())); fptr.seek(File::BEGIN,curr_file_off); fptr.read(buf + bytes_offset,to_read); diff --git a/apps/ktcachecheck/multicachechecker.h b/apps/ktcachecheck/multicachechecker.h index 1df95f5..fc57792 100644 --- a/apps/ktcachecheck/multicachechecker.h +++ b/apps/ktcachecheck/multicachechecker.h @@ -35,7 +35,7 @@ namespace ktdebug ~MultiCacheChecker(); - virtual void check(const QString& cache, const QString& index); + virtual void check(const TQString& cache, const TQString& index); }; diff --git a/apps/ktcachecheck/singlecachechecker.cpp b/apps/ktcachecheck/singlecachechecker.cpp index 822c28a..c311db1 100644 --- a/apps/ktcachecheck/singlecachechecker.cpp +++ b/apps/ktcachecheck/singlecachechecker.cpp @@ -40,15 +40,15 @@ namespace ktdebug {} - void SingleCacheChecker::check(const QString& cache, const QString& index) + void SingleCacheChecker::check(const TQString& cache, const TQString& index) { loadIndex(index); Uint32 num_chunks = tor.getNumChunks(); File fptr; if (!fptr.open(cache,"rb")) { - throw Error(QString("Cannot open file : %1 : %2") - .arg(cache).arg( fptr.errorString())); + throw Error(TQString("Cannot open file : %1 : %2") + .tqarg(cache).tqarg( fptr.errorString())); } Uint32 num_ok = 0,num_not_ok = 0,num_not_downloaded = 0,extra_ok = 0; diff --git a/apps/ktcachecheck/singlecachechecker.h b/apps/ktcachecheck/singlecachechecker.h index 2d7b178..fdec69d 100644 --- a/apps/ktcachecheck/singlecachechecker.h +++ b/apps/ktcachecheck/singlecachechecker.h @@ -34,7 +34,7 @@ namespace ktdebug SingleCacheChecker(bt::Torrent& tor); virtual ~SingleCacheChecker(); - virtual void check(const QString& cache, const QString& index); + virtual void check(const TQString& cache, const TQString& index); }; -- cgit v1.2.1