summaryrefslogtreecommitdiffstats
path: root/libktorrent/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'libktorrent/migrate')
-rw-r--r--libktorrent/migrate/cachemigrate.cpp32
-rw-r--r--libktorrent/migrate/cachemigrate.h4
-rw-r--r--libktorrent/migrate/ccmigrate.cpp12
-rw-r--r--libktorrent/migrate/ccmigrate.h4
-rw-r--r--libktorrent/migrate/migrate.cpp6
-rw-r--r--libktorrent/migrate/migrate.h6
6 files changed, 32 insertions, 32 deletions
diff --git a/libktorrent/migrate/cachemigrate.cpp b/libktorrent/migrate/cachemigrate.cpp
index f9b203c..9006e2a 100644
--- a/libktorrent/migrate/cachemigrate.cpp
+++ b/libktorrent/migrate/cachemigrate.cpp
@@ -17,8 +17,8 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstringlist.h>
-#include <qfileinfo.h>
+#include <tqstringlist.h>
+#include <tqfileinfo.h>
#include <util/log.h>
#include <util/fileops.h>
#include <util/functions.h>
@@ -30,21 +30,21 @@
namespace bt
{
- bool IsCacheMigrateNeeded(const Torrent & tor,const QString & cache)
+ bool IsCacheMigrateNeeded(const Torrent & tor,const TQString & cache)
{
// mutli files always need to be migrated
if (tor.isMultiFile())
return true;
// a single file and a symlink do not need to be migrated
- QFileInfo finfo(cache);
+ TQFileInfo finfo(cache);
if (finfo.isSymLink())
return false;
return true;
}
- static void MigrateSingleCache(const Torrent & tor,const QString & cache,const QString & output_dir)
+ static void MigrateSingleCache(const Torrent & tor,const TQString & cache,const TQString & output_dir)
{
Out() << "Migrating single cache " << cache << " to " << output_dir << endl;
@@ -52,12 +52,12 @@ namespace bt
bt::SymLink(output_dir + tor.getNameSuggestion(),cache);
}
- static void MakePath(const QString & startdir,const QString & path)
+ static void MakePath(const TQString & startdir,const TQString & path)
{
- QStringList sl = QStringList::split(bt::DirSeparator(),path);
+ TQStringList sl = TQStringList::split(bt::DirSeparator(),path);
// create all necessary subdirs
- QString ctmp = startdir;
+ TQString ctmp = startdir;
for (Uint32 i = 0;i < sl.count() - 1;i++)
{
@@ -71,22 +71,22 @@ namespace bt
}
}
- static void MigrateMultiCache(const Torrent & tor,const QString & cache,const QString & output_dir)
+ static void MigrateMultiCache(const Torrent & tor,const TQString & cache,const TQString & output_dir)
{
Out() << "Migrating multi cache " << cache << " to " << output_dir << endl;
// if the cache dir is a symlink, everything is OK
- if (QFileInfo(cache).isSymLink())
+ if (TQFileInfo(cache).isSymLink())
return;
- QString cache_dir = cache;
+ TQString cache_dir = cache;
// make the output dir if it does not exists
if (!bt::Exists(output_dir + tor.getNameSuggestion()))
bt::MakeDir(output_dir + tor.getNameSuggestion());
- QString odir = output_dir + tor.getNameSuggestion() + bt::DirSeparator();
- QString cdir = cache;
+ TQString odir = output_dir + tor.getNameSuggestion() + bt::DirSeparator();
+ TQString cdir = cache;
if (!cdir.endsWith(bt::DirSeparator()))
cdir += bt::DirSeparator();
@@ -94,7 +94,7 @@ namespace bt
for (Uint32 i = 0;i < tor.getNumFiles();i++)
{
const TorrentFile & tf = tor.getFile(i);
- QFileInfo fi(cdir + tf.getPath());
+ TQFileInfo fi(cdir + tf.getPath());
// symlinks are OK
if (fi.isSymLink())
continue;
@@ -106,9 +106,9 @@ namespace bt
}
}
- void MigrateCache(const Torrent & tor,const QString & cache,const QString & output_dir)
+ void MigrateCache(const Torrent & tor,const TQString & cache,const TQString & output_dir)
{
- QString odir = output_dir;
+ TQString odir = output_dir;
if (!odir.endsWith(bt::DirSeparator()))
odir += bt::DirSeparator();
diff --git a/libktorrent/migrate/cachemigrate.h b/libktorrent/migrate/cachemigrate.h
index 3eea231..fc618f1 100644
--- a/libktorrent/migrate/cachemigrate.h
+++ b/libktorrent/migrate/cachemigrate.h
@@ -25,10 +25,10 @@ namespace bt
class Torrent;
/// See if a cache migrate is needed
- bool IsCacheMigrateNeeded(const Torrent & tor,const QString & cache);
+ bool IsCacheMigrateNeeded(const Torrent & tor,const TQString & cache);
/// Migrate the cache
- void MigrateCache(const Torrent & tor,const QString & cache,const QString & output_dir);
+ void MigrateCache(const Torrent & tor,const TQString & cache,const TQString & output_dir);
}
#endif
diff --git a/libktorrent/migrate/ccmigrate.cpp b/libktorrent/migrate/ccmigrate.cpp
index 80153bf..3975de4 100644
--- a/libktorrent/migrate/ccmigrate.cpp
+++ b/libktorrent/migrate/ccmigrate.cpp
@@ -33,7 +33,7 @@
namespace bt
{
- bool IsPreMMap(const QString & current_chunks)
+ bool IsPreMMap(const TQString & current_chunks)
{
File fptr;
if (!fptr.open(current_chunks,"rb"))
@@ -110,19 +110,19 @@ namespace bt
return true;
}
- static void MigrateCC(const Torrent & tor,const QString & current_chunks)
+ static void MigrateCC(const Torrent & tor,const TQString & current_chunks)
{
Out() << "Migrating current_chunks file " << current_chunks << endl;
// open the old current_chunks file
File old_cc;
if (!old_cc.open(current_chunks,"rb"))
- throw Error(i18n("Cannot open file %1 : %2").arg(current_chunks).arg(old_cc.errorString()));
+ throw Error(i18n("Cannot open file %1 : %2").tqarg(current_chunks).tqarg(old_cc.errorString()));
// open a new file in the /tmp dir
File new_cc;
- QString tmp = current_chunks + ".tmp";
+ TQString tmp = current_chunks + ".tmp";
if (!new_cc.open(tmp,"wb"))
- throw Error(i18n("Cannot open file %1 : %2").arg(tmp).arg(old_cc.errorString()));
+ throw Error(i18n("Cannot open file %1 : %2").tqarg(tmp).tqarg(old_cc.errorString()));
// read the number of chunks
Uint32 num = 0;
@@ -150,7 +150,7 @@ namespace bt
bt::Move(tmp,current_chunks);
}
- void MigrateCurrentChunks(const Torrent & tor,const QString & current_chunks)
+ void MigrateCurrentChunks(const Torrent & tor,const TQString & current_chunks)
{
try
{
diff --git a/libktorrent/migrate/ccmigrate.h b/libktorrent/migrate/ccmigrate.h
index 890bdfa..5272bf5 100644
--- a/libktorrent/migrate/ccmigrate.h
+++ b/libktorrent/migrate/ccmigrate.h
@@ -25,11 +25,11 @@ namespace bt
class Torrent;
/// Migrates the current_chunks file to the post-mmap era.
- void MigrateCurrentChunks(const Torrent & tor,const QString & current_chunks);
+ void MigrateCurrentChunks(const Torrent & tor,const TQString & current_chunks);
/// Test if a current_chunks file is from the pre-mmap period
- bool IsPreMMap(const QString & current_chunks);
+ bool IsPreMMap(const TQString & current_chunks);
}
diff --git a/libktorrent/migrate/migrate.cpp b/libktorrent/migrate/migrate.cpp
index eddde83..a59f83c 100644
--- a/libktorrent/migrate/migrate.cpp
+++ b/libktorrent/migrate/migrate.cpp
@@ -38,14 +38,14 @@ namespace bt
Migrate::~Migrate()
{}
- void Migrate::migrate(const Torrent & tor,const QString & tor_dir,const QString & sdir)
+ void Migrate::migrate(const Torrent & tor,const TQString & tor_dir,const TQString & sdir)
{
// check if directory exists
if (!bt::Exists(tor_dir))
- throw Error(i18n("The directory %1 does not exist").arg(tor_dir));
+ throw Error(i18n("The directory %1 does not exist").tqarg(tor_dir));
// make sure it ends with a /
- QString tdir = tor_dir;
+ TQString tdir = tor_dir;
if (!tdir.endsWith(bt::DirSeparator()))
tdir += bt::DirSeparator();
diff --git a/libktorrent/migrate/migrate.h b/libktorrent/migrate/migrate.h
index ef862ec..8a943b4 100644
--- a/libktorrent/migrate/migrate.h
+++ b/libktorrent/migrate/migrate.h
@@ -42,10 +42,10 @@ namespace bt
* @param sdir The save directory
* @throw Error if something goes wrong
*/
- void migrate(const Torrent & tor,const QString & tor_dir,const QString & sdir);
+ void migrate(const Torrent & tor,const TQString & tor_dir,const TQString & sdir);
private:
- bool preMMap(const QString & current_chunks);
- void migrateCurrentChunks(const QString & current_chunks);
+ bool preMMap(const TQString & current_chunks);
+ void migrateCurrentChunks(const TQString & current_chunks);
};
}