summaryrefslogtreecommitdiffstats
path: root/libktorrent/util
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:32:56 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:32:56 -0600
commitf96f74ffa7040e64ae3352e08c810c383c8a0ba2 (patch)
tree8f4cdf2f66860234f9ae889cd483b44150affb2c /libktorrent/util
parent0ad9f974f4ad92a3f1458a76d4df26d843efeab7 (diff)
downloadktorrent-f96f74ffa7040e64ae3352e08c810c383c8a0ba2.tar.gz
ktorrent-f96f74ffa7040e64ae3352e08c810c383c8a0ba2.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'libktorrent/util')
-rw-r--r--libktorrent/util/autorotatelogjob.cpp4
-rw-r--r--libktorrent/util/file.cpp4
-rw-r--r--libktorrent/util/fileops.cpp66
-rw-r--r--libktorrent/util/log.cpp10
-rw-r--r--libktorrent/util/profiler.cpp14
-rw-r--r--libktorrent/util/profiler.h2
6 files changed, 50 insertions, 50 deletions
diff --git a/libktorrent/util/autorotatelogjob.cpp b/libktorrent/util/autorotatelogjob.cpp
index d3a2d8a..de4d1c5 100644
--- a/libktorrent/util/autorotatelogjob.cpp
+++ b/libktorrent/util/autorotatelogjob.cpp
@@ -46,8 +46,8 @@ namespace bt
{
while (cnt > 1)
{
- TQString prev = TQString("%1-%2.gz").tqarg(file).tqarg(cnt - 1);
- TQString curr = TQString("%1-%2.gz").tqarg(file).tqarg(cnt);
+ TQString prev = TQString("%1-%2.gz").arg(file).arg(cnt - 1);
+ TQString curr = TQString("%1-%2.gz").arg(file).arg(cnt);
if (bt::Exists(prev)) // if file exists start the move job
{
KIO::Job* sj = KIO::file_move(KURL::fromPathOrURL(prev),KURL::fromPathOrURL(curr),-1,true,false,false);
diff --git a/libktorrent/util/file.cpp b/libktorrent/util/file.cpp
index f757142..d27ccba 100644
--- a/libktorrent/util/file.cpp
+++ b/libktorrent/util/file.cpp
@@ -84,7 +84,7 @@ namespace bt
if (errno == ENOSPC)
Out() << "Disk full !" << endl;
- throw Error(i18n("Cannot write to %1 : %2").tqarg(file).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot write to %1 : %2").arg(file).arg(strerror(errno)));
}
return ret;
}
@@ -98,7 +98,7 @@ namespace bt
if (ferror(fptr))
{
clearerr(fptr);
- throw Error(i18n("Cannot read from %1").tqarg(file));
+ throw Error(i18n("Cannot read from %1").arg(file));
}
return ret;
}
diff --git a/libktorrent/util/fileops.cpp b/libktorrent/util/fileops.cpp
index a83134a..d9ef172 100644
--- a/libktorrent/util/fileops.cpp
+++ b/libktorrent/util/fileops.cpp
@@ -76,10 +76,10 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot create directory %1: %2")
- .tqarg(dir).tqarg(strerror(errno)));
+ .arg(dir).arg(strerror(errno)));
else
{
- Out() << TQString("Error : Cannot create directory %1 : %2").tqarg(dir).tqarg(strerror(errno))<< endl;
+ Out() << TQString("Error : Cannot create directory %1 : %2").arg(dir).arg(strerror(errno))<< endl;
}
}
}
@@ -90,12 +90,12 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot symlink %1 to %2: %3")
- .tqarg(link_url.utf8().data()).tqarg(link_to.utf8().data())
- .tqarg(strerror(errno)));
+ .arg(link_url.utf8().data()).arg(link_to.utf8().data())
+ .arg(strerror(errno)));
else
Out() << TQString("Error : Cannot symlink %1 to %2: %3")
- .tqarg(link_url.utf8().data()).tqarg(link_to.utf8().data())
- .tqarg(strerror(errno)) << endl;
+ .arg(link_url.utf8().data()).arg(link_to.utf8().data())
+ .arg(strerror(errno)) << endl;
}
}
@@ -106,12 +106,12 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot move %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()));
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot move %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()) << endl;
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()) << endl;
}
}
@@ -122,12 +122,12 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot copy %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()));
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot copy %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()) << endl;
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()) << endl;
}
}
@@ -138,12 +138,12 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot copy %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()));
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()));
else
Out() << TQString("Error : Cannot copy %1 to %2: %3")
- .tqarg(src).tqarg(dst)
- .tqarg(KIO::NetAccess::lastErrorString()) << endl;
+ .arg(src).arg(dst)
+ .arg(KIO::NetAccess::lastErrorString()) << endl;
}
}
@@ -230,8 +230,8 @@ namespace bt
if (!ok)
{
TQString err = i18n("Cannot delete %1: %2")
- .tqarg(url)
- .tqarg(strerror(errno));
+ .arg(url)
+ .arg(strerror(errno));
if (!nothrow)
throw Error(err);
else
@@ -249,8 +249,8 @@ namespace bt
{
if (!nothrow)
throw Error(i18n("Cannot create %1: %2")
- .tqarg(url)
- .tqarg(fptr.errorString()));
+ .arg(url)
+ .arg(fptr.errorString()));
else
Out() << "Error : Cannot create " << url << " : "
<< fptr.errorString() << endl;
@@ -270,7 +270,7 @@ namespace bt
#endif
if (ret < 0)
throw Error(i18n("Cannot calculate the filesize of %1: %2")
- .tqarg(url).tqarg(strerror(errno)));
+ .arg(url).arg(strerror(errno)));
return (Uint64)sb.st_size;
}
@@ -286,7 +286,7 @@ namespace bt
ret = fstat(fd,&sb);
#endif
if (ret < 0)
- throw Error(i18n("Cannot calculate the filesize : %2").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot calculate the filesize : %2").arg(strerror(errno)));
return (Uint64)sb.st_size;
}
@@ -314,7 +314,7 @@ namespace bt
{
int fd = ::open(TQFile::encodeName(path),O_RDWR | O_LARGEFILE);
if (fd < 0)
- throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno)));
bool ret = FatPreallocate(fd,size);
close(fd);
@@ -343,7 +343,7 @@ namespace bt
{
int fd = ::open(TQFile::encodeName(path), O_RDWR | O_LARGEFILE);
if (fd < 0)
- throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno)));
bool ret = XfsPreallocate(fd,size);
close(fd);
@@ -364,16 +364,16 @@ namespace bt
#else
if (ftruncate(fd,size) == -1)
#endif
- throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file : %1").arg(strerror(errno)));
}
else
{
#if HAVE_POSIX_FALLOCATE64
if (posix_fallocate64(fd,0,size) != 0)
- throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file : %1").arg(strerror(errno)));
#elif HAVE_POSIX_FALLOCATE
if (posix_fallocate(fd,0,size) != 0)
- throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file : %1").arg(strerror(errno)));
#else
SeekFile(fd,0,SEEK_SET);
bt::Array<Uint8> buf(4096);
@@ -388,9 +388,9 @@ namespace bt
int ret = write(fd,buf,to_write);
if (ret < 0)
- throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file : %1").arg(strerror(errno)));
else if (ret == 0 || ret != (int)to_write)
- throw Error(i18n("Cannot expand file").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file").arg(strerror(errno)));
else
written += to_write;
}
@@ -402,7 +402,7 @@ namespace bt
{
int fd = ::open(TQFile::encodeName(path),O_RDWR | O_LARGEFILE);
if (fd < 0)
- throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno)));
try
{
@@ -423,7 +423,7 @@ namespace bt
#else
if (lseek(fd,off,whence) == -1)
#endif
- throw Error(i18n("Cannot seek in file : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot seek in file : %1").arg(strerror(errno)));
}
bool FreeDiskSpace(const TQString & path,Uint64 & bytes_free)
diff --git a/libktorrent/util/log.cpp b/libktorrent/util/log.cpp
index 6030e99..9594532 100644
--- a/libktorrent/util/log.cpp
+++ b/libktorrent/util/log.cpp
@@ -22,7 +22,7 @@
#include <kprocess.h>
#include <klocale.h>
#include <tqdatetime.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqfile.h>
#include <tqptrlist.h>
#include <iostream>
@@ -79,8 +79,8 @@ namespace bt
// move all log files one up
for (Uint32 i = 10;i > 1;i--)
{
- TQString prev = TQString("%1-%2.gz").tqarg(file).tqarg(i - 1);
- TQString curr = TQString("%1-%2.gz").tqarg(file).tqarg(i);
+ TQString prev = TQString("%1-%2.gz").arg(file).arg(i - 1);
+ TQString curr = TQString("%1-%2.gz").arg(file).arg(i);
if (bt::Exists(prev))
bt::Move(prev,curr,true);
}
@@ -100,7 +100,7 @@ namespace bt
fptr.setName(file);
if (!fptr.open(IO_WriteOnly))
- throw Error(i18n("Cannot open log file %1 : %2").tqarg(file).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open log file %1 : %2").arg(file).arg(fptr.errorString()));
out->setDevice(TQT_TQIODEVICE(&fptr));
}
@@ -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;
diff --git a/libktorrent/util/profiler.cpp b/libktorrent/util/profiler.cpp
index a0f42d2..3cacbe3 100644
--- a/libktorrent/util/profiler.cpp
+++ b/libktorrent/util/profiler.cpp
@@ -19,7 +19,7 @@
***************************************************************************/
#ifdef KT_PROFILE
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <sys/time.h>
#include "profiler.h"
@@ -30,7 +30,7 @@ namespace bt
min = max = avg = 0.0;
count = 0;
start_time = 0.0;
- tqchildren.setAutoDelete(true);
+ children.setAutoDelete(true);
}
Profile::~Profile()
@@ -63,8 +63,8 @@ namespace bt
Profile* Profile::child(const TQString & name)
{
- TQPtrList<Profile>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQPtrList<Profile>::iterator i = children.begin();
+ while (i != children.end())
{
Profile* p = *i;
if (p->name == name)
@@ -73,7 +73,7 @@ namespace bt
}
Profile* p = new Profile(this,name);
- tqchildren.append(p);
+ children.append(p);
return p;
}
@@ -84,8 +84,8 @@ namespace bt
out.precision(5);
out << qSetW(60) << nb << qSetW(10) << min << qSetW(10) << max << qSetW(10) << avg << qSetW(10) << count << endl;
- TQPtrList<Profile>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQPtrList<Profile>::iterator i = children.begin();
+ while (i != children.end())
{
Profile* p = *i;
p->save(out,nb);
diff --git a/libktorrent/util/profiler.h b/libktorrent/util/profiler.h
index 917a671..1b220b1 100644
--- a/libktorrent/util/profiler.h
+++ b/libktorrent/util/profiler.h
@@ -35,7 +35,7 @@ namespace bt
class Profile
{
Profile* parent;
- TQPtrList<Profile> tqchildren;
+ TQPtrList<Profile> children;
TQString name;
double min,max,avg;