summaryrefslogtreecommitdiffstats
path: root/libktorrent/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'libktorrent/interfaces')
-rw-r--r--libktorrent/interfaces/chunkdownloadinterface.h4
-rw-r--r--libktorrent/interfaces/coreinterface.h23
-rw-r--r--libktorrent/interfaces/exitoperation.cpp2
-rw-r--r--libktorrent/interfaces/exitoperation.h6
-rw-r--r--libktorrent/interfaces/filetreediritem.cpp80
-rw-r--r--libktorrent/interfaces/filetreediritem.h34
-rw-r--r--libktorrent/interfaces/filetreeitem.cpp16
-rw-r--r--libktorrent/interfaces/filetreeitem.h14
-rw-r--r--libktorrent/interfaces/functions.cpp22
-rw-r--r--libktorrent/interfaces/functions.h8
-rw-r--r--libktorrent/interfaces/guiinterface.cpp2
-rw-r--r--libktorrent/interfaces/guiinterface.h34
-rw-r--r--libktorrent/interfaces/ipblockinginterface.h4
-rw-r--r--libktorrent/interfaces/logmonitorinterface.h4
-rw-r--r--libktorrent/interfaces/peerinterface.h6
-rw-r--r--libktorrent/interfaces/peersource.cpp2
-rw-r--r--libktorrent/interfaces/peersource.h13
-rw-r--r--libktorrent/interfaces/plugin.cpp10
-rw-r--r--libktorrent/interfaces/plugin.h35
-rw-r--r--libktorrent/interfaces/prefpageinterface.cpp4
-rw-r--r--libktorrent/interfaces/prefpageinterface.h22
-rw-r--r--libktorrent/interfaces/torrentfileinterface.cpp2
-rw-r--r--libktorrent/interfaces/torrentfileinterface.h13
-rw-r--r--libktorrent/interfaces/torrentinterface.h41
24 files changed, 204 insertions, 197 deletions
diff --git a/libktorrent/interfaces/chunkdownloadinterface.h b/libktorrent/interfaces/chunkdownloadinterface.h
index 161a534..0945006 100644
--- a/libktorrent/interfaces/chunkdownloadinterface.h
+++ b/libktorrent/interfaces/chunkdownloadinterface.h
@@ -20,7 +20,7 @@
#ifndef KTCHUNKDOWNLOADINTERFACE_H
#define KTCHUNKDOWNLOADINTERFACE_H
-#include <qstring.h>
+#include <tqstring.h>
#include <util/constants.h>
namespace kt
@@ -41,7 +41,7 @@ namespace kt
struct Stats
{
/// The PeerID of the current downloader
- QString current_peer_id;
+ TQString current_peer_id;
/// The current download speed
bt::Uint32 download_speed;
/// The index of the chunk
diff --git a/libktorrent/interfaces/coreinterface.h b/libktorrent/interfaces/coreinterface.h
index 613ba8e..9ca2ae1 100644
--- a/libktorrent/interfaces/coreinterface.h
+++ b/libktorrent/interfaces/coreinterface.h
@@ -21,7 +21,7 @@
#define KTCOREINTERFACE_H
#include <kurl.h>
-#include <qobject.h>
+#include <tqobject.h>
#include <util/constants.h>
#include <torrent/queuemanager.h>
@@ -50,9 +50,10 @@ namespace kt
* the applications core, the core is responsible for managing all
* TorrentControl objects.
*/
- class CoreInterface : public QObject
+ class CoreInterface : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
CoreInterface();
virtual ~CoreInterface();
@@ -83,7 +84,7 @@ namespace kt
* and leaves everything where it supposed to be.
* @param new_dir The new directory
*/
- virtual bool changeDataDir(const QString & new_dir) = 0;
+ virtual bool changeDataDir(const TQString & new_dir) = 0;
/**
* Start all, takes into account the maximum number of downloads.
@@ -141,7 +142,7 @@ namespace kt
* @param savedir Dir to save the data
* @param silently Wether or not to do this silently
*/
- virtual bool load(const QString & file,const QString & savedir,bool silently) = 0;
+ virtual bool load(const TQString & file,const TQString & savedir,bool silently) = 0;
/**
* Load a torrent file. Pops up an error dialog
@@ -171,31 +172,31 @@ namespace kt
/**
* Inserts IP range to be blocked into IPBlocklist
- * @param ip QString reference to single IP or IP range. For example:
+ * @param ip TQString reference to single IP or IP range. For example:
* single - 127.0.0.5
* range - 127.0.*.*
**/
- virtual void addBlockedIP(QString& ip) = 0;
+ virtual void addBlockedIP(TQString& ip) = 0;
/**
* Removes IP range from IPBlocklist
- * @param ip QString reference to single IP or IP range. For example:
+ * @param ip TQString reference to single IP or IP range. For example:
* single - 127.0.0.5
* range - 127.0.*.*
**/
- virtual void removeBlockedIP(QString& ip) = 0;
+ virtual void removeBlockedIP(TQString& ip) = 0;
/**
* Find the next free torX dir.
* @return Path to the dir (including the torX part)
*/
- virtual QString findNewTorrentDir() const = 0;
+ virtual TQString findNewTorrentDir() const = 0;
/**
* Load an existing torrent, which has already a properly set up torX dir.
* @param tor_dir The torX dir
*/
- virtual void loadExistingTorrent(const QString & tor_dir) = 0;
+ virtual void loadExistingTorrent(const TQString & tor_dir) = 0;
/**
* Returns maximum allowed download speed.
@@ -250,7 +251,7 @@ namespace kt
* @param tc TorrentInterface
* @param msg Error message
*/
- void torrentStoppedByError(kt::TorrentInterface* tc, QString msg);
+ void torrentStoppedByError(kt::TorrentInterface* tc, TQString msg);
};
}
diff --git a/libktorrent/interfaces/exitoperation.cpp b/libktorrent/interfaces/exitoperation.cpp
index 8eedb7a..08a39df 100644
--- a/libktorrent/interfaces/exitoperation.cpp
+++ b/libktorrent/interfaces/exitoperation.cpp
@@ -31,7 +31,7 @@ namespace kt
ExitJobOperation::ExitJobOperation(KIO::Job* j)
{
- connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(onResult( KIO::Job* )));
+ connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onResult( KIO::Job* )));
}
ExitJobOperation::~ExitJobOperation()
diff --git a/libktorrent/interfaces/exitoperation.h b/libktorrent/interfaces/exitoperation.h
index edaa2fa..4cad283 100644
--- a/libktorrent/interfaces/exitoperation.h
+++ b/libktorrent/interfaces/exitoperation.h
@@ -20,7 +20,7 @@
#ifndef KTEXITOPERATION_H
#define KTEXITOPERATION_H
-#include <qobject.h>
+#include <tqobject.h>
#include <kio/job.h>
namespace kt
@@ -35,9 +35,10 @@ namespace kt
* ExitOperation's can be used in combination with a WaitJob, to wait for a certain amount of time
* to give serveral ExitOperation's the time time to finish up.
*/
- class ExitOperation : public QObject
+ class ExitOperation : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
ExitOperation();
virtual ~ExitOperation();
@@ -54,6 +55,7 @@ namespace kt
class ExitJobOperation : public ExitOperation
{
Q_OBJECT
+ TQ_OBJECT
public:
ExitJobOperation(KIO::Job* j);
virtual ~ExitJobOperation();
diff --git a/libktorrent/interfaces/filetreediritem.cpp b/libktorrent/interfaces/filetreediritem.cpp
index b294015..54c1953 100644
--- a/libktorrent/interfaces/filetreediritem.cpp
+++ b/libktorrent/interfaces/filetreediritem.cpp
@@ -34,10 +34,10 @@ using namespace bt;
namespace kt
{
- FileTreeDirItem::FileTreeDirItem(KListView* klv,const QString & name,FileTreeRootListener* rl)
- : QCheckListItem(klv,QString::null,QCheckListItem::CheckBox),name(name),root_listener(rl)
+ FileTreeDirItem::FileTreeDirItem(KListView* klv,const TQString & name,FileTreeRootListener* rl)
+ : TQCheckListItem(klv,TQString(),TQCheckListItem::CheckBox),name(name),root_listener(rl)
{
- parent = 0;
+ tqparent = 0;
size = 0;
setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setText(0,name);
@@ -48,9 +48,9 @@ namespace kt
manual_change = false;
}
- FileTreeDirItem::FileTreeDirItem(FileTreeDirItem* parent,const QString & name)
- : QCheckListItem(parent,QString::null,QCheckListItem::CheckBox),
- name(name),parent(parent)
+ FileTreeDirItem::FileTreeDirItem(FileTreeDirItem* tqparent,const TQString & name)
+ : TQCheckListItem(tqparent,TQString(),TQCheckListItem::CheckBox),
+ name(name),tqparent(tqparent)
{
size = 0;
setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
@@ -66,19 +66,19 @@ namespace kt
{
}
- void FileTreeDirItem::insert(const QString & path,kt::TorrentFileInterface & file)
+ void FileTreeDirItem::insert(const TQString & path,kt::TorrentFileInterface & file)
{
size += file.getSize();
setText(1,BytesToString(size));
- int p = path.find(bt::DirSeparator());
+ int p = path.tqfind(bt::DirSeparator());
if (p == -1)
{
- children.insert(path,newFileTreeItem(path,file));
+ tqchildren.insert(path,newFileTreeItem(path,file));
}
else
{
- QString subdir = path.left(p);
- FileTreeDirItem* sd = subdirs.find(subdir);
+ TQString subdir = path.left(p);
+ FileTreeDirItem* sd = subdirs.tqfind(subdir);
if (!sd)
{
sd = newFileTreeDirItem(subdir);
@@ -98,15 +98,15 @@ namespace kt
manual_change = false;
}
// first set all the child items
- bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin();
- while (i != children.end())
+ bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin();
+ while (i != tqchildren.end())
{
i->second->setChecked(on,keep_data);
i++;
}
// then recursivly move on to subdirs
- bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin();
+ bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin();
while (j != subdirs.end())
{
j->second->setAllChecked(on,keep_data);
@@ -118,8 +118,8 @@ namespace kt
void FileTreeDirItem::invertChecked()
{
// first set all the child items
- bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin();
- while (i != children.end())
+ bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin();
+ while (i != tqchildren.end())
{
FileTreeItem* item = i->second;
item->setChecked(!item->isOn());
@@ -127,7 +127,7 @@ namespace kt
}
// then recursivly move on to subdirs
- bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin();
+ bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin();
while (j != subdirs.end())
{
j->second->invertChecked();
@@ -161,8 +161,8 @@ namespace kt
return;
}
}
- if (parent)
- parent->childStateChange();
+ if (tqparent)
+ tqparent->childStateChange();
}
setText(2,on ? i18n("Yes") : i18n("No"));
}
@@ -171,8 +171,8 @@ namespace kt
{
Uint64 tot = 0;
// first check all the child items
- bt::PtrMap<QString,FileTreeItem>::const_iterator i = children.begin();
- while (i != children.end())
+ bt::PtrMap<TQString,FileTreeItem>::const_iterator i = tqchildren.begin();
+ while (i != tqchildren.end())
{
const FileTreeItem* item = i->second;
tot += item->bytesToDownload();
@@ -180,7 +180,7 @@ namespace kt
}
// then recursivly move on to subdirs
- bt::PtrMap<QString,FileTreeDirItem>::const_iterator j = subdirs.begin();
+ bt::PtrMap<TQString,FileTreeDirItem>::const_iterator j = subdirs.begin();
while (j != subdirs.end())
{
tot += j->second->bytesToDownload();
@@ -192,8 +192,8 @@ namespace kt
bool FileTreeDirItem::allChildrenOn()
{
// first check all the child items
- bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin();
- while (i != children.end())
+ bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin();
+ while (i != tqchildren.end())
{
FileTreeItem* item = i->second;
if (!item->isOn())
@@ -202,7 +202,7 @@ namespace kt
}
// then recursivly move on to subdirs
- bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin();
+ bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin();
while (j != subdirs.end())
{
if (!j->second->allChildrenOn())
@@ -214,19 +214,19 @@ namespace kt
void FileTreeDirItem::childStateChange()
{
- // only set this dir on if all children are on
+ // only set this dir on if all tqchildren are on
manual_change = true;
setOn(allChildrenOn());
manual_change = false;
- if (parent)
- parent->childStateChange();
+ if (tqparent)
+ tqparent->childStateChange();
else if (root_listener)
root_listener->treeItemChanged();
}
- int FileTreeDirItem::compare(QListViewItem* i, int col, bool ascending) const
+ int FileTreeDirItem::compare(TQListViewItem* i, int col, bool ascending) const
{
if (col == 1)
{
@@ -238,18 +238,18 @@ namespace kt
}
else
{
- //return QCheckListItem::compare(i, col, ascending);
+ //return TQCheckListItem::compare(i, col, ascending);
// case insensitive comparison
- return QString::compare(text(col).lower(),i->text(col).lower());
+ return TQString::compare(text(col).lower(),i->text(col).lower());
}
}
- TorrentFileInterface & FileTreeDirItem::findTorrentFile(QListViewItem* item)
+ TorrentFileInterface & FileTreeDirItem::findTorrentFile(TQListViewItem* item)
{
// first check all the child items
TorrentFileInterface & nullfile = (TorrentFileInterface &)TorrentFile::null;
- bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin();
- while (i != children.end())
+ bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin();
+ while (i != tqchildren.end())
{
FileTreeItem* file = i->second;
if (file == (FileTreeItem*)item)
@@ -258,7 +258,7 @@ namespace kt
}
// then recursivly move on to subdirs
- bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin();
+ bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin();
while (j != subdirs.end())
{
TorrentFileInterface & thefile = j->second->findTorrentFile(item);
@@ -269,12 +269,12 @@ namespace kt
return nullfile;
}
- FileTreeItem* FileTreeDirItem::newFileTreeItem(const QString & name,TorrentFileInterface & file)
+ FileTreeItem* FileTreeDirItem::newFileTreeItem(const TQString & name,TorrentFileInterface & file)
{
return new FileTreeItem(this,name,file);
}
- FileTreeDirItem* FileTreeDirItem::newFileTreeDirItem(const QString & subdir)
+ FileTreeDirItem* FileTreeDirItem::newFileTreeDirItem(const TQString & subdir)
{
return new FileTreeDirItem(this,subdir);
}
@@ -284,12 +284,12 @@ namespace kt
return bt::THROW_AWAY_DATA;
}
- QString FileTreeDirItem::getPath() const
+ TQString FileTreeDirItem::getPath() const
{
- if (!parent)
+ if (!tqparent)
return bt::DirSeparator();
else
- return parent->getPath() + name + bt::DirSeparator();
+ return tqparent->getPath() + name + bt::DirSeparator();
}
}
diff --git a/libktorrent/interfaces/filetreediritem.h b/libktorrent/interfaces/filetreediritem.h
index 00650f2..9afdbd1 100644
--- a/libktorrent/interfaces/filetreediritem.h
+++ b/libktorrent/interfaces/filetreediritem.h
@@ -44,41 +44,41 @@ namespace kt
*
* Directory item the file tree showing the files in a multifile torrent
*/
- class FileTreeDirItem : public QCheckListItem
+ class FileTreeDirItem : public TQCheckListItem
{
protected:
- QString name;
+ TQString name;
Uint64 size;
- bt::PtrMap<QString,FileTreeItem> children;
- bt::PtrMap<QString,FileTreeDirItem> subdirs;
- FileTreeDirItem* parent;
+ bt::PtrMap<TQString,FileTreeItem> tqchildren;
+ bt::PtrMap<TQString,FileTreeDirItem> subdirs;
+ FileTreeDirItem* tqparent;
bool manual_change;
FileTreeRootListener* root_listener;
public:
- FileTreeDirItem(KListView* klv,const QString & name,FileTreeRootListener* rl = 0);
- FileTreeDirItem(FileTreeDirItem* parent,const QString & name);
+ FileTreeDirItem(KListView* klv,const TQString & name,FileTreeRootListener* rl = 0);
+ FileTreeDirItem(FileTreeDirItem* tqparent,const TQString & name);
virtual ~FileTreeDirItem();
/// Get the path of the directory (if this is the root directory / will be returned)
- QString getPath() const;
+ TQString getPath() const;
/**
* Recursively insert a TorrentFileInterface.
* @param path Path of file
* @param file File itself
*/
- void insert(const QString & path,kt::TorrentFileInterface & file);
+ void insert(const TQString & path,kt::TorrentFileInterface & file);
/**
* Recursivly walk the tree to find the TorrentFile which
- * is shown by a QListViewItem (which should be an FileTreeItem).
+ * is shown by a TQListViewItem (which should be an FileTreeItem).
* If item can't be found or item is an FileTreeDirItem, a reference to
* TorrentFile::null will be returned. In which case the isNull() function
* of TorrentFile will return true
- * @param item Pointer to the QListViewItem
+ * @param item Pointer to the TQListViewItem
* @return A reference to the TorrentFile
*/
- kt::TorrentFileInterface & findTorrentFile(QListViewItem* item);
+ kt::TorrentFileInterface & findTorrentFile(TQListViewItem* item);
/**
* Set all items checked or not.
@@ -93,11 +93,11 @@ namespace kt
void invertChecked();
/**
- * Called by the child to notify the parent it's state has changed.
+ * Called by the child to notify the tqparent it's state has changed.
*/
void childStateChange();
- FileTreeDirItem* getParent() {return parent;}
+ FileTreeDirItem* getParent() {return tqparent;}
/// Recusively get the total number of bytes to download
Uint64 bytesToDownload() const;
@@ -110,7 +110,7 @@ namespace kt
* @param file The TorrentFileInterface
* @return A newly created FileTreeItem
*/
- virtual FileTreeItem* newFileTreeItem(const QString & name,
+ virtual FileTreeItem* newFileTreeItem(const TQString & name,
TorrentFileInterface & file);
@@ -120,7 +120,7 @@ namespace kt
* @param subdir The name of the subdir
* @return A newly created FileTreeDirItem
*/
- virtual FileTreeDirItem* newFileTreeDirItem(const QString & subdir);
+ virtual FileTreeDirItem* newFileTreeDirItem(const TQString & subdir);
/**
@@ -131,7 +131,7 @@ namespace kt
private:
virtual void stateChange(bool on);
- virtual int compare(QListViewItem* i, int col, bool ascending) const;
+ virtual int compare(TQListViewItem* i, int col, bool ascending) const;
bool allChildrenOn();
};
diff --git a/libktorrent/interfaces/filetreeitem.cpp b/libktorrent/interfaces/filetreeitem.cpp
index 32f265c..666c1a0 100644
--- a/libktorrent/interfaces/filetreeitem.cpp
+++ b/libktorrent/interfaces/filetreeitem.cpp
@@ -32,10 +32,10 @@ using namespace bt;
namespace kt
{
- FileTreeItem::FileTreeItem(FileTreeDirItem* item,const QString & name,kt::TorrentFileInterface & file)
- : QCheckListItem(item,QString::null,QCheckListItem::CheckBox),name(name),file(file)
+ FileTreeItem::FileTreeItem(FileTreeDirItem* item,const TQString & name,kt::TorrentFileInterface & file)
+ : TQCheckListItem(item,TQString(),TQCheckListItem::CheckBox),name(name),file(file)
{
- parent = item;
+ tqparent = item;
manual_change = false;
init();
}
@@ -66,7 +66,7 @@ namespace kt
}
updatePriorityText();
- parent->childStateChange();
+ tqparent->childStateChange();
}
void FileTreeItem::updatePriorityText()
@@ -141,10 +141,10 @@ namespace kt
}
updatePriorityText();
- parent->childStateChange();
+ tqparent->childStateChange();
}
- int FileTreeItem::compare(QListViewItem* i, int col, bool ascending) const
+ int FileTreeItem::compare(TQListViewItem* i, int col, bool ascending) const
{
if (col == 1)
{
@@ -157,8 +157,8 @@ namespace kt
else
{
// lets sort case insensitive
- return QString::compare(text(col).lower(),i->text(col).lower());
- // QCheckListItem::compare(i, col, ascending);
+ return TQString::compare(text(col).lower(),i->text(col).lower());
+ // TQCheckListItem::compare(i, col, ascending);
}
}
diff --git a/libktorrent/interfaces/filetreeitem.h b/libktorrent/interfaces/filetreeitem.h
index 6f9f1b1..6d6ed79 100644
--- a/libktorrent/interfaces/filetreeitem.h
+++ b/libktorrent/interfaces/filetreeitem.h
@@ -37,25 +37,25 @@ namespace kt
* @author Joris Guisson
*
* File item part of a tree which shows the files in a multifile torrent.
- * This is derived from QCheckListItem, if the user checks or unchecks the box,
+ * This is derived from TQCheckListItem, if the user checks or unchecks the box,
* wether or not to download a file will be changed.
*/
- class FileTreeItem : public QCheckListItem
+ class FileTreeItem : public TQCheckListItem
{
protected:
- QString name;
+ TQString name;
TorrentFileInterface & file;
- FileTreeDirItem* parent;
+ FileTreeDirItem* tqparent;
bool manual_change;
public:
/**
- * Constructor, set the parent, name and file
+ * Constructor, set the tqparent, name and file
* @param item Parent item
* @param name Name of file
* @param file THe TorrentFileInterface
* @return
*/
- FileTreeItem(FileTreeDirItem* item,const QString & name,TorrentFileInterface & file);
+ FileTreeItem(FileTreeDirItem* item,const TQString & name,TorrentFileInterface & file);
virtual ~FileTreeItem();
/// Get a reference to the TorrentFileInterface
@@ -78,7 +78,7 @@ namespace kt
void updatePriorityText();
protected:
- virtual int compare(QListViewItem* i, int col, bool ascending) const;
+ virtual int compare(TQListViewItem* i, int col, bool ascending) const;
/**
* Subclasses should override this if they want to show a confirmation dialog.
diff --git a/libktorrent/interfaces/functions.cpp b/libktorrent/interfaces/functions.cpp
index 2c6286f..cade53a 100644
--- a/libktorrent/interfaces/functions.cpp
+++ b/libktorrent/interfaces/functions.cpp
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <klocale.h>
#include <kglobal.h>
#include "functions.h"
@@ -28,32 +28,32 @@ namespace kt
{
- QString BytesToString(Uint64 bytes,int precision)
+ TQString BytesToString(Uint64 bytes,int precision)
{
KLocale* loc = KGlobal::locale();
if (bytes >= 1024 * 1024 * 1024)
- return i18n("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
+ return i18n("%1 GB").tqarg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
else if (bytes >= 1024*1024)
- return i18n("%1 MB").arg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision));
+ return i18n("%1 MB").tqarg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision));
else if (bytes >= 1024)
- return i18n("%1 KB").arg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision));
+ return i18n("%1 KB").tqarg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision));
else
- return i18n("%1 B").arg(bytes);
+ return i18n("%1 B").tqarg(bytes);
}
- QString KBytesPerSecToString(double speed,int precision)
+ TQString KBytesPerSecToString(double speed,int precision)
{
KLocale* loc = KGlobal::locale();
- return i18n("%1 KB/s").arg(loc->formatNumber(speed,precision));
+ return i18n("%1 KB/s").tqarg(loc->formatNumber(speed,precision));
}
- QString DurationToString(Uint32 nsecs)
+ TQString DurationToString(Uint32 nsecs)
{
KLocale* loc = KGlobal::locale();
- QTime t;
+ TQTime t;
int ndays = nsecs / 86400;
t = t.addSecs(nsecs % 86400);
- QString s = loc->formatTime(t,true,true);
+ TQString s = loc->formatTime(t,true,true);
if (ndays > 0)
s = i18n("1 day ","%n days ",ndays) + s;
diff --git a/libktorrent/interfaces/functions.h b/libktorrent/interfaces/functions.h
index 1bf7178..4ffe9a9 100644
--- a/libktorrent/interfaces/functions.h
+++ b/libktorrent/interfaces/functions.h
@@ -20,7 +20,7 @@
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
-#include <qstring.h>
+#include <tqstring.h>
#include <util/constants.h>
namespace kt
@@ -29,9 +29,9 @@ namespace kt
const double TO_MEG = (1024.0 * 1024.0);
const double TO_GIG = (1024.0 * 1024.0 * 1024.0);
- QString BytesToString(bt::Uint64 bytes,int precision = -1);
- QString KBytesPerSecToString(double speed,int precision = 1);
- QString DurationToString(bt::Uint32 nsecs);
+ TQString BytesToString(bt::Uint64 bytes,int precision = -1);
+ TQString KBytesPerSecToString(double speed,int precision = 1);
+ TQString DurationToString(bt::Uint32 nsecs);
template<class T> int CompareVal(T a,T b)
{
diff --git a/libktorrent/interfaces/guiinterface.cpp b/libktorrent/interfaces/guiinterface.cpp
index 8a87d90..635415e 100644
--- a/libktorrent/interfaces/guiinterface.cpp
+++ b/libktorrent/interfaces/guiinterface.cpp
@@ -33,7 +33,7 @@ namespace kt
void GUIInterface::notifyViewListeners(TorrentInterface* tc)
{
- QPtrList<ViewListener>::iterator i = listeners.begin();
+ TQPtrList<ViewListener>::iterator i = listeners.begin();
while (i != listeners.end())
{
ViewListener* vl = *i;
diff --git a/libktorrent/interfaces/guiinterface.h b/libktorrent/interfaces/guiinterface.h
index a263bb6..6fbab7e 100644
--- a/libktorrent/interfaces/guiinterface.h
+++ b/libktorrent/interfaces/guiinterface.h
@@ -20,11 +20,11 @@
#ifndef KTGUIINTERFACE_H
#define KTGUIINTERFACE_H
-#include <qptrlist.h>
+#include <tqptrlist.h>
-class QWidget;
-class QIconSet;
-class QString;
+class TQWidget;
+class TQIconSet;
+class TQString;
class KToolBar;
class KProgress;
@@ -65,10 +65,10 @@ namespace kt
{
public:
/// By default all tabs can be closed, but this can be overridden
- virtual bool closeAllowed(QWidget* ) {return true;}
+ virtual bool closeAllowed(TQWidget* ) {return true;}
/// THe close button was pressed for this tab, please remove it from the GUI
- virtual void tabCloseRequest(kt::GUIInterface* gui,QWidget* tab) = 0;
+ virtual void tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab) = 0;
};
/**
@@ -79,7 +79,7 @@ namespace kt
*/
class GUIInterface
{
- QPtrList<ViewListener> listeners;
+ TQPtrList<ViewListener> listeners;
public:
GUIInterface();
virtual ~GUIInterface();
@@ -104,15 +104,15 @@ namespace kt
* @param caption Text on the tab
* @param ctl For closeable tabs this pointer should be set
*/
- virtual void addTabPage(QWidget* page,const QIconSet & icon,
- const QString & caption,CloseTabListener* ctl = 0) = 0;
+ virtual void addTabPage(TQWidget* page,const TQIconSet & icon,
+ const TQString & caption,CloseTabListener* ctl = 0) = 0;
/**
* Remove a tab page, does nothing if the page
* isn't added. Does not delete the widget.
* @param page The page
*/
- virtual void removeTabPage(QWidget* page) = 0;
+ virtual void removeTabPage(TQWidget* page) = 0;
/**
* Add a page to the preference dialog.
@@ -131,7 +131,7 @@ namespace kt
* Change the statusbar message.
* @param msg The new message
*/
- virtual void changeStatusbar(const QString& msg) = 0;
+ virtual void changeStatusbar(const TQString& msg) = 0;
/**
* Merge the GUI of a plugin.
@@ -151,14 +151,14 @@ namespace kt
* @param w The widget
* @param pos How the widget will be positioned against the already present widgets
*/
- virtual void addWidgetInView(QWidget* w,Position pos) = 0;
+ virtual void addWidgetInView(TQWidget* w,Position pos) = 0;
/**
* Remove a widget added with addWidgetInView.
* The widget will be reparented to 0.
* @param w The widget
*/
- virtual void removeWidgetFromView(QWidget* w) = 0;
+ virtual void removeWidgetFromView(TQWidget* w) = 0;
/**
* Add a widget below the view.
@@ -166,13 +166,13 @@ namespace kt
* @param icon Name of icon to use
* @param caption The caption to use
*/
- virtual void addWidgetBelowView(QWidget* w,const QString & icon,const QString & caption) = 0;
+ virtual void addWidgetBelowView(TQWidget* w,const TQString & icon,const TQString & caption) = 0;
/**
* Remove a widget, which was added below the view.
* @param w The widget
*/
- virtual void removeWidgetBelowView(QWidget* w) = 0;
+ virtual void removeWidgetBelowView(TQWidget* w) = 0;
enum ToolDock
{
@@ -188,13 +188,13 @@ namespace kt
* @param caption The caption to use
* @param dock Where to dock the widget
*/
- virtual void addToolWidget(QWidget* w,const QString & icon,const QString & caption,ToolDock dock) = 0;
+ virtual void addToolWidget(TQWidget* w,const TQString & icon,const TQString & caption,ToolDock dock) = 0;
/**
* Remove a tool widget.
* @param w The widget
*/
- virtual void removeToolWidget(QWidget* w) = 0;
+ virtual void removeToolWidget(TQWidget* w) = 0;
/// Get the current torrent.
virtual const TorrentInterface* getCurrentTorrent() const = 0;
diff --git a/libktorrent/interfaces/ipblockinginterface.h b/libktorrent/interfaces/ipblockinginterface.h
index 4054af9..236a549 100644
--- a/libktorrent/interfaces/ipblockinginterface.h
+++ b/libktorrent/interfaces/ipblockinginterface.h
@@ -22,7 +22,7 @@
#ifndef IPBLOCKINGINTERFACE_H
#define IPBLOCKINGINTERFACE_H
-class QString;
+class TQString;
namespace kt
{
@@ -41,7 +41,7 @@ namespace kt
* @return TRUE if IP should be blocked. FALSE otherwise
* @arg ip String representation of IP address.
*/
- virtual bool isBlockedIP(const QString& ip) = 0;
+ virtual bool isBlockedIP(const TQString& ip) = 0;
};
}
diff --git a/libktorrent/interfaces/logmonitorinterface.h b/libktorrent/interfaces/logmonitorinterface.h
index 4fccb0e..54e1a21 100644
--- a/libktorrent/interfaces/logmonitorinterface.h
+++ b/libktorrent/interfaces/logmonitorinterface.h
@@ -20,7 +20,7 @@
#ifndef KTLOGMONITORINTERFACE_H
#define KTLOGMONITORINTERFACE_H
-class QString;
+class TQString;
namespace kt
{
@@ -42,7 +42,7 @@ namespace kt
* A line was written to the log file.
* @param line The line
*/
- virtual void message(const QString & line, unsigned int arg) = 0;
+ virtual void message(const TQString & line, unsigned int arg) = 0;
};
}
diff --git a/libktorrent/interfaces/peerinterface.h b/libktorrent/interfaces/peerinterface.h
index f77d0f8..d5424ac 100644
--- a/libktorrent/interfaces/peerinterface.h
+++ b/libktorrent/interfaces/peerinterface.h
@@ -20,7 +20,7 @@
#ifndef KTPEERINTERFACE_H
#define KTPEERINTERFACE_H
-#include <qstring.h>
+#include <tqstring.h>
#include <util/constants.h>
namespace kt
{
@@ -41,9 +41,9 @@ namespace kt
struct Stats
{
/// IP address of peer (dotted notation)
- QString ip_address;
+ TQString ip_address;
/// The client (Azureus, BitComet, ...)
- QString client;
+ TQString client;
/// Download rate (bytes/s)
bt::Uint32 download_rate;
/// Upload rate (bytes/s)
diff --git a/libktorrent/interfaces/peersource.cpp b/libktorrent/interfaces/peersource.cpp
index 18368b1..6a1eb87 100644
--- a/libktorrent/interfaces/peersource.cpp
+++ b/libktorrent/interfaces/peersource.cpp
@@ -38,7 +38,7 @@ namespace kt
void PeerSource::aboutToBeDestroyed()
{}
- void PeerSource::addPeer(const QString & ip,bt::Uint16 port,bool local)
+ void PeerSource::addPeer(const TQString & ip,bt::Uint16 port,bool local)
{
PotentialPeer pp;
pp.ip = ip;
diff --git a/libktorrent/interfaces/peersource.h b/libktorrent/interfaces/peersource.h
index 9c2b589..c7aa73d 100644
--- a/libktorrent/interfaces/peersource.h
+++ b/libktorrent/interfaces/peersource.h
@@ -20,8 +20,8 @@
#ifndef KTPEERSOURCE_H
#define KTPEERSOURCE_H
-#include <qobject.h>
-#include <qvaluelist.h>
+#include <tqobject.h>
+#include <tqvaluelist.h>
#include <util/constants.h>
namespace bt
@@ -33,7 +33,7 @@ namespace kt
{
struct PotentialPeer
{
- QString ip;
+ TQString ip;
bt::Uint16 port;
bool local;
@@ -47,9 +47,10 @@ namespace kt
* for torrents. PeerSources should work independently and should emit a signal when they
* have peers ready.
*/
- class PeerSource : public QObject
+ class PeerSource : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
PeerSource();
virtual ~PeerSource();
@@ -70,7 +71,7 @@ namespace kt
* @param port The port
* @param local Wether or not the peer is on the local network
*/
- void addPeer(const QString & ip,bt::Uint16 port,bool local = false);
+ void addPeer(const TQString & ip,bt::Uint16 port,bool local = false);
public slots:
/**
@@ -110,7 +111,7 @@ namespace kt
private:
/// List to keep the potential peers in.
- QValueList<PotentialPeer> peers;
+ TQValueList<PotentialPeer> peers;
};
}
diff --git a/libktorrent/interfaces/plugin.cpp b/libktorrent/interfaces/plugin.cpp
index 6354985..50903d7 100644
--- a/libktorrent/interfaces/plugin.cpp
+++ b/libktorrent/interfaces/plugin.cpp
@@ -22,11 +22,11 @@
namespace kt
{
- Plugin::Plugin(QObject *parent, const char* qt_name,const QStringList & /*args*/,
- const QString & name,const QString & gui_name,const QString & author,
- const QString & email,const QString & description,
- const QString & icon)
- : KParts::Plugin(parent,qt_name),
+ Plugin::Plugin(TQObject *tqparent, const char* qt_name,const TQStringList & /*args*/,
+ const TQString & name,const TQString & gui_name,const TQString & author,
+ const TQString & email,const TQString & description,
+ const TQString & icon)
+ : KParts::Plugin(tqparent,qt_name),
name(name),author(author),email(email),description(description),icon(icon),gui_name(gui_name)
{
core = 0;
diff --git a/libktorrent/interfaces/plugin.h b/libktorrent/interfaces/plugin.h
index ac43fbc..d147d46 100644
--- a/libktorrent/interfaces/plugin.h
+++ b/libktorrent/interfaces/plugin.h
@@ -48,6 +48,7 @@ namespace kt
class Plugin : public KParts::Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor, set the name of the plugin, the name and e-mail of the author and
@@ -59,10 +60,10 @@ namespace kt
* @param description What does the plugin do
* @param icon Name of the plugin's icon
*/
- Plugin(QObject *parent,const char* qt_name,const QStringList & args,
- const QString & name,const QString & gui_name,const QString & author,
- const QString & email,const QString & description,
- const QString & icon);
+ Plugin(TQObject *tqparent,const char* qt_name,const TQStringList & args,
+ const TQString & name,const TQString & gui_name,const TQString & author,
+ const TQString & email,const TQString & description,
+ const TQString & icon);
virtual ~Plugin();
/**
@@ -94,12 +95,12 @@ namespace kt
*/
virtual void shutdown(bt::WaitJob* job);
- const QString & getName() const {return name;}
- const QString & getAuthor() const {return author;}
- const QString & getEMailAddress() const {return email;}
- const QString & getDescription() const {return description;}
- const QString & getIcon() const {return icon;}
- const QString & getGuiName() const {return gui_name;}
+ const TQString & getName() const {return name;}
+ const TQString & getAuthor() const {return author;}
+ const TQString & getEMailAddress() const {return email;}
+ const TQString & getDescription() const {return description;}
+ const TQString & getIcon() const {return icon;}
+ const TQString & getGuiName() const {return gui_name;}
/// Get a pointer to the CoreInterface
CoreInterface* getCore() {return core;}
@@ -131,15 +132,15 @@ namespace kt
bool isLoaded() const {return loaded;}
/// Check wether the plugin matches the version of KT
- virtual bool versionCheck(const QString & version) const = 0;
+ virtual bool versionCheck(const TQString & version) const = 0;
private:
- QString name;
- QString author;
- QString email;
- QString description;
- QString icon;
- QString gui_name;
+ TQString name;
+ TQString author;
+ TQString email;
+ TQString description;
+ TQString icon;
+ TQString gui_name;
CoreInterface* core;
GUIInterface* gui;
bool loaded;
diff --git a/libktorrent/interfaces/prefpageinterface.cpp b/libktorrent/interfaces/prefpageinterface.cpp
index b905f07..ae6414f 100644
--- a/libktorrent/interfaces/prefpageinterface.cpp
+++ b/libktorrent/interfaces/prefpageinterface.cpp
@@ -20,8 +20,8 @@
#include "prefpageinterface.h"
namespace kt
{
- PrefPageInterface::PrefPageInterface(const QString & name,const QString & header,
- const QPixmap & pix)
+ PrefPageInterface::PrefPageInterface(const TQString & name,const TQString & header,
+ const TQPixmap & pix)
: pixmap(pix),itemName(name),header(header)
{}
diff --git a/libktorrent/interfaces/prefpageinterface.h b/libktorrent/interfaces/prefpageinterface.h
index 7d4d6dc..b27390e 100644
--- a/libktorrent/interfaces/prefpageinterface.h
+++ b/libktorrent/interfaces/prefpageinterface.h
@@ -20,9 +20,9 @@
#ifndef PREFPAGEINTERFACE_H
#define PREFPAGEINTERFACE_H
-#include <qpixmap.h>
+#include <tqpixmap.h>
-class QWidget;
+class TQWidget;
namespace kt
{
@@ -41,12 +41,12 @@ namespace kt
* @param header
* @param pix
*/
- PrefPageInterface(const QString & name,const QString & header,const QPixmap & pix);
+ PrefPageInterface(const TQString & name,const TQString & header,const TQPixmap & pix);
virtual ~PrefPageInterface();
- const QString& getItemName() { return itemName; }
- const QString& getHeader() { return header; }
- const QPixmap& getPixmap() { return pixmap; }
+ const TQString& getItemName() { return itemName; }
+ const TQString& getHeader() { return header; }
+ const TQPixmap& getPixmap() { return pixmap; }
/**
* Apply the changes that have been made in the
@@ -58,9 +58,9 @@ namespace kt
/**
* Create the actual widget.
- * @param parent The parent of the widget
+ * @param tqparent The tqparent of the widget
*/
- virtual void createWidget(QWidget* parent)=0;
+ virtual void createWidget(TQWidget* tqparent)=0;
/**
* Update all data on the widget, gets called before
@@ -73,11 +73,11 @@ namespace kt
private:
///Used in IconList mode. You should prefer a pixmap with size 32x32 pixels
- QPixmap pixmap;
+ TQPixmap pixmap;
///String used in the list or as tab item name.
- QString itemName;
+ TQString itemName;
///Header text use in the list modes. Ignored in Tabbed mode. If empty, the item text is used instead.
- QString header;
+ TQString header;
};
}
#endif
diff --git a/libktorrent/interfaces/torrentfileinterface.cpp b/libktorrent/interfaces/torrentfileinterface.cpp
index 4cca138..d49414e 100644
--- a/libktorrent/interfaces/torrentfileinterface.cpp
+++ b/libktorrent/interfaces/torrentfileinterface.cpp
@@ -22,7 +22,7 @@
namespace kt
{
- TorrentFileInterface::TorrentFileInterface(const QString & path,Uint64 size)
+ TorrentFileInterface::TorrentFileInterface(const TQString & path,Uint64 size)
: path(path),size(size),first_chunk(0),last_chunk(0),num_chunks_downloaded(0),
priority(NORMAL_PRIORITY),m_emitDlStatusChanged(true),preview(false)
{
diff --git a/libktorrent/interfaces/torrentfileinterface.h b/libktorrent/interfaces/torrentfileinterface.h
index 430534c..bf30f1e 100644
--- a/libktorrent/interfaces/torrentfileinterface.h
+++ b/libktorrent/interfaces/torrentfileinterface.h
@@ -20,8 +20,8 @@
#ifndef KTTORRENTFILEINTERFACE_H
#define KTTORRENTFILEINTERFACE_H
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
#include <util/constants.h>
namespace kt
@@ -41,20 +41,21 @@ namespace kt
*
* This class is the interface for a file in a multifile torrent.
*/
- class TorrentFileInterface : public QObject
+ class TorrentFileInterface : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor, set the path and size.
* @param path The path
* @param size The size
*/
- TorrentFileInterface(const QString & path,Uint64 size);
+ TorrentFileInterface(const TQString & path,Uint64 size);
virtual ~TorrentFileInterface();
/// Get the path of the file
- QString getPath() const {return path;}
+ TQString getPath() const {return path;}
/// Get the size of the file
Uint64 getSize() const {return size;}
@@ -115,7 +116,7 @@ namespace kt
void previewAvailable(bool available);
protected:
- QString path;
+ TQString path;
Uint64 size;
Uint32 first_chunk;
Uint32 last_chunk;
diff --git a/libktorrent/interfaces/torrentinterface.h b/libktorrent/interfaces/torrentinterface.h
index 95d5766..14ad532 100644
--- a/libktorrent/interfaces/torrentinterface.h
+++ b/libktorrent/interfaces/torrentinterface.h
@@ -20,7 +20,7 @@
#ifndef KTTORRENTINTERFACE_H
#define KTTORRENTINTERFACE_H
-#include <qobject.h>
+#include <tqobject.h>
#include <util/constants.h>
#include <interfaces/trackerslist.h>
@@ -44,7 +44,7 @@ namespace kt
class TorrentFileInterface;
class PeerSource;
- enum TorrentStatus
+ enum TorrenttqStatus
{
NOT_STARTED,
SEEDING_COMPLETE,
@@ -55,7 +55,7 @@ namespace kt
STOPPED,
ALLOCATING_DISKSPACE,
ERROR,
- QUEUED,
+ TQUEUED,
CHECKING_DATA,
NO_SPACE_LEFT
};
@@ -67,7 +67,7 @@ namespace kt
NOT_ENOUGH_DISKSPACE,
MAX_SHARE_RATIO_REACHED,
BUSY_WITH_DATA_CHECK,
- QM_LIMITS_REACHED // Max seeds or downloads reached
+ TQM_LIMITS_REACHED // Max seeds or downloads reached
};
enum AutoStopReason
@@ -118,10 +118,10 @@ namespace kt
Uint32 leechers_total;
/// Num leechers connected to
Uint32 leechers_connected_to;
- /// Status of the download
- TorrentStatus status;
+ /// tqStatus of the download
+ TorrenttqStatus status;
/// The status of the tracker
- QString trackerstatus;
+ TQString trackerstatus;
/// The number of bytes downloaded in this session
Uint64 session_bytes_downloaded;
/// The number of bytes uploaded in this session
@@ -131,9 +131,9 @@ namespace kt
/// The number of bytes upload since the last started event, this gets sent to the tracker
Uint64 trk_bytes_uploaded;
/// Name of the torrent
- QString torrent_name;
+ TQString torrent_name;
/// Path of the dir or file where the data will get saved
- QString output_path;
+ TQString output_path;
/// See if we are running
bool running;
/// See if the torrent has been started
@@ -161,7 +161,7 @@ namespace kt
struct DHTNode
{
- QString ip;
+ TQString ip;
bt::Uint16 port;
};
@@ -179,9 +179,10 @@ namespace kt
* This class is the interface for an object which controls the
* up- and download of one torrent.
*/
- class TorrentInterface : public QObject
+ class TorrentInterface : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
TorrentInterface();
virtual ~TorrentInterface();
@@ -226,13 +227,13 @@ namespace kt
* Get the torX directory of this torrent. Temporary stuff like the index
* file get stored there.
*/
- virtual QString getTorDir() const = 0;
+ virtual TQString getTorDir() const = 0;
/// Get the data directory of this torrent
- virtual QString getDataDir() const = 0;
+ virtual TQString getDataDir() const = 0;
/// Get a short error message
- virtual QString getShortErrorMessage() const = 0;
+ virtual TQString getShortErrorMessage() const = 0;
/**
* Get the download running time of this torrent in seconds
@@ -252,7 +253,7 @@ namespace kt
* @param new_dir The new directory
* @return true upon succes
*/
- virtual bool changeDataDir(const QString & new_dir) = 0;
+ virtual bool changeDataDir(const TQString & new_dir) = 0;
/**
* Change torrents output directory. If this fails we will fall back on the old directory.
@@ -260,7 +261,7 @@ namespace kt
* @param moveFiles Wheather to actually move the files or just change the directory without moving them.
* @return true upon success.
*/
- virtual bool changeOutputDir(const QString& new_dir, bool moveFiles = true) = 0;
+ virtual bool changeOutputDir(const TQString& new_dir, bool moveFiles = true) = 0;
/**
* Roll back the previous changeDataDir call.
@@ -329,7 +330,7 @@ namespace kt
virtual float getMaxSeedTime() const = 0;
/// Make a string of the current status
- virtual QString statusToString() const = 0;
+ virtual TQString statusToString() const = 0;
///Is manual announce allowed?
virtual bool announceAllowed() = 0;
@@ -363,7 +364,7 @@ namespace kt
* Test all files and see if they are not missing.
* If so put them in a list
*/
- virtual bool hasMissingFiles(QStringList & sl) = 0;
+ virtual bool hasMissingFiles(TQStringList & sl) = 0;
/**
* Recreate missing files.
@@ -394,7 +395,7 @@ namespace kt
virtual bool overMaxSeedTime() = 0;
/// Handle an error
- virtual void handleError(const QString & err) = 0;
+ virtual void handleError(const TQString & err) = 0;
/// Get the info_hash.
virtual const bt::SHA1Hash & getInfoHash() const = 0;
@@ -443,7 +444,7 @@ namespace kt
* @param me The object who emitted the signal
* @param msg Error message
*/
- void stoppedByError(kt::TorrentInterface* me, QString msg);
+ void stoppedByError(kt::TorrentInterface* me, TQString msg);
/**
* Emited when maximum share ratio for this torrent is changed