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 +- apps/ktorrent/addpeerwidget.cpp | 20 +-- apps/ktorrent/addpeerwidget.h | 6 +- apps/ktorrent/addpeerwidgetbase.ui | 22 +-- apps/ktorrent/advancedpref.ui | 106 +++++++------- apps/ktorrent/dcopinterface.h | 18 +-- apps/ktorrent/downloadpref.ui | 124 ++++++++-------- apps/ktorrent/fileselectdlg.cpp | 62 ++++---- apps/ktorrent/fileselectdlg.h | 3 +- apps/ktorrent/fileselectdlgbase.ui | 58 ++++---- apps/ktorrent/filterbar.cpp | 62 ++++---- apps/ktorrent/filterbar.h | 23 +-- apps/ktorrent/generalpref.ui | 68 ++++----- apps/ktorrent/groups/group.cpp | 6 +- apps/ktorrent/groups/group.h | 20 +-- apps/ktorrent/groups/groupmanager.cpp | 22 +-- apps/ktorrent/groups/groupmanager.h | 16 +-- apps/ktorrent/groups/groupview.cpp | 86 ++++++------ apps/ktorrent/groups/groupview.h | 25 ++-- apps/ktorrent/groups/torrentdrag.cpp | 2 +- apps/ktorrent/groups/torrentdrag.h | 7 +- apps/ktorrent/groups/torrentgroup.cpp | 18 +-- apps/ktorrent/groups/torrentgroup.h | 2 +- apps/ktorrent/ipfilterwidget.cpp | 58 ++++---- apps/ktorrent/ipfilterwidget.h | 7 +- apps/ktorrent/ipfilterwidgetbase.ui | 32 ++--- apps/ktorrent/ktorrent.cpp | 234 +++++++++++++++---------------- apps/ktorrent/ktorrent.h | 71 +++++----- apps/ktorrent/ktorrentapp.cpp | 4 +- apps/ktorrent/ktorrentapp.h | 1 + apps/ktorrent/ktorrentcore.cpp | 202 +++++++++++++------------- apps/ktorrent/ktorrentcore.h | 43 +++--- apps/ktorrent/ktorrentdcop.cpp | 24 ++-- apps/ktorrent/ktorrentdcop.h | 21 +-- apps/ktorrent/ktorrentview.cpp | 214 ++++++++++++++-------------- apps/ktorrent/ktorrentview.h | 33 ++--- apps/ktorrent/ktorrentviewitem.cpp | 72 +++++----- apps/ktorrent/ktorrentviewitem.h | 6 +- apps/ktorrent/ktorrentviewmenu.cpp | 44 +++--- apps/ktorrent/ktorrentviewmenu.h | 7 +- apps/ktorrent/leaktrace.cpp | 10 +- apps/ktorrent/main.cpp | 20 +-- apps/ktorrent/newui/button.cpp | 152 ++++++++++---------- apps/ktorrent/newui/button.h | 41 +++--- apps/ktorrent/newui/buttonbar.cpp | 58 ++++---- apps/ktorrent/newui/buttonbar.h | 25 ++-- apps/ktorrent/newui/ddockwindow.cpp | 94 ++++++------- apps/ktorrent/newui/ddockwindow.h | 43 +++--- apps/ktorrent/newui/dmainwindow.cpp | 102 +++++++------- apps/ktorrent/newui/dmainwindow.h | 39 +++--- apps/ktorrent/newui/docksplitter.cpp | 42 +++--- apps/ktorrent/newui/docksplitter.h | 21 +-- apps/ktorrent/newui/dtabwidget.cpp | 32 ++--- apps/ktorrent/newui/dtabwidget.h | 21 +-- apps/ktorrent/pastedialog.cpp | 14 +- apps/ktorrent/pastedialog.h | 3 +- apps/ktorrent/pastedlgbase.ui | 24 ++-- apps/ktorrent/pref.cpp | 96 ++++++------- apps/ktorrent/pref.h | 23 +-- apps/ktorrent/queuedialog.cpp | 72 +++++----- apps/ktorrent/queuedialog.h | 25 ++-- apps/ktorrent/queuedlg.ui | 128 ++++++++--------- apps/ktorrent/scandialog.cpp | 38 ++--- apps/ktorrent/scandialog.h | 13 +- apps/ktorrent/scandlgbase.ui | 40 +++--- apps/ktorrent/speedlimitsdlg.cpp | 10 +- apps/ktorrent/speedlimitsdlg.h | 3 +- apps/ktorrent/speedlimitsdlgbase.ui | 36 ++--- apps/ktorrent/torrentcreatordlg.cpp | 44 +++--- apps/ktorrent/torrentcreatordlg.h | 9 +- apps/ktorrent/torrentcreatordlgbase.ui | 72 +++++----- apps/ktorrent/trayhoverpopup.cpp | 42 +++--- apps/ktorrent/trayhoverpopup.h | 19 +-- apps/ktorrent/trayicon.cpp | 138 +++++++++--------- apps/ktorrent/trayicon.h | 22 +-- apps/ktorrent/viewmanager.cpp | 24 ++-- apps/ktorrent/viewmanager.h | 19 +-- apps/kttorinfo/main.cpp | 4 +- apps/ktupnptest/main.cpp | 6 +- apps/ktupnptest/mainwidget.ui | 12 +- apps/ktupnptest/upnptestapp.cpp | 14 +- apps/ktupnptest/upnptestapp.h | 5 +- 88 files changed, 1786 insertions(+), 1754 deletions(-) (limited to 'apps') 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); }; diff --git a/apps/ktorrent/addpeerwidget.cpp b/apps/ktorrent/addpeerwidget.cpp index 20c27c3..db9f624 100644 --- a/apps/ktorrent/addpeerwidget.cpp +++ b/apps/ktorrent/addpeerwidget.cpp @@ -28,10 +28,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include using namespace kt; using bt::Uint16; @@ -58,8 +58,8 @@ void ManualPeerSource::signalPeersReady() //AddPeerWidget -AddPeerWidget::AddPeerWidget(kt::TorrentInterface* tc, QWidget *parent, const char *name) - :AddPeerWidgetBase(parent, name), m_tc(tc) +AddPeerWidget::AddPeerWidget(kt::TorrentInterface* tc, TQWidget *tqparent, const char *name) + :AddPeerWidgetBase(tqparent, name), m_tc(tc) { if(!tc) { @@ -88,12 +88,12 @@ void AddPeerWidget::btnAdd_clicked() { int var=0; - QRegExp rx("[0-9]{1,3}(.[0-9]{1,3}){3,3}"); - QRegExpValidator v( rx,0); + TQRegExp rx("[0-9]{1,3}(.[0-9]{1,3}){3,3}"); + TQRegExpValidator v( rx,0); - QString ip = m_ip->text(); + TQString ip = m_ip->text(); - if(v.validate( ip, var ) == QValidator::Acceptable) + if(v.validate( ip, var ) == TQValidator::Acceptable) { m_peerSource->addPeer(ip, m_port->value()); diff --git a/apps/ktorrent/addpeerwidget.h b/apps/ktorrent/addpeerwidget.h index 74a7488..6983d39 100644 --- a/apps/ktorrent/addpeerwidget.h +++ b/apps/ktorrent/addpeerwidget.h @@ -22,7 +22,7 @@ #include "addpeerwidgetbase.h" -#include +#include #include namespace kt @@ -44,6 +44,7 @@ namespace bt class ManualPeerSource: public kt::PeerSource { Q_OBJECT + TQ_OBJECT public: ManualPeerSource(); @@ -78,8 +79,9 @@ class ManualPeerSource: public kt::PeerSource class AddPeerWidget: public AddPeerWidgetBase { Q_OBJECT + TQ_OBJECT public: - AddPeerWidget(kt::TorrentInterface* tc, QWidget *parent = 0, const char *name = 0); + AddPeerWidget(kt::TorrentInterface* tc, TQWidget *tqparent = 0, const char *name = 0); ~AddPeerWidget(); public slots: diff --git a/apps/ktorrent/addpeerwidgetbase.ui b/apps/ktorrent/addpeerwidgetbase.ui index c4cbc6f..aeb5f6e 100644 --- a/apps/ktorrent/addpeerwidgetbase.ui +++ b/apps/ktorrent/addpeerwidgetbase.ui @@ -1,6 +1,6 @@ AddPeerWidgetBase - + AddPeerWidgetBase @@ -19,15 +19,15 @@ unnamed - + - layout10 + tqlayout10 unnamed - + textLabel1 @@ -43,7 +43,7 @@ 127.0.0.1 - + textLabel2 @@ -77,16 +77,16 @@ Expanding - + 20 16 - + - layout11 + tqlayout11 @@ -149,10 +149,10 @@ m_port btnAdd - + btnAdd_clicked() - - + + klineedit.h knuminput.h diff --git a/apps/ktorrent/advancedpref.ui b/apps/ktorrent/advancedpref.ui index bf4573e..527250b 100644 --- a/apps/ktorrent/advancedpref.ui +++ b/apps/ktorrent/advancedpref.ui @@ -1,6 +1,6 @@ AdvancedPref - + AdvancedPref @@ -19,7 +19,7 @@ unnamed - + groupBox4 @@ -30,15 +30,15 @@ unnamed - + - layout15 + tqlayout15 unnamed - + textLabel1_5 @@ -53,7 +53,7 @@ <b>Moving average algorithm:</b> Moving average speed calculated from X samples - + KTorrent @@ -90,7 +90,7 @@ <b>Moving average algorithm:</b> Moving average speed calculated from X samples - + textLabel3 @@ -108,7 +108,7 @@ Expanding - + 148 20 @@ -117,7 +117,7 @@ - + prealloc_disabled @@ -125,15 +125,15 @@ Disa&ble diskspace preallocation - + - layout25 + tqlayout25 unnamed - + full_prealloc @@ -141,7 +141,7 @@ F&ully preallocate diskspace (avoids fragmentation) - + Basic (slow) @@ -166,7 +166,7 @@ - + groupBox1 @@ -177,15 +177,15 @@ unnamed - + - layout5 + tqlayout5 unnamed - + textLabel1_3 @@ -223,7 +223,7 @@ Expanding - + 111 20 @@ -232,15 +232,15 @@ - + - layout5_2 + tqlayout5_2 unnamed - + textLabel1_3_2 @@ -283,7 +283,7 @@ Expanding - + 111 20 @@ -292,15 +292,15 @@ - + - layout8 + tqlayout8 unnamed - + textLabel1_6 @@ -308,7 +308,7 @@ Fast CPU - + cpu_usage @@ -334,7 +334,7 @@ - + textLabel2_2 @@ -346,7 +346,7 @@ - + groupBox3 @@ -357,15 +357,15 @@ unnamed - + - layout7 + tqlayout7 unnamed - + no_recheck @@ -387,7 +387,7 @@ 8192 - + textLabel2 @@ -405,7 +405,7 @@ Expanding - + 20 20 @@ -414,15 +414,15 @@ - + - layout10 + tqlayout10 unnamed - + auto_recheck @@ -441,7 +441,7 @@ 1 - + textLabel1_2 @@ -459,7 +459,7 @@ Expanding - + 41 20 @@ -470,7 +470,7 @@ - + groupBox2 @@ -481,23 +481,23 @@ unnamed - + - layout33 + tqlayout33 unnamed - + - layout32 + tqlayout32 unnamed - + textLabel1_7 @@ -519,7 +519,7 @@ 200 - + textLabel1 @@ -553,7 +553,7 @@ Expanding - + 383 20 @@ -562,7 +562,7 @@ - + do_not_use_kde_proxy @@ -570,15 +570,15 @@ Do not use the KDE pro&xy settings for HTTP tracker connections - + - layout7 + tqlayout7 unnamed - + textLabel1_4 @@ -601,7 +601,7 @@ Expanding - + 81 20 @@ -622,7 +622,7 @@ Expanding - + 20 30 @@ -639,7 +639,7 @@ setEnabled(bool) - + kcombobox.h kcombobox.h diff --git a/apps/ktorrent/dcopinterface.h b/apps/ktorrent/dcopinterface.h index 5dd7df5..af00593 100644 --- a/apps/ktorrent/dcopinterface.h +++ b/apps/ktorrent/dcopinterface.h @@ -38,21 +38,21 @@ k_dcop: virtual void setMaxDownloadSpeed(int kbytes_per_sec) = 0; virtual void setMaxConnectionsPerDownload(int max) = 0; virtual void setShowSysTrayIcon(bool yes) = 0; - virtual bool changeDataDir(const QString & new_dir) = 0; - virtual void openTorrent(const QString & file) = 0; - virtual void openTorrentSilently(const QString & file) = 0; - virtual QValueList getTorrentNumbers(int type = 3) = 0; + virtual bool changeDataDir(const TQString & new_dir) = 0; + virtual void openTorrent(const TQString & file) = 0; + virtual void openTorrentSilently(const TQString & file) = 0; + virtual TQValueList getTorrentNumbers(int type = 3) = 0; virtual QCStringList getTorrentInfo(int tornumber) = 0; virtual int getFileCount(int tornumber) = 0; virtual QCStringList getInfo() = 0; virtual QCStringList getFileNames(int tornumber) = 0; - virtual QValueList getFilePriorities(int tornumber) = 0; + virtual TQValueList getFilePriorities(int tornumber) = 0; virtual void setFilePriority(int tornumber, int index, int priority) = 0; virtual void start(int tornumber) = 0; virtual void stop(int tornumber, bool user) = 0; virtual void remove(int tornumber, bool del_data) = 0; virtual void announce(int tornumber) = 0; - virtual QCString dataDir() = 0; + virtual TQCString dataDir() = 0; virtual int maxDownloads() = 0; virtual int maxSeeds() = 0; virtual int maxConnections() = 0; @@ -60,9 +60,9 @@ k_dcop: virtual int maxDownloadRate() = 0; virtual bool keepSeeding() = 0; virtual bool showSystemTrayIcon() = 0; - virtual QValueList intSettings() = 0; - virtual bool isBlockedIP(QString ip) = 0; - virtual void openTorrentSilentlyDir(const QString & file, const QString & savedir) = 0; + virtual TQValueList intSettings() = 0; + virtual bool isBlockedIP(TQString ip) = 0; + virtual void openTorrentSilentlyDir(const TQString & file, const TQString & savedir) = 0; }; diff --git a/apps/ktorrent/downloadpref.ui b/apps/ktorrent/downloadpref.ui index c87383b..966fc50 100644 --- a/apps/ktorrent/downloadpref.ui +++ b/apps/ktorrent/downloadpref.ui @@ -1,6 +1,6 @@ DownloadPref - + DownloadPref @@ -16,7 +16,7 @@ unnamed - + groupBox2 @@ -27,31 +27,31 @@ unnamed - + - layout49 + tqlayout49 unnamed - + - layout42 + tqlayout42 unnamed - + - layout16 + tqlayout16 unnamed - + textLabel1 @@ -69,7 +69,7 @@ Expanding - + 40 20 @@ -78,7 +78,7 @@ - + textLabel1_5 @@ -86,7 +86,7 @@ Maximum seeds: - + textLabel1_8 @@ -94,7 +94,7 @@ Start download on low disk space : - + textLabel1_9 @@ -104,9 +104,9 @@ - + - layout46 + tqlayout46 @@ -134,7 +134,7 @@ 0 - + Don't start @@ -162,15 +162,15 @@ - + - layout45 + tqlayout45 unnamed - + intMinDiskSpace @@ -192,7 +192,7 @@ 100 - + textLabel2_2 @@ -212,23 +212,23 @@ - + - layout48 + tqlayout48 unnamed - + - layout14 + tqlayout14 unnamed - + textLabel1_2 @@ -246,7 +246,7 @@ Expanding - + 10 20 @@ -255,7 +255,7 @@ - + textLabel1_2_3 @@ -273,7 +273,7 @@ Expanding - + 191 20 @@ -290,7 +290,7 @@ Expanding - + 207 20 @@ -303,7 +303,7 @@ - + groupBox3 @@ -314,15 +314,15 @@ unnamed - + - layout42 + tqlayout42 unnamed - + textLabel1_4 @@ -330,7 +330,7 @@ Maximum download rate: - + textLabel5 @@ -338,7 +338,7 @@ Port: - + textLabel1_7 @@ -346,7 +346,7 @@ Global connection limit: - + textLabel2_3 @@ -354,15 +354,15 @@ Max seed time: - + - layout18 + tqlayout18 unnamed - + textLabel2 @@ -380,7 +380,7 @@ Expanding - + 40 20 @@ -389,15 +389,15 @@ - + textLabel1_6 - Number of upload slots: + Number of upload Q_SLOTS: - + textLabel1_3 @@ -405,7 +405,7 @@ UDP tracker port: - + textLabel1_6_2 @@ -413,7 +413,7 @@ Max share ratio: - + textLabel3 @@ -423,9 +423,9 @@ - + - layout41 + tqlayout41 @@ -544,15 +544,15 @@ - + - layout40 + tqlayout40 unnamed - + textLabel1_2_2 @@ -560,7 +560,7 @@ (0 is no limit) - + textLabel1_2_2_2 @@ -568,7 +568,7 @@ (0 is no limit) - + textLabel4 @@ -576,7 +576,7 @@ KB/sec (0 is no limit) - + textLabel4_2 @@ -594,7 +594,7 @@ Expanding - + 208 20 @@ -611,7 +611,7 @@ Expanding - + 208 20 @@ -628,14 +628,14 @@ Expanding - + 208 20 - + textLabel1_2_2_2_2 @@ -643,7 +643,7 @@ (0 is no limit) - + textLabel3_2 @@ -655,7 +655,7 @@ - + keep_seeding @@ -666,7 +666,7 @@ true - + groupBox1 @@ -697,7 +697,7 @@ Expanding - + 20 20 @@ -708,7 +708,7 @@ - + knuminput.h knuminput.h diff --git a/apps/ktorrent/fileselectdlg.cpp b/apps/ktorrent/fileselectdlg.cpp index 5704b41..0030f37 100644 --- a/apps/ktorrent/fileselectdlg.cpp +++ b/apps/ktorrent/fileselectdlg.cpp @@ -27,12 +27,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,16 +49,16 @@ using namespace kt; -FileSelectDlg::FileSelectDlg(GroupManager* gm, bool* user, bool* start, QWidget* parent, const char* name, bool modal, WFlags fl) - : FileSelectDlgBase(parent, name, modal, fl), m_gman(gm), m_user(user), m_start(start) +FileSelectDlg::FileSelectDlg(GroupManager* gm, bool* user, bool* start, TQWidget* tqparent, const char* name, bool modal, WFlags fl) + : FileSelectDlgBase(tqparent, name, modal, fl), m_gman(gm), m_user(user), m_start(start) { root = 0; - connect(m_select_all, SIGNAL(clicked()), this, SLOT(selectAll())); - connect(m_select_none, SIGNAL(clicked()), this, SLOT(selectNone())); - connect(m_invert_selection, SIGNAL(clicked()), this, SLOT(invertSelection())); - connect(m_ok, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_cancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_downloadLocation, SIGNAL(textChanged (const QString &)), this, SLOT(updateSizeLabels())); + connect(m_select_all, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectAll())); + connect(m_select_none, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectNone())); + connect(m_invert_selection, TQT_SIGNAL(clicked()), this, TQT_SLOT(invertSelection())); + connect(m_ok, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(m_cancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_downloadLocation, TQT_SIGNAL(textChanged (const TQString &)), this, TQT_SLOT(updateSizeLabels())); m_downloadLocation->setMode(KFile::Directory); } @@ -83,19 +83,19 @@ int FileSelectDlg::execute(kt::TorrentInterface* tc) return exec(); } - return QDialog::Rejected; + return TQDialog::Rejected; } void FileSelectDlg::reject() { - QDialog::reject(); + TQDialog::reject(); } void FileSelectDlg::accept() { - QStringList pe_ex; + TQStringList pe_ex; - QString dn = m_downloadLocation->url(); + TQString dn = m_downloadLocation->url(); if (!dn.endsWith(bt::DirSeparator())) dn += bt::DirSeparator(); @@ -104,7 +104,7 @@ void FileSelectDlg::accept() kt::TorrentFileInterface & file = tc->getTorrentFile(i); // check for preexsting files - QString path = dn + tc->getStats().torrent_name + bt::DirSeparator() + file.getPath(); + TQString path = dn + tc->getStats().torrent_name + bt::DirSeparator() + file.getPath(); if (bt::Exists(path)) file.setPreExisting(true); @@ -117,10 +117,10 @@ void FileSelectDlg::accept() if (pe_ex.count() > 0) { - QString msg = i18n("You have deselected the following existing files. " + TQString msg = i18n("You have deselected the following existing files. " "You will lose all data in these files, are you sure you want to do this ?"); // better ask the user if (s)he wants to delete the already existing data - int ret = KMessageBox::warningYesNoList(0, msg, pe_ex, QString::null, + int ret = KMessageBox::warningYesNoList(0, msg, pe_ex, TQString(), KGuiItem(i18n("Yes, delete the files")), KGuiItem(i18n("No, keep the files"))); @@ -145,7 +145,7 @@ void FileSelectDlg::accept() } //Setup custom download location - QString ddir = tc->getDataDir(); + TQString ddir = tc->getDataDir(); if (!ddir.endsWith(bt::DirSeparator())) ddir += bt::DirSeparator(); @@ -159,9 +159,9 @@ void FileSelectDlg::accept() //Now add torrent to selected group if(m_cmbGroups->currentItem() != 0) { - QString groupName = m_cmbGroups->currentText(); + TQString groupName = m_cmbGroups->currentText(); - Group* group = m_gman->find(groupName); + Group* group = m_gman->tqfind(groupName); if(group) { group->addTorrent(tc); @@ -170,7 +170,7 @@ void FileSelectDlg::accept() // update the last save directory Settings::setLastSaveDir(dn); - QDialog::accept(); + TQDialog::accept(); } void FileSelectDlg::selectAll() @@ -196,7 +196,7 @@ void FileSelectDlg::updateSizeLabels() //calculate free disk space KURL sdir = KURL(m_downloadLocation -> url()); - while( sdir.isValid() && sdir.isLocalFile() && (!sdir.isEmpty()) && (! QDir(sdir.path()).exists()) ) + while( sdir.isValid() && sdir.isLocalFile() && (!sdir.isEmpty()) && (! TQDir(sdir.path()).exists()) ) { sdir = sdir.upURL(); } @@ -217,9 +217,9 @@ void FileSelectDlg::updateSizeLabels() lblRequired->setText(kt::BytesToString(bytes_to_download)); if (bytes_to_download > bytes_free) - lblStatus->setText("" + kt::BytesToString(-1*(long long)(bytes_free - bytes_to_download)) + i18n(" short!")); + lbltqStatus->setText("" + kt::BytesToString(-1*(long long)(bytes_free - bytes_to_download)) + i18n(" short!")); else - lblStatus->setText(kt::BytesToString(bytes_free - bytes_to_download)); + lbltqStatus->setText(kt::BytesToString(bytes_free - bytes_to_download)); } void FileSelectDlg::treeItemChanged() @@ -262,12 +262,12 @@ void FileSelectDlg::setupSinglefileTorrent() void FileSelectDlg::populateFields() { - QString dir = Settings::saveDir(); + TQString dir = Settings::saveDir(); if (!Settings::useSaveDir() || dir.isNull()) { dir = Settings::lastSaveDir(); if (dir.isNull()) - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); } m_downloadLocation->setURL(dir); @@ -278,7 +278,7 @@ void FileSelectDlg::loadGroups() { GroupManager::iterator it = m_gman->begin(); - QStringList grps; + TQStringList grps; //First default group grps << i18n("All Torrents"); diff --git a/apps/ktorrent/fileselectdlg.h b/apps/ktorrent/fileselectdlg.h index 9ae2b8f..684a2c8 100644 --- a/apps/ktorrent/fileselectdlg.h +++ b/apps/ktorrent/fileselectdlg.h @@ -43,6 +43,7 @@ namespace kt class FileSelectDlg : public FileSelectDlgBase, public kt::FileTreeRootListener { Q_OBJECT + TQ_OBJECT kt::TorrentInterface* tc; kt::FileTreeDirItem* root; @@ -53,7 +54,7 @@ class FileSelectDlg : public FileSelectDlgBase, public kt::FileTreeRootListener bool* m_start; public: - FileSelectDlg(kt::GroupManager* gm, bool* user, bool* start, QWidget* parent = 0, const char* name = 0, + FileSelectDlg(kt::GroupManager* gm, bool* user, bool* start, TQWidget* tqparent = 0, const char* name = 0, bool modal = true, WFlags fl = 0); virtual ~FileSelectDlg(); diff --git a/apps/ktorrent/fileselectdlgbase.ui b/apps/ktorrent/fileselectdlgbase.ui index 5d9ed14..39cd4b6 100644 --- a/apps/ktorrent/fileselectdlgbase.ui +++ b/apps/ktorrent/fileselectdlgbase.ui @@ -1,6 +1,6 @@ FileSelectDlgBase - + FileSelectDlgBase @@ -19,15 +19,15 @@ unnamed - + - layout4 + tqlayout4 unnamed - + textLabel1_2 @@ -42,23 +42,23 @@ - + - layout6 + tqlayout6 unnamed - + - layout5 + tqlayout5 unnamed - + textLabel2 @@ -74,14 +74,14 @@ Group: - + m_cmbGroups - + m_chkUserControlled @@ -97,7 +97,7 @@ &User controlled - + m_chkStartTorrent @@ -121,7 +121,7 @@ - + pnlFiles @@ -207,7 +207,7 @@ Expanding - + 20 135 @@ -216,7 +216,7 @@ - + groupBox1 @@ -237,22 +237,22 @@ Preferred - + 40 20 - + - layout33 + tqlayout33 unnamed - + textLabel1 @@ -260,7 +260,7 @@ Required disk space: - + textLabel3 @@ -268,7 +268,7 @@ Free disk space: - + textLabel6 @@ -278,27 +278,27 @@ - + - layout34 + tqlayout34 unnamed - + lblRequired - + lblFree - + - lblStatus + lbltqStatus @@ -315,7 +315,7 @@ Expanding - + 220 20 @@ -369,7 +369,7 @@ m_select_none m_invert_selection - + kurlrequester.h klineedit.h diff --git a/apps/ktorrent/filterbar.cpp b/apps/ktorrent/filterbar.cpp index c40488d..936cc61 100644 --- a/apps/ktorrent/filterbar.cpp +++ b/apps/ktorrent/filterbar.cpp @@ -19,9 +19,9 @@ #include "filterbar.h" -#include -#include -#include +#include +#include +#include #include #include @@ -34,42 +34,42 @@ -FilterBar::FilterBar(QWidget *parent, const char *name) : - QWidget(parent, name) +FilterBar::FilterBar(TQWidget *tqparent, const char *name) : + TQWidget(tqparent, name) { const int gap = 3; - QVBoxLayout* foo = new QVBoxLayout(this); + TQVBoxLayout* foo = new TQVBoxLayout(this); foo->addSpacing(gap); - QHBoxLayout* layout = new QHBoxLayout(foo); - layout->addSpacing(gap); + TQHBoxLayout* tqlayout = new TQHBoxLayout(foo); + tqlayout->addSpacing(gap); m_close = new KToolBarButton("fileclose",0,this); - connect(m_close,SIGNAL(clicked()),this,SLOT(hide())); - layout->addWidget(m_close); + connect(m_close,TQT_SIGNAL(clicked()),this,TQT_SLOT(hide())); + tqlayout->addWidget(m_close); - m_filter = new QLabel(i18n("Find:"), this); - layout->addWidget(m_filter); - layout->addSpacing(KDialog::spacingHint()); + m_filter = new TQLabel(i18n("Find:"), this); + tqlayout->addWidget(m_filter); + tqlayout->addSpacing(KDialog::spacingHint()); m_filterInput = new KLineEdit(this); - layout->addWidget(m_filterInput); + tqlayout->addWidget(m_filterInput); m_clear = new KPushButton(this); m_clear->setIconSet(SmallIcon("clear_left")); m_clear->setFlat(true); - layout->addWidget(m_clear); - layout->addSpacing(gap); + tqlayout->addWidget(m_clear); + tqlayout->addSpacing(gap); - m_case_sensitive = new QCheckBox(i18n("Case sensitive"),this); + m_case_sensitive = new TQCheckBox(i18n("Case sensitive"),this); m_case_sensitive->setChecked(true); - layout->addWidget(m_case_sensitive); - layout->addItem(new QSpacerItem(10,10,QSizePolicy::Expanding)); + tqlayout->addWidget(m_case_sensitive); + tqlayout->addItem(new TQSpacerItem(10,10,TQSizePolicy::Expanding)); - connect(m_filterInput, SIGNAL(textChanged(const QString&)), - this, SLOT(slotChangeFilter(const QString&))); - connect(m_clear, SIGNAL(clicked()), m_filterInput, SLOT(clear())); + connect(m_filterInput, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotChangeFilter(const TQString&))); + connect(m_clear, TQT_SIGNAL(clicked()), m_filterInput, TQT_SLOT(clear())); } FilterBar::~FilterBar() @@ -87,7 +87,7 @@ void FilterBar::loadSettings(KConfig* cfg) { setHidden(cfg->readBoolEntry("filter_bar_hidden",true)); m_case_sensitive->setChecked(cfg->readBoolEntry("filter_bar_case_sensitive",true)); - m_name_filter = cfg->readEntry("filter_bar_text",QString::null); + m_name_filter = cfg->readEntry("filter_bar_text",TQString()); m_filterInput->setText(m_name_filter); } @@ -97,30 +97,30 @@ bool FilterBar::matchesFilter(kt::TorrentInterface* tc) if (m_name_filter.length() == 0) return true; else - return tc->getStats().torrent_name.contains(m_name_filter,cs); + return tc->getStats().torrent_name.tqcontains(m_name_filter,cs); } -void FilterBar::slotChangeFilter(const QString& nameFilter) +void FilterBar::slotChangeFilter(const TQString& nameFilter) { m_name_filter = nameFilter; } -void FilterBar::keyPressEvent(QKeyEvent* event) +void FilterBar::keyPressEvent(TQKeyEvent* event) { - if ((event->key() == Qt::Key_Escape)) + if ((event->key() == TQt::Key_Escape)) { m_filterInput->clear(); - m_name_filter = QString::null; + m_name_filter = TQString(); //hide(); } else - QWidget::keyPressEvent(event); + TQWidget::keyPressEvent(event); } -void FilterBar::hideEvent(QHideEvent* event) +void FilterBar::hideEvent(TQHideEvent* event) { m_filterInput->releaseKeyboard(); - QWidget::hideEvent(event); + TQWidget::hideEvent(event); } #include "filterbar.moc" diff --git a/apps/ktorrent/filterbar.h b/apps/ktorrent/filterbar.h index 4e7e913..e04a73a 100644 --- a/apps/ktorrent/filterbar.h +++ b/apps/ktorrent/filterbar.h @@ -20,10 +20,10 @@ #ifndef FILTERBAR_H #define FILTERBAR_H -#include +#include -class QLabel; -class QCheckBox; +class TQLabel; +class TQCheckBox; class KConfig; class KLineEdit; class KPushButton; @@ -39,12 +39,13 @@ namespace kt * * based on dolphin's one (made by Gregor Kališnik) */ -class FilterBar : public QWidget +class FilterBar : public TQWidget { Q_OBJECT + TQ_OBJECT public: - FilterBar ( QWidget *parent = 0, const char *name = 0 ); + FilterBar ( TQWidget *tqparent = 0, const char *name = 0 ); virtual ~FilterBar(); bool matchesFilter(kt::TorrentInterface* tc); @@ -52,19 +53,19 @@ public: void loadSettings(KConfig* cfg); private slots: - void slotChangeFilter(const QString& nameFilter); + void slotChangeFilter(const TQString& nameFilter); protected: - virtual void keyPressEvent ( QKeyEvent* event ); - virtual void hideEvent(QHideEvent* event); + virtual void keyPressEvent ( TQKeyEvent* event ); + virtual void hideEvent(TQHideEvent* event); private: - QLabel* m_filter; + TQLabel* m_filter; KLineEdit* m_filterInput; KPushButton* m_clear; - QCheckBox* m_case_sensitive; + TQCheckBox* m_case_sensitive; KToolBarButton* m_close; - QString m_name_filter; + TQString m_name_filter; }; #endif diff --git a/apps/ktorrent/generalpref.ui b/apps/ktorrent/generalpref.ui index e8ffe7d..5a17912 100644 --- a/apps/ktorrent/generalpref.ui +++ b/apps/ktorrent/generalpref.ui @@ -1,6 +1,6 @@ GeneralPref - + GeneralPref @@ -29,14 +29,14 @@ Expanding - + 20 50 - + groupBox5 @@ -50,7 +50,7 @@ unnamed - + use_encryption @@ -64,7 +64,7 @@ Protocol encryption is used to prevent ISP's from slowing down bittorrent connections. - + allow_unencrypted @@ -77,7 +77,7 @@ - + groupBox4 @@ -91,7 +91,7 @@ unnamed - + use_dht @@ -102,15 +102,15 @@ - + - layout7 + tqlayout7 unnamed - + dht_port_label @@ -142,7 +142,7 @@ Expanding - + 40 20 @@ -153,7 +153,7 @@ - + groupBox3 @@ -164,7 +164,7 @@ unnamed - + custom_ip_check @@ -172,15 +172,15 @@ Se&nd the tracker a custom IP address or hostname - + - layout3 + tqlayout3 unnamed - + custom_ip_label @@ -197,7 +197,7 @@ - + groupBox3_2 @@ -208,7 +208,7 @@ unnamed - + show_systray_icon @@ -216,7 +216,7 @@ Show s&ystem tray icon - + show_speedbar @@ -224,7 +224,7 @@ Show speed &bar in tray icon - + show_popups @@ -235,15 +235,15 @@ - + - layout13 + tqlayout13 unnamed - + textLabel1_3_2_2_2_2 @@ -268,7 +268,7 @@ 500 - + textLabel1_3_2_2_2 @@ -297,7 +297,7 @@ - + groupBox1 @@ -308,15 +308,15 @@ unnamed - + - layout24 + tqlayout24 unnamed - + textLabel1 @@ -334,7 +334,7 @@ - + checkCompletedDir @@ -345,7 +345,7 @@ - + autosave_downloads_check @@ -353,9 +353,9 @@ &Automatically save downloads to: - + - layout14 + tqlayout14 @@ -387,7 +387,7 @@ - + checkTorrentDir @@ -453,7 +453,7 @@ show_systray_icon - + knuminput.h klineedit.h diff --git a/apps/ktorrent/groups/group.cpp b/apps/ktorrent/groups/group.cpp index b8441a7..9a1fd90 100644 --- a/apps/ktorrent/groups/group.cpp +++ b/apps/ktorrent/groups/group.cpp @@ -24,7 +24,7 @@ namespace kt { - Group::Group(const QString & name,int flags) : name(name),flags(flags) + Group::Group(const TQString & name,int flags) : name(name),flags(flags) {} @@ -39,13 +39,13 @@ namespace kt { } - void Group::setIconByName(const QString & in) + void Group::setIconByName(const TQString & in) { icon_name = in; icon = KGlobal::iconLoader()->loadIcon(in,KIcon::Small); } - void Group::rename(const QString & nn) + void Group::rename(const TQString & nn) { name = nn; } diff --git a/apps/ktorrent/groups/group.h b/apps/ktorrent/groups/group.h index e1fa7ab..9f4775d 100644 --- a/apps/ktorrent/groups/group.h +++ b/apps/ktorrent/groups/group.h @@ -20,8 +20,8 @@ #ifndef KTGROUP_H #define KTGROUP_H -#include -#include +#include +#include namespace bt { @@ -43,9 +43,9 @@ namespace kt class Group { protected: - QString name; - QPixmap icon; - QString icon_name; + TQString name; + TQPixmap icon; + TQString icon_name; int flags; public: enum Properties @@ -60,7 +60,7 @@ namespace kt * @param name The name of the group * @param flags Properties of the group */ - Group(const QString & name,int flags); + Group(const TQString & name,int flags); virtual ~Group(); /// See if this is a standard group. @@ -73,19 +73,19 @@ namespace kt * Rename the group. * @param nn The new name */ - void rename(const QString & nn); + void rename(const TQString & nn); /** * Set the group icon by name. * @param in The icon name */ - void setIconByName(const QString & in); + void setIconByName(const TQString & in); /// Get the name of the group - const QString & groupName() const {return name;} + const TQString & groupName() const {return name;} /// Get the icon of the group - const QPixmap & groupIcon() const {return icon;} + const TQPixmap & groupIcon() const {return icon;} /** * Save the torrents.The torrents should be save in a bencoded file. diff --git a/apps/ktorrent/groups/groupmanager.cpp b/apps/ktorrent/groups/groupmanager.cpp index b6a84c4..8e78003 100644 --- a/apps/ktorrent/groups/groupmanager.cpp +++ b/apps/ktorrent/groups/groupmanager.cpp @@ -97,9 +97,9 @@ namespace kt } - Group* GroupManager::newGroup(const QString & name) + Group* GroupManager::newGroup(const TQString & name) { - if (find(name)) + if (tqfind(name)) return 0; Group* g = new TorrentGroup(name); @@ -109,11 +109,11 @@ namespace kt bool GroupManager::canRemove(const Group* g) const { - return default_groups.find(g->groupName()) == 0; + return default_groups.tqfind(g->groupName()) == 0; } - void GroupManager::saveGroups(const QString & fn) + void GroupManager::saveGroups(const TQString & fn) { bt::File fptr; if (!fptr.open(fn,"wb")) @@ -142,7 +142,7 @@ namespace kt - void GroupManager::loadGroups(const QString & fn) + void GroupManager::loadGroups(const TQString & fn) { bt::File fptr; if (!fptr.open(fn,"rb")) @@ -153,7 +153,7 @@ namespace kt try { Uint32 fs = bt::FileSize(fn); - QByteArray data(fs); + TQByteArray data(fs); fptr.read(data.data(),fs); BDecoder dec(data,false); @@ -180,7 +180,7 @@ namespace kt throw; } - if (!find(g->groupName())) + if (!tqfind(g->groupName())) insert(g->groupName(),g); else delete g; @@ -201,9 +201,9 @@ namespace kt } } - void GroupManager::renameGroup(const QString & old_name,const QString & new_name) + void GroupManager::renameGroup(const TQString & old_name,const TQString & new_name) { - Group* g = find(old_name); + Group* g = tqfind(old_name); if (!g) return; @@ -214,8 +214,8 @@ namespace kt setAutoDelete(true); } - Group* GroupManager::findDefault(const QString & name) + Group* GroupManager::findDefault(const TQString & name) { - return default_groups.find(name); + return default_groups.tqfind(name); } } diff --git a/apps/ktorrent/groups/groupmanager.h b/apps/ktorrent/groups/groupmanager.h index d988b70..135698c 100644 --- a/apps/ktorrent/groups/groupmanager.h +++ b/apps/ktorrent/groups/groupmanager.h @@ -20,7 +20,7 @@ #ifndef KTGROUPMANAGER_H #define KTGROUPMANAGER_H -#include +#include #include #include @@ -35,9 +35,9 @@ namespace kt * * Manages all user created groups and the standard groups. */ - class GroupManager : public bt::PtrMap + class GroupManager : public bt::PtrMap { - bt::PtrMap default_groups; + bt::PtrMap default_groups; public: GroupManager(); @@ -48,7 +48,7 @@ namespace kt * @param name Name of the group * @return Pointer to the group or NULL, if another group already exists with the same name. */ - Group* newGroup(const QString & name); + Group* newGroup(const TQString & name); /// Get the group off all torrents Group* allGroup() {return findDefault(i18n("All Torrents"));} @@ -90,19 +90,19 @@ namespace kt Group* activeUploadsGroup() { return findDefault(i18n("Active uploads")); } /// Find a default group by the given name - Group* findDefault(const QString & name); + Group* findDefault(const TQString & name); /** * Save the groups to a file. * @param fn The filename */ - void saveGroups(const QString & fn); + void saveGroups(const TQString & fn); /** * Load the groups from a file * @param fn The filename */ - void loadGroups(const QString & fn); + void loadGroups(const TQString & fn); /** * See if we can remove a group. @@ -123,7 +123,7 @@ namespace kt * @param old_name The old name * @param new_name The new name */ - void renameGroup(const QString & old_name,const QString & new_name); + void renameGroup(const TQString & old_name,const TQString & new_name); }; diff --git a/apps/ktorrent/groups/groupview.cpp b/apps/ktorrent/groups/groupview.cpp index 3d0751f..af33316 100644 --- a/apps/ktorrent/groups/groupview.cpp +++ b/apps/ktorrent/groups/groupview.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include "groupview.h" @@ -41,13 +41,13 @@ using namespace bt; namespace kt { - GroupViewItem::GroupViewItem(GroupView* parent,Group* g) : KListViewItem(parent),gview(parent) + GroupViewItem::GroupViewItem(GroupView* tqparent,Group* g) : KListViewItem(tqparent),gview(tqparent) { setText(0,g->groupName()); setPixmap(0,g->groupIcon()); } - GroupViewItem::GroupViewItem(GroupView* gview,KListViewItem* parent,Group* g) : KListViewItem(parent),gview(gview) + GroupViewItem::GroupViewItem(GroupView* gview,KListViewItem* tqparent,Group* g) : KListViewItem(tqparent),gview(gview) { setText(0,g->groupName()); setPixmap(0,g->groupIcon()); @@ -57,16 +57,16 @@ namespace kt { } - int GroupViewItem::compare(QListViewItem* i,int ,bool ) const + int GroupViewItem::compare(TQListViewItem* i,int ,bool ) const { if (text(1).isNull() && i->text(1).isNull()) - return QString::compare(text(0),i->text(0)); + return TQString::compare(text(0),i->text(0)); else - return QString::compare(text(1),i->text(1)); + return TQString::compare(text(1),i->text(1)); } - GroupView::GroupView(ViewManager* view,KActionCollection* col,QWidget *parent, const char *name) - : KListView(parent, name),view(view),custom_root(0) + GroupView::GroupView(ViewManager* view,KActionCollection* col,TQWidget *tqparent, const char *name) + : KListView(tqparent, name),view(view),custom_root(0) { setFullWidth(true); setRootIsDecorated(true); @@ -80,11 +80,11 @@ namespace kt current = gman->allGroup(); - connect(this,SIGNAL(clicked(QListViewItem*)),this,SLOT(onExecuted( QListViewItem* ))); - connect(this,SIGNAL(contextMenu(KListView*,QListViewItem*,const QPoint & )), - this,SLOT(showContextMenu( KListView*, QListViewItem*, const QPoint& ))); - connect(this,SIGNAL(dropped(QDropEvent*,QListViewItem*)), - this,SLOT(onDropped( QDropEvent*, QListViewItem* ))); + connect(this,TQT_SIGNAL(clicked(TQListViewItem*)),this,TQT_SLOT(onExecuted( TQListViewItem* ))); + connect(this,TQT_SIGNAL(contextMenu(KListView*,TQListViewItem*,const TQPoint & )), + this,TQT_SLOT(showContextMenu( KListView*, TQListViewItem*, const TQPoint& ))); + connect(this,TQT_SIGNAL(dropped(TQDropEvent*,TQListViewItem*)), + this,TQT_SLOT(onDropped( TQDropEvent*, TQListViewItem* ))); current_item = 0; menu = 0; @@ -136,16 +136,16 @@ namespace kt menu = new KPopupMenu(this); new_group = new KAction(i18n("New Group"),"filenew",0, - this, SLOT(addGroup()),col, "New Group"); + TQT_TQOBJECT(this), TQT_SLOT(addGroup()),col, "New Group"); edit_group = new KAction(i18n("Edit Name"),"edit",0, - this, SLOT(editGroupName()),col,"Edit Group Name"); + TQT_TQOBJECT(this), TQT_SLOT(editGroupName()),col,"Edit Group Name"); remove_group = new KAction(i18n("Remove Group"),"remove",0, - this, SLOT(removeGroup()),col,"Remove Group"); + TQT_TQOBJECT(this), TQT_SLOT(removeGroup()),col,"Remove Group"); open_in_new_tab = new KAction(i18n("Open Tab"),"fileopen",0, - this,SLOT(openView()),col,"Open Tab"); + TQT_TQOBJECT(this) ,TQT_SLOT(openView()),col,"Open Tab"); open_in_new_tab->plug(menu); menu->insertSeparator(); @@ -156,14 +156,14 @@ namespace kt void GroupView::addGroup() { - QString name = KInputDialog::getText(QString::null,i18n("Please enter the group name.")); + TQString name = KInputDialog::getText(TQString(),i18n("Please enter the group name.")); if (name.isNull() || name.length() == 0) return; - if (gman->find(name)) + if (gman->tqfind(name)) { - KMessageBox::error(this,i18n("The group %1 already exists.").arg(name)); + KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name)); return; } @@ -177,7 +177,7 @@ namespace kt if (!current_item) return; - Group* g = groups.find(current_item); + Group* g = groups.tqfind(current_item); if (!g) return; @@ -200,11 +200,11 @@ namespace kt if (!current_item) return; - Group* g = groups.find(current_item); + Group* g = groups.tqfind(current_item); if (!g) return; - QString name = KInputDialog::getText(QString::null,i18n("Please enter the new group name."),g->groupName()); + TQString name = KInputDialog::getText(TQString(),i18n("Please enter the new group name."),g->groupName()); if (name.isNull() || name.length() == 0) return; @@ -212,9 +212,9 @@ namespace kt if (g->groupName() == name) return; - if (gman->find(name)) + if (gman->tqfind(name)) { - KMessageBox::error(this,i18n("The group %1 already exists.").arg(name)); + KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name)); } else { @@ -226,12 +226,12 @@ namespace kt } } - GroupViewItem* GroupView::addGroup(Group* g,KListViewItem* parent) + GroupViewItem* GroupView::addGroup(Group* g,KListViewItem* tqparent) { GroupViewItem* li = 0; - if (parent) + if (tqparent) { - li = new GroupViewItem(this,parent,g); + li = new GroupViewItem(this,tqparent,g); } else { @@ -240,19 +240,19 @@ namespace kt } groups.insert(li,g); - if (custom_root && custom_root->childCount() == 1 && custom_root == parent) + if (custom_root && custom_root->childCount() == 1 && custom_root == tqparent) setOpen(custom_root,true); return li; } - void GroupView::showContextMenu(KListView* ,QListViewItem* item,const QPoint & p) + void GroupView::showContextMenu(KListView* ,TQListViewItem* item,const TQPoint & p) { current_item = dynamic_cast(item); Group* g = 0; if (current_item) - g = groups.find(current_item); + g = groups.tqfind(current_item); if (!g ||!gman->canRemove(g)) { @@ -270,7 +270,7 @@ namespace kt menu->popup(p); } - void GroupView::onExecuted(QListViewItem* item) + void GroupView::onExecuted(TQListViewItem* item) { if (!item) return; @@ -278,7 +278,7 @@ namespace kt if (!li) return; - Group* g = groups.find(li); + Group* g = groups.tqfind(li); if (g) { current = g; @@ -286,18 +286,18 @@ namespace kt } } - void GroupView::onDropped(QDropEvent* e,QListViewItem *after) + void GroupView::onDropped(TQDropEvent* e,TQListViewItem *after) { GroupViewItem* li = dynamic_cast(after); if (!li) return; - TorrentGroup* g = dynamic_cast(groups.find(li)); + TorrentGroup* g = dynamic_cast(groups.tqfind(li)); if (g) { - QValueList sel; + TQValueList sel; view->getSelection(sel); - QValueList::iterator i = sel.begin(); + TQValueList::iterator i = sel.begin(); while (i != sel.end()) { g->add(*i); @@ -307,7 +307,7 @@ namespace kt } } - bool GroupView::acceptDrag(QDropEvent* event) const + bool GroupView::acceptDrag(TQDropEvent* event) const { return event->provides("application/x-ktorrent-drag-object"); } @@ -327,9 +327,9 @@ namespace kt } } - void GroupView::onGroupsSubMenuItemActivated(KTorrentView* v,const QString & group) + void GroupView::onGroupsSubMenuItemActivated(KTorrentView* v,const TQString & group) { - Group* g = gman->find(group); + Group* g = gman->tqfind(group); if (g) { v->addSelectionToGroup(g); @@ -337,9 +337,9 @@ namespace kt } } - const Group* GroupView::findGroup(const QString & name) const + const Group* GroupView::findGroup(const TQString & name) const { - Group* g = gman->find(name); + Group* g = gman->tqfind(name); if (!g) g = gman->findDefault(name); @@ -351,7 +351,7 @@ namespace kt if (!current_item) return; - Group* g = groups.find(current_item); + Group* g = groups.tqfind(current_item); if (g) openNewTab(g); } diff --git a/apps/ktorrent/groups/groupview.h b/apps/ktorrent/groups/groupview.h index de5befb..d78f318 100644 --- a/apps/ktorrent/groups/groupview.h +++ b/apps/ktorrent/groups/groupview.h @@ -40,11 +40,11 @@ namespace kt Group* g; GroupView* gview; public: - GroupViewItem(GroupView* parent,Group* g); - GroupViewItem(GroupView* gview,KListViewItem* parent,Group* g); + GroupViewItem(GroupView* tqparent,Group* g); + GroupViewItem(GroupView* gview,KListViewItem* tqparent,Group* g); virtual ~GroupViewItem(); - virtual int compare(QListViewItem* i,int col,bool ascending) const; + virtual int compare(TQListViewItem* i,int col,bool ascending) const; }; /** @@ -53,8 +53,9 @@ namespace kt class GroupView : public KListView { Q_OBJECT + TQ_OBJECT public: - GroupView(ViewManager* view,KActionCollection* col,QWidget *parent = 0, const char *name = 0); + GroupView(ViewManager* view,KActionCollection* col,TQWidget *tqparent = 0, const char *name = 0); virtual ~GroupView(); /// Get the current group @@ -67,7 +68,7 @@ namespace kt void loadGroups(); /// Find a group by its name - const Group* findGroup(const QString & name) const; + const Group* findGroup(const TQString & name) const; GroupManager* groupManager() const { return gman; } @@ -78,16 +79,16 @@ namespace kt void updateGroupsSubMenu(KPopupMenu* gsm); /// An item was activated in the groups sub menu of a KTorrentView - void onGroupsSubMenuItemActivated(KTorrentView* v,const QString & group); + void onGroupsSubMenuItemActivated(KTorrentView* v,const TQString & group); private slots: - void onExecuted(QListViewItem* item); - void showContextMenu(KListView* ,QListViewItem* item,const QPoint & p); + void onExecuted(TQListViewItem* item); + void showContextMenu(KListView* ,TQListViewItem* item,const TQPoint & p); void addGroup(); void removeGroup(); void editGroupName(); - void onDropped(QDropEvent* e,QListViewItem *after); - virtual bool acceptDrag(QDropEvent* event) const; + void onDropped(TQDropEvent* e,TQListViewItem *after); + virtual bool acceptDrag(TQDropEvent* event) const; void openView(); @@ -99,14 +100,14 @@ namespace kt private: void createMenu(KActionCollection* col); - GroupViewItem* addGroup(Group* g,KListViewItem* parent); + GroupViewItem* addGroup(Group* g,KListViewItem* tqparent); private: ViewManager* view; KListViewItem* custom_root; bt::PtrMap groups; GroupManager* gman; - QString save_file; + TQString save_file; Group* current; diff --git a/apps/ktorrent/groups/torrentdrag.cpp b/apps/ktorrent/groups/torrentdrag.cpp index fc7b366..c0aad98 100644 --- a/apps/ktorrent/groups/torrentdrag.cpp +++ b/apps/ktorrent/groups/torrentdrag.cpp @@ -24,7 +24,7 @@ namespace kt { - TorrentDrag::TorrentDrag(QWidget* src, const char *name) : QStoredDrag("application/x-ktorrent-drag-object",src, name) + TorrentDrag::TorrentDrag(TQWidget* src, const char *name) : TQStoredDrag("application/x-ktorrent-drag-object",src, name) { setPixmap(KGlobal::iconLoader()->loadIcon("player_playlist",KIcon::Small)); } diff --git a/apps/ktorrent/groups/torrentdrag.h b/apps/ktorrent/groups/torrentdrag.h index a926347..24b6fb2 100644 --- a/apps/ktorrent/groups/torrentdrag.h +++ b/apps/ktorrent/groups/torrentdrag.h @@ -20,7 +20,7 @@ #ifndef KTTORRENTDRAG_H #define KTTORRENTDRAG_H -#include +#include namespace kt { @@ -29,11 +29,12 @@ namespace kt /** @author Joris Guisson */ - class TorrentDrag : public QStoredDrag + class TorrentDrag : public TQStoredDrag { Q_OBJECT + TQ_OBJECT public: - TorrentDrag(QWidget* src,const char *name = 0); + TorrentDrag(TQWidget* src,const char *name = 0); virtual ~TorrentDrag(); }; diff --git a/apps/ktorrent/groups/torrentgroup.cpp b/apps/ktorrent/groups/torrentgroup.cpp index efb09a9..65fed38 100644 --- a/apps/ktorrent/groups/torrentgroup.cpp +++ b/apps/ktorrent/groups/torrentgroup.cpp @@ -30,7 +30,7 @@ using namespace bt; namespace kt { - TorrentGroup::TorrentGroup(const QString& name): Group(name,MIXED_GROUP|CUSTOM_GROUP) + TorrentGroup::TorrentGroup(const TQString& name): Group(name,MIXED_GROUP|CUSTOM_GROUP) { setIconByName("player_playlist"); } @@ -51,7 +51,7 @@ namespace kt if (hashes.count(tor->getInfoHash())) { /* bt::Out(SYS_GEN|LOG_DEBUG) << - QString("TG %1 : Torrent %2 from hashes list").arg(groupName()).arg(tor->getStats().torrent_name) << endl; + TQString("TG %1 : Torrent %2 from hashes list").tqarg(groupName()).tqarg(tor->getStats().torrent_name) << endl; */ hashes.erase(tor->getInfoHash()); torrents.insert(tor); @@ -74,9 +74,9 @@ namespace kt void TorrentGroup::save(bt::BEncoder* enc) { enc->beginDict(); - enc->write("name"); enc->write(name.local8Bit()); - enc->write("icon"); enc->write(icon_name.local8Bit()); - enc->write("hashes"); enc->beginList(); + enc->write(TQString("name")); enc->write(name.local8Bit()); + enc->write(TQString("icon")); enc->write(icon_name.local8Bit()); + enc->write(TQString("hashes")); enc->beginList(); std::set::iterator i = torrents.begin(); while (i != torrents.end()) { @@ -102,15 +102,15 @@ namespace kt if (!vn || vn->data().getType() != bt::Value::STRING) throw bt::Error("invalid or missing name"); - QByteArray tmp = vn->data().toByteArray(); - name = QString::fromLocal8Bit(tmp.data(),tmp.size()); + TQByteArray tmp = vn->data().toByteArray(); + name = TQString::fromLocal8Bit(tmp.data(),tmp.size()); vn = dn->getValue("icon"); if (!vn || vn->data().getType() != bt::Value::STRING) throw bt::Error("invalid or missing icon"); tmp = vn->data().toByteArray(); - setIconByName(QString::fromLocal8Bit(tmp.data(),tmp.size())); + setIconByName(TQString::fromLocal8Bit(tmp.data(),tmp.size())); BListNode* ln = dn->getList("hashes"); if (!ln) @@ -122,7 +122,7 @@ namespace kt if (!vn || vn->data().getType() != bt::Value::STRING) continue; - QByteArray ba = vn->data().toByteArray(); + TQByteArray ba = vn->data().toByteArray(); if (ba.size() != 20) continue; diff --git a/apps/ktorrent/groups/torrentgroup.h b/apps/ktorrent/groups/torrentgroup.h index 40989fd..14f1b37 100644 --- a/apps/ktorrent/groups/torrentgroup.h +++ b/apps/ktorrent/groups/torrentgroup.h @@ -37,7 +37,7 @@ namespace kt std::set torrents; std::set hashes; public: - TorrentGroup(const QString& name); + TorrentGroup(const TQString& name); virtual ~TorrentGroup(); virtual bool isMember(TorrentInterface* tor); diff --git a/apps/ktorrent/ipfilterwidget.cpp b/apps/ktorrent/ipfilterwidget.cpp index ec32117..8914f5a 100644 --- a/apps/ktorrent/ipfilterwidget.cpp +++ b/apps/ktorrent/ipfilterwidget.cpp @@ -24,10 +24,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -40,13 +40,13 @@ using namespace bt; -IPFilterWidget::IPFilterWidget(QWidget *parent, const char *name) - :BlacklistWidgetBase(parent, name) +IPFilterWidget::IPFilterWidget(TQWidget *tqparent, const char *name) + :BlacklistWidgetBase(tqparent, name) { IPBlocklist& ipfilter = IPBlocklist::instance(); - QStringList* blocklist = ipfilter.getBlocklist(); + TQStringList* blocklist = ipfilter.getBlocklist(); - for (QStringList::Iterator it = blocklist->begin(); it != blocklist->end(); ++it) + for (TQStringList::Iterator it = blocklist->begin(); it != blocklist->end(); ++it) { new KListViewItem(lstPeers, *it); } @@ -58,14 +58,14 @@ void IPFilterWidget::btnAdd_clicked() { int var=0; - QRegExp rx("([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3})"); - QRegExpValidator v( rx,0); + TQRegExp rx("([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3})"); + TQRegExpValidator v( rx,0); - QString ip = peerIP->text(); + TQString ip = peerIP->text(); - if(v.validate( ip, var ) == QValidator::Acceptable) + if(v.validate( ip, var ) == TQValidator::Acceptable) { - if(lstPeers->findItem(ip, 0) == 0) + if(lstPeers->tqfindItem(ip, 0) == 0) new KListViewItem(lstPeers, ip); } else @@ -85,7 +85,7 @@ void IPFilterWidget::btnClear_clicked() void IPFilterWidget::btnOpen_clicked() { - QString lf = KFileDialog::getOpenFileName(QString::null, "*.txt|",this,i18n("Choose a file")); + TQString lf = KFileDialog::getOpenFileName(TQString(), "*.txt|",this,i18n("Choose a file")); if(lf.isEmpty()) return; @@ -97,7 +97,7 @@ void IPFilterWidget::btnOpen_clicked() void IPFilterWidget::btnSave_clicked() { - QString sf = KFileDialog::getSaveFileName(QString::null,"*.txt|",this,i18n("Choose a filename to save under")); + TQString sf = KFileDialog::getSaveFileName(TQString(),"*.txt|",this,i18n("Choose a filename to save under")); if(sf.isEmpty()) return; @@ -117,9 +117,9 @@ void IPFilterWidget::btnApply_clicked() int count = 0; - QStringList* peers = new QStringList(); + TQStringList* peers = new TQStringList(); - QListViewItemIterator it(lstPeers); + TQListViewItemIterator it(lstPeers); while (it.current()) { *peers << it.current()->text(0); @@ -134,19 +134,19 @@ void IPFilterWidget::btnApply_clicked() Out(SYS_IPF|LOG_NOTICE) << "Loaded " << count << " blocked IP ranges." << endl; } -void IPFilterWidget::saveFilter(QString& fn) +void IPFilterWidget::saveFilter(TQString& fn) { - QFile fptr(fn); + TQFile fptr(fn); if (!fptr.open(IO_WriteOnly)) { - Out(SYS_GEN|LOG_NOTICE) << QString("Could not open file %1 for writing.").arg(fn) << endl; + Out(SYS_GEN|LOG_NOTICE) << TQString("Could not open file %1 for writing.").tqarg(fn) << endl; return; } - QTextStream out(&fptr); + TQTextStream out(&fptr); - QListViewItemIterator it(lstPeers); + TQListViewItemIterator it(lstPeers); while (it.current()) { out << it.current()->text(0) << ::endl; @@ -156,16 +156,16 @@ void IPFilterWidget::saveFilter(QString& fn) fptr.close(); } -void IPFilterWidget::loadFilter(QString& fn) +void IPFilterWidget::loadFilter(TQString& fn) { - QFile dat(fn); + TQFile dat(fn); dat.open(IO_ReadOnly); - QTextStream stream( &dat ); - QString line; + TQTextStream stream( &dat ); + TQString line; - QRegExp rx("([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3})"); - QRegExpValidator v( rx,0); + TQRegExp rx("([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3}).([*]|[0-9]{1,3})"); + TQRegExpValidator v( rx,0); int i=0; @@ -175,7 +175,7 @@ void IPFilterWidget::loadFilter(QString& fn) while ( !stream.atEnd() && i < MAX_RANGES ) { line = stream.readLine(); - if ( v.validate( line, var ) != QValidator::Acceptable ) + if ( v.validate( line, var ) != TQValidator::Acceptable ) { err = true; continue; diff --git a/apps/ktorrent/ipfilterwidget.h b/apps/ktorrent/ipfilterwidget.h index 29d5a04..1dadc3f 100644 --- a/apps/ktorrent/ipfilterwidget.h +++ b/apps/ktorrent/ipfilterwidget.h @@ -30,8 +30,9 @@ class IPFilterWidget: public BlacklistWidgetBase { Q_OBJECT + TQ_OBJECT public: - IPFilterWidget(QWidget *parent = 0, const char *name = 0); + IPFilterWidget(TQWidget *tqparent = 0, const char *name = 0); virtual void btnApply_clicked(); virtual void btnOk_clicked(); @@ -41,8 +42,8 @@ class IPFilterWidget: public BlacklistWidgetBase virtual void btnRemove_clicked(); virtual void btnAdd_clicked(); - void saveFilter(QString& fn); - void loadFilter(QString& fn); + void saveFilter(TQString& fn); + void loadFilter(TQString& fn); }; #endif diff --git a/apps/ktorrent/ipfilterwidgetbase.ui b/apps/ktorrent/ipfilterwidgetbase.ui index b41fb68..a4d56fc 100644 --- a/apps/ktorrent/ipfilterwidgetbase.ui +++ b/apps/ktorrent/ipfilterwidgetbase.ui @@ -1,6 +1,6 @@ BlacklistWidgetBase - + BlacklistWidgetBase @@ -22,18 +22,18 @@ Minimum - + textLabel2 Note: Blacklist applies to current session only. Use save/open to save your entries or use IPFilter plugin (PeerGuardian). - + WordBreak|AlignVCenter - + groupBox1 @@ -73,22 +73,22 @@ Fixed - + 20 20 - + - layout8 + tqlayout8 unnamed - + textLabel1 @@ -109,9 +109,9 @@ - + - layout7 + tqlayout7 @@ -144,7 +144,7 @@ Fixed - + 20 20 @@ -192,7 +192,7 @@ Fixed - + 20 16 @@ -234,7 +234,7 @@ Expanding - + 20 30 @@ -344,7 +344,7 @@ peerIP btnAdd - + btnAdd_clicked() btnRemove_clicked() btnClear_clicked() @@ -352,8 +352,8 @@ btnSave_clicked() btnOk_clicked() btnApply_clicked() - - + + klistview.h kpushbutton.h diff --git a/apps/ktorrent/ktorrent.cpp b/apps/ktorrent/ktorrent.cpp index 50b6e7f..51c945b 100644 --- a/apps/ktorrent/ktorrent.cpp +++ b/apps/ktorrent/ktorrent.cpp @@ -21,12 +21,12 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -101,7 +101,7 @@ namespace kt { - QString DataDir(); + TQString DataDir(); } #include @@ -117,11 +117,11 @@ KTorrent::KTorrent() { setHidden(true); //setToolviewStyle(KMdi::TextAndIcon); - connect(this,SIGNAL(widgetChanged(QWidget*)),this,SLOT(currentTabChanged(QWidget*))); + connect(this,TQT_SIGNAL(widgetChanged(TQWidget*)),this,TQT_SLOT(currentTabChanged(TQWidget*))); - m_view_man = new ViewManager(this); + m_view_man = new ViewManager(TQT_TQOBJECT(this)); m_group_view = new kt::GroupView(m_view_man,actionCollection()); - connect(m_group_view,SIGNAL(openNewTab(kt::Group*)),this,SLOT(openView(kt::Group*))); + connect(m_group_view,TQT_SIGNAL(openNewTab(kt::Group*)),this,TQT_SLOT(openView(kt::Group*))); m_pref = new KTorrentPreferences(*this); @@ -134,37 +134,37 @@ KTorrent::KTorrent() m_group_view->loadGroups(); m_view_man->restoreViewState(KGlobal::config(),this); - QToolButton* tb = new QToolButton(m_activeTabWidget); + TQToolButton* tb = new TQToolButton(m_activeTabWidget); tb->setIconSet(SmallIcon("tab_new")); tb->adjustSize(); - connect(tb,SIGNAL(clicked()),this,SLOT(openDefaultView())); + connect(tb,TQT_SIGNAL(clicked()),this,TQT_SLOT(openDefaultView())); m_activeTabWidget->setCornerWidget(tb, TopLeft); - connect(m_group_view,SIGNAL(currentGroupChanged( kt::Group* )), - this,SLOT(groupChanged(kt::Group*))); + connect(m_group_view,TQT_SIGNAL(currentGroupChanged( kt::Group* )), + this,TQT_SLOT(groupChanged(kt::Group*))); - connect(m_group_view,SIGNAL(groupRenamed(kt::Group*)), - this,SLOT(groupRenamed(kt::Group*))); + connect(m_group_view,TQT_SIGNAL(groupRenamed(kt::Group*)), + this,TQT_SLOT(groupRenamed(kt::Group*))); - connect(m_group_view,SIGNAL(groupRemoved(kt::Group*)), - this,SLOT(groupRemoved(kt::Group*))); + connect(m_group_view,TQT_SIGNAL(groupRemoved(kt::Group*)), + this,TQT_SLOT(groupRemoved(kt::Group*))); - connect(m_core,SIGNAL(torrentAdded(kt::TorrentInterface* )), - m_view_man,SLOT(addTorrent(kt::TorrentInterface* ))); + connect(m_core,TQT_SIGNAL(torrentAdded(kt::TorrentInterface* )), + m_view_man,TQT_SLOT(addTorrent(kt::TorrentInterface* ))); - connect(m_core,SIGNAL(torrentRemoved(kt::TorrentInterface* )), - m_view_man,SLOT(removeTorrent(kt::TorrentInterface* ))); + connect(m_core,TQT_SIGNAL(torrentRemoved(kt::TorrentInterface* )), + m_view_man,TQT_SLOT(removeTorrent(kt::TorrentInterface* ))); - connect(m_core, SIGNAL(torrentRemoved( kt::TorrentInterface* )), - m_group_view, SLOT(onTorrentRemoved( kt::TorrentInterface* ))); + connect(m_core, TQT_SIGNAL(torrentRemoved( kt::TorrentInterface* )), + m_group_view, TQT_SLOT(onTorrentRemoved( kt::TorrentInterface* ))); m_statusInfo = new KSqueezedTextLabel(this); - m_statusSpeed = new QLabel(this); - m_statusTransfer = new QLabel(this); - m_statusDHT = new QLabel(this); - m_statusFirewall = new QLabel(this); + m_statusSpeed = new TQLabel(this); + m_statusTransfer = new TQLabel(this); + m_statusDHT = new TQLabel(this); + m_statusFirewall = new TQLabel(this); m_statusFirewall->setPixmap(SmallIcon("messagebox_warning")); - QToolTip::add(m_statusFirewall,i18n("No incoming connections (possibly firewalled)")); + TQToolTip::add(m_statusFirewall,i18n("No incoming connections (possibly firewalled)")); statusBar()->addWidget(m_statusFirewall); statusBar()->addWidget(m_statusInfo,1); @@ -181,9 +181,9 @@ KTorrent::KTorrent() setStandardToolBarMenuEnabled(true); - QToolTip::add(m_statusInfo, i18n("Info")); - QToolTip::add(m_statusTransfer, i18n("Data transferred during the current session")); - QToolTip::add(m_statusSpeed, i18n("Current speed of all torrents combined")); + TQToolTip::add(m_statusInfo, i18n("Info")); + TQToolTip::add(m_statusTransfer, i18n("Data transferred during the current session")); + TQToolTip::add(m_statusSpeed, i18n("Current speed of all torrents combined")); //first apply settings.. applySettings(false); @@ -191,7 +191,7 @@ KTorrent::KTorrent() m_core->loadTorrents(); m_core->loadPlugins(); - connect(&m_gui_update_timer, SIGNAL(timeout()), this, SLOT(updatedStats())); + connect(&m_gui_update_timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(updatedStats())); //Apply GUI update interval int val = 500; switch(Settings::guiUpdateInterval()) @@ -214,8 +214,8 @@ KTorrent::KTorrent() addToolWidget(m_group_view,"player_playlist",i18n("Groups"),DOCK_LEFT); - setAutoSaveSettings("WindowStatus",true); - KGlobal::config()->setGroup("WindowStatus"); + setAutoSaveSettings("WindowtqStatus",true); + KGlobal::config()->setGroup("WindowtqStatus"); bool hidden_on_exit = KGlobal::config()->readBoolEntry("hidden_on_exit",false); if (Settings::showSystemTrayIcon()) { @@ -243,7 +243,7 @@ KTorrent::KTorrent() m_statusbarAction->setChecked(!statusbar_hidden); MaximizeLimits(); - connect(&m_status_msg_expire,SIGNAL(timeout()),this,SLOT(statusBarMsgExpired())); + connect(&m_status_msg_expire,TQT_SIGNAL(timeout()),this,TQT_SLOT(statusBarMsgExpired())); m_view_man->updateActions(); } @@ -270,36 +270,36 @@ void KTorrent::openView(kt::Group* g) addTabPage(v,g->groupIcon(),v->caption(),m_view_man); - connect(v,SIGNAL(currentChanged(kt::TorrentInterface* )), - this,SLOT(currentTorrentChanged(kt::TorrentInterface* ))); + connect(v,TQT_SIGNAL(currentChanged(kt::TorrentInterface* )), + this,TQT_SLOT(currentTorrentChanged(kt::TorrentInterface* ))); - connect(v,SIGNAL(wantToRemove(kt::TorrentInterface*,bool )), - m_core,SLOT(remove(kt::TorrentInterface*,bool ))); + connect(v,TQT_SIGNAL(wantToRemove(kt::TorrentInterface*,bool )), + m_core,TQT_SLOT(remove(kt::TorrentInterface*,bool ))); - connect(v->listView(),SIGNAL(dropped(QDropEvent*,QListViewItem*)), - this,SLOT(urlDropped(QDropEvent*,QListViewItem*))); + connect(v->listView(),TQT_SIGNAL(dropped(TQDropEvent*,TQListViewItem*)), + this,TQT_SLOT(urlDropped(TQDropEvent*,TQListViewItem*))); - connect(v,SIGNAL(wantToStart( kt::TorrentInterface* )), - m_core,SLOT(start( kt::TorrentInterface* ))); + connect(v,TQT_SIGNAL(wantToStart( kt::TorrentInterface* )), + m_core,TQT_SLOT(start( kt::TorrentInterface* ))); - connect(v,SIGNAL(wantToStop( kt::TorrentInterface*, bool )), - m_core,SLOT(stop( kt::TorrentInterface*, bool ))); + connect(v,TQT_SIGNAL(wantToStop( kt::TorrentInterface*, bool )), + m_core,TQT_SLOT(stop( kt::TorrentInterface*, bool ))); - connect(v,SIGNAL(needsDataCheck( kt::TorrentInterface* )), - m_core,SLOT(doDataCheck( kt::TorrentInterface* ))); + connect(v,TQT_SIGNAL(needsDataCheck( kt::TorrentInterface* )), + m_core,TQT_SLOT(doDataCheck( kt::TorrentInterface* ))); - connect(v,SIGNAL(updateActions( int )), - this,SLOT(onUpdateActions( int ))); + connect(v,TQT_SIGNAL(updateActions( int )), + this,TQT_SLOT(onUpdateActions( int ))); //connect Core queue() with queue() from KTView. - connect(v, SIGNAL(queue( kt::TorrentInterface* )), - m_core, SLOT(queue( kt::TorrentInterface* ))); + connect(v, TQT_SIGNAL(queue( kt::TorrentInterface* )), + m_core, TQT_SLOT(queue( kt::TorrentInterface* ))); - connect(v,SIGNAL(updateGroupsSubMenu(KPopupMenu*)), - m_group_view,SLOT(updateGroupsSubMenu(KPopupMenu*))); + connect(v,TQT_SIGNAL(updateGroupsSubMenu(KPopupMenu*)), + m_group_view,TQT_SLOT(updateGroupsSubMenu(KPopupMenu*))); - connect(v,SIGNAL(groupsSubMenuItemActivated(KTorrentView*, const QString&)), - m_group_view,SLOT(onGroupsSubMenuItemActivated(KTorrentView*, const QString&))); + connect(v,TQT_SIGNAL(groupsSubMenuItemActivated(KTorrentView*, const TQString&)), + m_group_view,TQT_SLOT(onGroupsSubMenuItemActivated(KTorrentView*, const TQString&))); if (m_core) { @@ -313,7 +313,7 @@ void KTorrent::openView(kt::Group* g) } } -void KTorrent::openView(const QString & group_name) +void KTorrent::openView(const TQString & group_name) { const kt::Group* g = m_group_view->findGroup(group_name); if (g) @@ -342,17 +342,17 @@ void KTorrent::groupRemoved(kt::Group* g) m_view_man->groupRemoved(g,m_activeTabWidget,this,allg); } -void KTorrent::addTabPage(QWidget* page,const QIconSet & icon, - const QString & caption,kt::CloseTabListener* ctl) +void KTorrent::addTabPage(TQWidget* page,const TQIconSet & icon, + const TQString & caption,kt::CloseTabListener* ctl) { addWidget(page,caption); - page->setIcon(icon.pixmap(QIconSet::Small,QIconSet::Active)); + page->setIcon(icon.pixmap(TQIconSet::Small,TQIconSet::Active)); m_tab_map[page] = ctl; currentTabChanged(page); } -void KTorrent::addTabPage(QWidget* page,const QPixmap & icon, - const QString & caption,kt::CloseTabListener* ctl) +void KTorrent::addTabPage(TQWidget* page,const TQPixmap & icon, + const TQString & caption,kt::CloseTabListener* ctl) { addWidget(page,caption); page->setIcon(icon); @@ -361,13 +361,13 @@ void KTorrent::addTabPage(QWidget* page,const QPixmap & icon, } -void KTorrent::removeTabPage(QWidget* page) +void KTorrent::removeTabPage(TQWidget* page) { - if (!m_tab_map.contains(page)) + if (!m_tab_map.tqcontains(page)) return; m_tab_map.erase(page); - page->reparent(0,QPoint()); + page->reparent(0,TQPoint()); removeWidget(page); } @@ -417,7 +417,7 @@ void KTorrent::applySettings(bool change_port) if (Settings::useExternalIP()) Tracker::setCustomIP(Settings::externalIP()); else - Tracker::setCustomIP(QString::null); + Tracker::setCustomIP(TQString()); Downloader::setMemoryUsage(Settings::memoryUsage()); Choker::setNumUploadSlots(Settings::numUploadSlots()); @@ -497,68 +497,68 @@ void KTorrent::currentTorrentChanged(kt::TorrentInterface* tc) void KTorrent::setupActions() { - KStdAction::openNew(this,SLOT(fileNew()),actionCollection()); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::openNew(TQT_TQOBJECT(this),TQT_SLOT(fileNew()),actionCollection()); + KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection()); - KStdAction::paste(kapp,SLOT(paste()),actionCollection()); + KStdAction::paste(TQT_TQOBJECT(kapp),TQT_SLOT(paste()),actionCollection()); - m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); - m_menubarAction = KStdAction::showMenubar(this, SLOT(optionsShowMenubar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(optionsShowStatusbar()), actionCollection()); + m_menubarAction = KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(optionsShowMenubar()), actionCollection()); - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureToolbars()), actionCollection()); - KAction* pref = KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KAction* pref = KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(optionsPreferences()), actionCollection()); m_start = new KAction( - i18n("to start", "Start"), "ktstart",0,this, SLOT(startDownload()), + i18n("to start", "Start"), "ktstart",0,TQT_TQOBJECT(this), TQT_SLOT(startDownload()), actionCollection(), "Start"); m_stop = new KAction( - i18n("to stop", "Stop"), "ktstop",0,this, SLOT(stopDownload()), + i18n("to stop", "Stop"), "ktstop",0,TQT_TQOBJECT(this), TQT_SLOT(stopDownload()), actionCollection(), "Stop"); m_remove = new KAction( - i18n("Remove"), "ktremove",0,this, SLOT(removeDownload()), + i18n("Remove"), "ktremove",0,TQT_TQOBJECT(this), TQT_SLOT(removeDownload()), actionCollection(), "Remove"); m_startall = new KAction( - i18n("to start all", "Start All"), "ktstart_all",0,this, SLOT(startAllDownloadsCurrentView()), + i18n("to start all", "Start All"), "ktstart_all",0,TQT_TQOBJECT(this), TQT_SLOT(startAllDownloadsCurrentView()), actionCollection(), "Start all"); - m_startall_systray = new KAction(i18n("to start all", "Start All"), "ktstart_all",0,this, SLOT(startAllDownloads()),actionCollection()); + m_startall_systray = new KAction(i18n("to start all", "Start All"), "ktstart_all",0,TQT_TQOBJECT(this), TQT_SLOT(startAllDownloads()),actionCollection()); m_stopall = new KAction( - i18n("to stop all", "Stop All"), "ktstop_all",0,this, SLOT(stopAllDownloadsCurrentView()), + i18n("to stop all", "Stop All"), "ktstop_all",0,TQT_TQOBJECT(this), TQT_SLOT(stopAllDownloadsCurrentView()), actionCollection(), "Stop all"); - m_stopall_systray = new KAction(i18n("to stop all", "Stop All"), "ktstop_all",0,this, SLOT(stopAllDownloads()),actionCollection()); + m_stopall_systray = new KAction(i18n("to stop all", "Stop All"), "ktstop_all",0,TQT_TQOBJECT(this), TQT_SLOT(stopAllDownloads()),actionCollection()); m_pasteurl = new KAction( - i18n("to paste torrent URL", "Paste Torrent URL..."), "ktstart",0,this, SLOT(torrentPaste()), + i18n("to paste torrent URL", "Paste Torrent URL..."), "ktstart",0,TQT_TQOBJECT(this), TQT_SLOT(torrentPaste()), actionCollection(), "paste_url"); m_queuemgr = new KAction( i18n("to open Queue Manager", "Open Queue Manager..."), - "ktqueuemanager", 0, this, SLOT(queueManagerShow()), + "ktqueuemanager", 0, TQT_TQOBJECT(this), TQT_SLOT(queueManagerShow()), actionCollection(), "Queue manager"); m_queueaction = new KAction( i18n("Enqueue/Dequeue"), - "player_playlist", 0, m_view_man, SLOT(queueAction()), + "player_playlist", 0, m_view_man, TQT_SLOT(queueAction()), actionCollection(), "queue_action"); m_ipfilter = new KAction( i18n("IPFilter"), - "filter", 0, this, SLOT(showIPFilter()), + "filter", 0, TQT_TQOBJECT(this), TQT_SLOT(showIPFilter()), actionCollection(), "ipfilter_action"); m_datacheck = new KAction( i18n("Check Data Integrity"), - QString::null,0,m_view_man,SLOT(checkDataIntegrity()),actionCollection(),"check_data"); + TQString(),0,m_view_man,TQT_SLOT(checkDataIntegrity()),actionCollection(),"check_data"); - m_find = KStdAction::find(this,SLOT(find()),actionCollection()); + m_tqfind = KStdAction::find(TQT_TQOBJECT(this),TQT_SLOT(tqfind()),actionCollection()); //Plug actions to systemtray context menu m_startall_systray->plug(m_systray_icon->contextMenu()); @@ -598,7 +598,7 @@ bool KTorrent::queryExit() // stop timers to prevent update m_gui_update_timer.stop(); - KGlobal::config()->setGroup("WindowStatus"); + KGlobal::config()->setGroup("WindowtqStatus"); KGlobal::config()->writeEntry("hidden_on_exit",this->isHidden()); KGlobal::config()->writeEntry("menubar_hidden",menuBar()->isHidden()); KGlobal::config()->writeEntry("statusbar_hidden",statusBar()->isHidden()); @@ -623,8 +623,8 @@ void KTorrent::fileNew() void KTorrent::fileOpen() { - QString filter = "*.torrent|" + i18n("Torrent Files") + "\n*|" + i18n("All Files"); - KURL url = KFileDialog::getOpenURL(QString::null, filter, this, i18n("Open Location")); + TQString filter = "*.torrent|" + i18n("Torrent Files") + "\n*|" + i18n("All Files"); + KURL url = KFileDialog::getOpenURL(TQString(), filter, this, i18n("Open Location")); if (url.isValid()) load(url); @@ -720,7 +720,7 @@ void KTorrent::optionsConfigureToolbars() saveMainWindowSettings(KGlobal::config()); #endif KEditToolbar dlg(factory()); - connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(newToolbarConfig())); + connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(newToolbarConfig())); dlg.exec(); } @@ -748,7 +748,7 @@ void KTorrent::optionsPreferences() m_pref->exec(); } -void KTorrent::changeStatusbar(const QString& text) +void KTorrent::changeStatusbar(const TQString& text) { // display the text on the statusbar //statusBar()->message(text); @@ -757,7 +757,7 @@ void KTorrent::changeStatusbar(const QString& text) m_status_msg_expire.start(5000,true); } -void KTorrent::changeCaption(const QString& text) +void KTorrent::changeCaption(const TQString& text) { // display the text on the caption setCaption(text); @@ -771,7 +771,7 @@ void KTorrent::readProperties(KConfig*) { } -void KTorrent::urlDropped(QDropEvent* event,QListViewItem*) +void KTorrent::urlDropped(TQDropEvent* event,TQListViewItem*) { KURL::List urls; @@ -790,15 +790,15 @@ void KTorrent::updatedStats() CurrentStats stats = this->m_core->getStats(); //m_statusInfo->setText(i18n("Some info here e.g. connected/disconnected")); - QString tmp = i18n("Speed down: %1 / up: %2") - .arg(KBytesPerSecToString((double)stats.download_speed/1024.0)) - .arg(KBytesPerSecToString((double)stats.upload_speed/1024.0)); + TQString tmp = i18n("Speed down: %1 / up: %2") + .tqarg(KBytesPerSecToString((double)stats.download_speed/1024.0)) + .tqarg(KBytesPerSecToString((double)stats.upload_speed/1024.0)); m_statusSpeed->setText(tmp); - QString tmp1 = i18n("Transferred down: %1 / up: %2") - .arg(BytesToString(stats.bytes_downloaded)) - .arg(BytesToString(stats.bytes_uploaded)); + TQString tmp1 = i18n("Transferred down: %1 / up: %2") + .tqarg(BytesToString(stats.bytes_downloaded)) + .tqarg(BytesToString(stats.bytes_uploaded)); m_statusTransfer->setText(tmp1); if (ServerAuthenticate::isFirewalled() && m_core->getNumTorrentsRunning() > 0) @@ -817,7 +817,7 @@ void KTorrent::updatedStats() { const dht::Stats & s = Globals::instance().getDHT().getStats(); m_statusDHT->setText(i18n("DHT: %1 nodes, %2 tasks") - .arg(s.num_peers).arg(s.num_tasks)); + .tqarg(s.num_peers).tqarg(s.num_tasks)); } else m_statusDHT->setText(i18n("DHT: off")); @@ -835,25 +835,25 @@ void KTorrent::removePluginGui(Plugin* p) guiFactory()->removeClient(p); } -void KTorrent::addWidgetInView(QWidget* w,Position pos) +void KTorrent::addWidgetInView(TQWidget* w,Position pos) { } -void KTorrent::removeWidgetFromView(QWidget* w) +void KTorrent::removeWidgetFromView(TQWidget* w) { } -void KTorrent::addWidgetBelowView(QWidget* w,const QString & icon,const QString & caption) +void KTorrent::addWidgetBelowView(TQWidget* w,const TQString & icon,const TQString & caption) { addToolWidget(w,icon,caption,DOCK_BOTTOM); } -void KTorrent::removeWidgetBelowView(QWidget* w) +void KTorrent::removeWidgetBelowView(TQWidget* w) { removeToolWidget(w); } -void KTorrent::addToolWidget(QWidget* w,const QString & icon,const QString & caption,ToolDock dock) +void KTorrent::addToolWidget(TQWidget* w,const TQString & icon,const TQString & caption,ToolDock dock) { if (!w) return; @@ -878,12 +878,12 @@ void KTorrent::addToolWidget(QWidget* w,const QString & icon,const QString & cap } } -void KTorrent::removeToolWidget(QWidget* w) +void KTorrent::removeToolWidget(TQWidget* w) { if (!w) return; removeDockWidget(w); - w->reparent(0,QPoint()); + w->reparent(0,TQPoint()); } const TorrentInterface* KTorrent::getCurrentTorrent() const @@ -891,27 +891,27 @@ const TorrentInterface* KTorrent::getCurrentTorrent() const return m_view_man->getCurrentTC(); } -QString KTorrent::getStatusInfo() +TQString KTorrent::getStatusInfo() { return m_statusInfo->text(); } -QString KTorrent::getStatusTransfer() +TQString KTorrent::getStatusTransfer() { return m_statusTransfer->text(); } -QString KTorrent::getStatusSpeed() +TQString KTorrent::getStatusSpeed() { return m_statusSpeed->text(); } -QString KTorrent::getStatusDHT() +TQString KTorrent::getStatusDHT() { return m_statusDHT->text(); } -QString KTorrent::getStatusFirewall() +TQString KTorrent::getStatusFirewall() { return m_statusFirewall->text(); } @@ -930,7 +930,7 @@ void KTorrent::showIPFilter() void KTorrent::closeTab() { - QWidget* w = m_currentWidget; + TQWidget* w = m_currentWidget; if (!w) return; @@ -942,7 +942,7 @@ void KTorrent::closeTab() } } -void KTorrent::currentTabChanged(QWidget* w) +void KTorrent::currentTabChanged(TQWidget* w) { m_view_man->onCurrentTabChanged(w); currentTorrentChanged(m_view_man->getCurrentTC()); @@ -1006,7 +1006,7 @@ void KTorrent::statusBarMsgExpired() m_statusInfo->clear(); } -void KTorrent::find() +void KTorrent::tqfind() { KTorrentView* v = m_view_man->getCurrentView(); if (v) diff --git a/apps/ktorrent/ktorrent.h b/apps/ktorrent/ktorrent.h index 8821f50..1213452 100644 --- a/apps/ktorrent/ktorrent.h +++ b/apps/ktorrent/ktorrent.h @@ -28,10 +28,10 @@ #include #include -#include +#include #include -typedef QValueList QCStringList; +typedef TQValueList QCStringList; class KAction; class KToggleAction; @@ -41,8 +41,8 @@ class KTorrentView; class TrayIcon; class SetMaxRate; class KTorrentDCOP; -class QLabel; -class QListViewItem; +class TQLabel; +class TQListViewItem; class KTorrentPreferences; class ViewManager; @@ -66,6 +66,7 @@ namespace kt class KTorrent : public DMainWindow, public kt::GUIInterface { Q_OBJECT + TQ_OBJECT public: /** * Default Constructor @@ -78,7 +79,7 @@ public: virtual ~KTorrent(); /// Open a view with the given group - void openView(const QString & group_name); + void openView(const TQString & group_name); /// Get the core KTorrentCore & getCore() {return *m_core;} @@ -89,30 +90,30 @@ public: */ void applySettings(bool change_port = true); - virtual void addTabPage(QWidget* page,const QIconSet & icon, - const QString & caption,kt::CloseTabListener* ctl = 0); - virtual void addTabPage(QWidget* page,const QPixmap & icon, - const QString & caption,kt::CloseTabListener* ctl = 0); - virtual void removeTabPage(QWidget* page); + virtual void addTabPage(TQWidget* page,const TQIconSet & icon, + const TQString & caption,kt::CloseTabListener* ctl = 0); + virtual void addTabPage(TQWidget* page,const TQPixmap & icon, + const TQString & caption,kt::CloseTabListener* ctl = 0); + virtual void removeTabPage(TQWidget* page); virtual void addPrefPage(kt::PrefPageInterface* page); virtual void removePrefPage(kt::PrefPageInterface* page); virtual void mergePluginGui(kt::Plugin* p); virtual void removePluginGui(kt::Plugin* p); - virtual void addWidgetBelowView(QWidget* w,const QString & icon,const QString & caption); - virtual void removeWidgetBelowView(QWidget* w); - virtual void addToolWidget(QWidget* w,const QString & icon,const QString & caption,ToolDock dock); - virtual void removeToolWidget(QWidget* w); + virtual void addWidgetBelowView(TQWidget* w,const TQString & icon,const TQString & caption); + virtual void removeWidgetBelowView(TQWidget* w); + virtual void addToolWidget(TQWidget* w,const TQString & icon,const TQString & caption,ToolDock dock); + virtual void removeToolWidget(TQWidget* w); virtual const kt::TorrentInterface* getCurrentTorrent() const; virtual KToolBar* addToolBar(const char* name); virtual void removeToolBar(KToolBar* tb); virtual KProgress* addProgressBarToStatusBar(); virtual void removeProgressBarFromStatusBar(KProgress* p); - QString getStatusInfo(); - QString getStatusTransfer(); - QString getStatusSpeed(); - QString getStatusDHT(); - QString getStatusFirewall(); + TQString getStatusInfo(); + TQString getStatusTransfer(); + TQString getStatusSpeed(); + TQString getStatusDHT(); + TQString getStatusFirewall(); QCStringList getTorrentInfo(kt::TorrentInterface* tc); public slots: @@ -169,19 +170,19 @@ private slots: void optionsConfigureToolbars(); void optionsPreferences(); void newToolbarConfig(); - void changeStatusbar(const QString& text); - void changeCaption(const QString& text); + void changeStatusbar(const TQString& text); + void changeCaption(const TQString& text); void currentTorrentChanged(kt::TorrentInterface* tc); void updatedStats(); - void urlDropped(QDropEvent*,QListViewItem*); + void urlDropped(TQDropEvent*,TQListViewItem*); void onUpdateActions(int flags); void groupChanged(kt::Group* g); void groupRenamed(kt::Group* g); void groupRemoved(kt::Group* g); - void currentTabChanged(QWidget* w); + void currentTabChanged(TQWidget* w); void openDefaultView(); void statusBarMsgExpired(); - void find(); + void tqfind(); private: void setupAccel(); @@ -190,8 +191,8 @@ private: bool queryExit(); - virtual void addWidgetInView(QWidget* w,kt::Position pos); - virtual void removeWidgetFromView(QWidget* w); + virtual void addWidgetInView(TQWidget* w,kt::Position pos); + virtual void removeWidgetFromView(TQWidget* w); virtual void closeTab(); private: @@ -206,17 +207,17 @@ private: SetMaxRate* m_set_max_download_rate; KTorrentDCOP* m_dcop; - QTimer m_gui_update_timer; - QTimer m_status_msg_expire; + TQTimer m_gui_update_timer; + TQTimer m_status_msg_expire; KTorrentPreferences* m_pref; - QMap m_tab_map; + TQMap m_tab_map; - QLabel* m_statusInfo; - QLabel* m_statusTransfer; - QLabel* m_statusSpeed; - QLabel* m_statusDHT; - QLabel* m_statusFirewall; + TQLabel* m_statusInfo; + TQLabel* m_statusTransfer; + TQLabel* m_statusSpeed; + TQLabel* m_statusDHT; + TQLabel* m_statusFirewall; KAction* m_start; KAction* m_stop; @@ -230,7 +231,7 @@ private: KAction* m_queueaction; KAction* m_datacheck; KAction* m_ipfilter; - KAction* m_find; + KAction* m_tqfind; KProgress* m_status_prog; }; diff --git a/apps/ktorrent/ktorrentapp.cpp b/apps/ktorrent/ktorrentapp.cpp index 591848f..5353116 100644 --- a/apps/ktorrent/ktorrentapp.cpp +++ b/apps/ktorrent/ktorrentapp.cpp @@ -48,7 +48,7 @@ int KTorrentApp::newInstance() KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); bt::Globals::instance().setDebugMode(args->isSet("debug")); - QString data_dir = KGlobal::dirs()->saveLocation("data","ktorrent"); + TQString data_dir = KGlobal::dirs()->saveLocation("data","ktorrent"); if (!data_dir.endsWith(bt::DirSeparator())) data_dir += bt::DirSeparator(); bt::Globals::instance().initLog(data_dir + "log"); @@ -62,7 +62,7 @@ int KTorrentApp::newInstance() KStartupInfo::setNewStartupId( mainWidget(), kapp->startupId()); - KTorrent *widget = ::qt_cast( mainWidget() ); + KTorrent *widget = ::tqqt_cast( mainWidget() ); for (int i = 0; i < args->count(); i++) { diff --git a/apps/ktorrent/ktorrentapp.h b/apps/ktorrent/ktorrentapp.h index db6048d..1bbc525 100644 --- a/apps/ktorrent/ktorrentapp.h +++ b/apps/ktorrent/ktorrentapp.h @@ -27,6 +27,7 @@ class KTorrentApp : public KUniqueApplication { Q_OBJECT + TQ_OBJECT public: KTorrentApp(); virtual ~KTorrentApp(); diff --git a/apps/ktorrent/ktorrentcore.cpp b/apps/ktorrent/ktorrentcore.cpp index 1760fce..7839a5a 100644 --- a/apps/ktorrent/ktorrentcore.cpp +++ b/apps/ktorrent/ktorrentcore.cpp @@ -19,7 +19,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include -#include +#include #include #include #include @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -70,12 +70,12 @@ KTorrentCore::KTorrentCore(kt::GUIInterface* gui) : max_downloads(0),keep_seedin UpdateCurrentTime(); qman = new QueueManager(); - connect(qman, SIGNAL(lowDiskSpace(kt::TorrentInterface*,bool)), this, SLOT(onLowDiskSpace(kt::TorrentInterface*,bool))); + connect(qman, TQT_SIGNAL(lowDiskSpace(kt::TorrentInterface*,bool)), TQT_TQOBJECT(this), TQT_SLOT(onLowDiskSpace(kt::TorrentInterface*,bool))); data_dir = Settings::tempDir(); bool dd_not_exist = !bt::Exists(data_dir); - if (data_dir == QString::null || dd_not_exist) + if (data_dir == TQString() || dd_not_exist) { data_dir = KGlobal::dirs()->saveLocation("data","ktorrent"); if (dd_not_exist) @@ -91,7 +91,7 @@ KTorrentCore::KTorrentCore(kt::GUIInterface* gui) : max_downloads(0),keep_seedin data_dir += bt::DirSeparator(); // downloads.setAutoDelete(true); - connect(&update_timer,SIGNAL(timeout()),this,SLOT(update())); + connect(&update_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(update())); update_timer.start(CORE_UPDATE_INTERVAL); Uint16 port = Settings::port(); @@ -114,7 +114,7 @@ KTorrentCore::KTorrentCore(kt::GUIInterface* gui) : max_downloads(0),keep_seedin KMessageBox::information(0, i18n("Specified port (%1) is unavailable or in" " use by another application. KTorrent is now using port %2.") - .arg(port).arg(port + i - 1)); + .tqarg(port).tqarg(port + i - 1)); Out(SYS_GEN|LOG_NOTICE) << "Bound to port " << (port + i - 1) << endl; } @@ -122,7 +122,7 @@ KTorrentCore::KTorrentCore(kt::GUIInterface* gui) : max_downloads(0),keep_seedin { KMessageBox::error(0, i18n("KTorrent is unable to accept connections because the ports %1 to %2 are " - "already in use by another program.").arg(port).arg(port + i - 1)); + "already in use by another program.").tqarg(port).tqarg(port + i - 1)); Out(SYS_GEN|LOG_IMPORTANT) << "Cannot find free port" << endl; } @@ -155,7 +155,7 @@ bool KTorrentCore::init(TorrentControl* tc,bool silently) { FileSelectDlg dlg(gman, &user, &start_torrent); - if (dlg.execute(tc) != QDialog::Accepted) + if (dlg.execute(tc) != TQDialog::Accepted) { remove(tc,false); return false; @@ -196,14 +196,14 @@ bool KTorrentCore::init(TorrentControl* tc,bool silently) //now copy torrent file to user specified dir if needed if(Settings::useTorrentCopyDir()) { - QString torFile = tc->getTorDir(); + TQString torFile = tc->getTorDir(); if(!torFile.endsWith("/")) torFile += "/"; torFile += "torrent"; - QString destination = Settings::torrentCopyDir(); + TQString destination = Settings::torrentCopyDir(); if(!destination.endsWith("/")) destination += "/"; @@ -223,16 +223,16 @@ bool KTorrentCore::init(TorrentControl* tc,bool silently) return true; } -bool KTorrentCore::load(const QByteArray & data,const QString & dir,bool silently, const KURL& url) +bool KTorrentCore::load(const TQByteArray & data,const TQString & dir,bool silently, const KURL& url) { - QString tdir = findNewTorrentDir(); + TQString tdir = findNewTorrentDir(); TorrentControl* tc = 0; try { Out(SYS_GEN|LOG_NOTICE) << "Loading torrent from data " << endl; tc = new TorrentControl(); tc->init(qman, data, tdir, dir, - Settings::useSaveDir() ? Settings::saveDir() : QString()); + Settings::useSaveDir() ? Settings::saveDir() : TQString()); if(!init(tc,silently)) loadingFinished(url, false, true); @@ -256,16 +256,16 @@ bool KTorrentCore::load(const QByteArray & data,const QString & dir,bool silentl } } -bool KTorrentCore::load(const QString & target,const QString & dir,bool silently) +bool KTorrentCore::load(const TQString & target,const TQString & dir,bool silently) { - QString tdir = findNewTorrentDir(); + TQString tdir = findNewTorrentDir(); TorrentControl* tc = 0; try { Out(SYS_GEN|LOG_NOTICE) << "Loading file " << target << endl; tc = new TorrentControl(); tc->init(qman, target, tdir, dir, - Settings::useSaveDir() ? Settings::saveDir() : QString()); + Settings::useSaveDir() ? Settings::saveDir() : TQString()); init(tc,silently); return true; @@ -300,11 +300,11 @@ void KTorrentCore::downloadFinished(KIO::Job *job) else { // load in the file (target is always local) - QString dir = Settings::saveDir(); + TQString dir = Settings::saveDir(); if (!Settings::useSaveDir() || dir.isNull()) - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); - if (dir != QString::null && load(j->data(),dir,false, j->url())) + if (dir != TQString() && load(j->data(),dir,false, j->url())) loadingFinished(j->url(),true,false); else loadingFinished(j->url(),false,true); @@ -315,12 +315,12 @@ void KTorrentCore::load(const KURL& url) { if (url.isLocalFile()) { - QString path = url.path(); - QString dir = Settings::saveDir(); + TQString path = url.path(); + TQString dir = Settings::saveDir(); if (!Settings::useSaveDir() || dir.isNull()) - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); - if (dir != QString::null && load(path,dir,false)) + if (dir != TQString() && load(path,dir,false)) loadingFinished(url,true,false); else loadingFinished(url,false,true); @@ -328,7 +328,7 @@ void KTorrentCore::load(const KURL& url) else { KIO::Job* j = KIO::storedGet(url,false,true); - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(downloadFinished( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinished( KIO::Job* ))); } } @@ -346,8 +346,8 @@ void KTorrentCore::downloadFinishedSilently(KIO::Job *job) } else { - QString dir; - if (custom_save_locations.contains(j)) + TQString dir; + if (custom_save_locations.tqcontains(j)) { // we have a custom save location so save to that dir = custom_save_locations[j].path(); @@ -358,7 +358,7 @@ void KTorrentCore::downloadFinishedSilently(KIO::Job *job) // incase save dir is not set, use home director Out(SYS_GEN|LOG_NOTICE) << "Cannot load " << j->url() << " silently, default save location not set !" << endl; Out(SYS_GEN|LOG_NOTICE) << "Using home directory instead !" << endl; - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); } else { @@ -366,7 +366,7 @@ void KTorrentCore::downloadFinishedSilently(KIO::Job *job) } - if (dir != QString::null && load(j->data(),dir,true,j->url())) + if (dir != TQString() && load(j->data(),dir,true,j->url())) loadingFinished(j->url(),true,false); else loadingFinished(j->url(),false,false); @@ -377,16 +377,16 @@ void KTorrentCore::loadSilently(const KURL& url) { if (url.isLocalFile()) { - QString path = url.path(); - QString dir = Settings::saveDir(); + TQString path = url.path(); + TQString dir = Settings::saveDir(); if (!Settings::useSaveDir() || dir.isNull()) { Out(SYS_GEN|LOG_NOTICE) << "Cannot load " << path << " silently, default save location not set !" << endl; Out(SYS_GEN|LOG_NOTICE) << "Using home directory instead !" << endl; - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); } - if (dir != QString::null && load(path,dir,true)) + if (dir != TQString() && load(path,dir,true)) loadingFinished(url,true,false); else loadingFinished(url,false,true); @@ -395,7 +395,7 @@ void KTorrentCore::loadSilently(const KURL& url) { // download to a random file in tmp KIO::Job* j = KIO::storedGet(url,false,true); - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(downloadFinishedSilently( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( KIO::Job* ))); } } @@ -403,9 +403,9 @@ void KTorrentCore::loadSilentlyDir(const KURL& url, const KURL& savedir) { if (url.isLocalFile()) { - QString path = url.path(); - QString dir = savedir.path(); - QFileInfo fi(dir); + TQString path = url.path(); + TQString dir = savedir.path(); + TQFileInfo fi(dir); if (!fi.exists() || !fi.isWritable() || !fi.isDir()) { Out(SYS_GEN|LOG_NOTICE) << "Cannot load " << path << " silently, destination directory is not OK ! Using default save directory." << endl; @@ -413,11 +413,11 @@ void KTorrentCore::loadSilentlyDir(const KURL& url, const KURL& savedir) if (!Settings::useSaveDir()) { Out(SYS_GEN|LOG_NOTICE) << "Default save directory not set, using home directory !" << endl; - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); } } - if (dir != QString::null && load(path,dir,true)) + if (dir != TQString() && load(path,dir,true)) loadingFinished(url,true,false); else loadingFinished(url,false,true); @@ -427,7 +427,7 @@ void KTorrentCore::loadSilentlyDir(const KURL& url, const KURL& savedir) // download to a random file in tmp KIO::Job* j = KIO::storedGet(url,false,true); custom_save_locations.insert(j,savedir); // keep track of save location - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(downloadFinishedSilently( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(downloadFinishedSilently( KIO::Job* ))); } } @@ -443,7 +443,7 @@ void KTorrentCore::start(kt::TorrentInterface* tc) case USER_CANCELED: return; case NOT_ENOUGH_DISKSPACE: - case QM_LIMITS_REACHED: + case TQM_LIMITS_REACHED: canNotStart(tc,reason); break; } @@ -459,27 +459,27 @@ int KTorrentCore::getNumRunning(bool onlyDownloads, bool onlySeeds) const return qman->getNumRunning(onlyDownloads, onlySeeds); } -QString KTorrentCore::findNewTorrentDir() const +TQString KTorrentCore::findNewTorrentDir() const { int i = 0; while (true) { - QDir d; - QString dir = data_dir + QString("tor%1/").arg(i); + TQDir d; + TQString dir = data_dir + TQString("tor%1/").tqarg(i); if (!d.exists(dir)) { return dir; } i++; } - return QString::null; + return TQString(); } -void KTorrentCore::loadExistingTorrent(const QString & tor_dir) +void KTorrentCore::loadExistingTorrent(const TQString & tor_dir) { TorrentControl* tc = 0; - QString idir = tor_dir; + TQString idir = tor_dir; if (!idir.endsWith(bt::DirSeparator())) idir += bt::DirSeparator(); @@ -489,8 +489,8 @@ void KTorrentCore::loadExistingTorrent(const QString & tor_dir) try { tc = new TorrentControl(); - tc->init(qman,idir + "torrent",idir,QString::null, - Settings::useSaveDir() ? Settings::saveDir() : QString()); + tc->init(qman,idir + "torrent",idir,TQString(), + Settings::useSaveDir() ? Settings::saveDir() : TQString()); qman->append(tc); connectSignals(tc); @@ -507,12 +507,12 @@ void KTorrentCore::loadExistingTorrent(const QString & tor_dir) void KTorrentCore::loadTorrents() { - QDir dir(data_dir); - QStringList sl = dir.entryList("tor*",QDir::Dirs); + TQDir dir(data_dir); + TQStringList sl = dir.entryList("tor*",TQDir::Dirs); for (Uint32 i = 0;i < sl.count();i++) { - QString idir = data_dir + *sl.at(i); + TQString idir = data_dir + *sl.at(i); if (!idir.endsWith(DirSeparator())) idir.append(DirSeparator()); @@ -531,7 +531,7 @@ void KTorrentCore::remove(TorrentInterface* tc,bool data_to) removed_bytes_down += s.session_bytes_downloaded; stop(tc); - QString dir = tc->getTorDir(); + TQString dir = tc->getTorDir(); try { @@ -600,7 +600,7 @@ void KTorrentCore::onExit() qman->clear(); } -bool KTorrentCore::changeDataDir(const QString & new_dir) +bool KTorrentCore::changeDataDir(const TQString & new_dir) { try { @@ -618,7 +618,7 @@ bool KTorrentCore::changeDataDir(const QString & new_dir) // make sure new_dir ends with a / - QString nd = new_dir; + TQString nd = new_dir; if (!nd.endsWith(DirSeparator())) nd += DirSeparator(); @@ -626,9 +626,9 @@ bool KTorrentCore::changeDataDir(const QString & new_dir) qman->setPausedState(true); - QPtrList succes; + TQPtrList succes; - QPtrList::iterator i = qman->begin(); + TQPtrList::iterator i = qman->begin(); while (i != qman->end()) { kt::TorrentInterface* tc = *i; @@ -662,11 +662,11 @@ bool KTorrentCore::changeDataDir(const QString & new_dir) } } -void KTorrentCore::rollback(const QPtrList & succes) +void KTorrentCore::rollback(const TQPtrList & succes) { Out() << "Error, rolling back" << endl; update_timer.stop(); - QPtrList ::const_iterator i = succes.begin(); + TQPtrList ::const_iterator i = succes.begin(); while (i != succes.end()) { (*i)->rollback(); @@ -690,7 +690,7 @@ void KTorrentCore::update() bt::UpdateCurrentTime(); AuthenticationMonitor::instance().update(); - QPtrList::iterator i = qman->begin(); + TQPtrList::iterator i = qman->begin(); //Uint32 down_speed = 0; while (i != qman->end()) { @@ -722,12 +722,12 @@ void KTorrentCore::update() } } -void KTorrentCore::makeTorrent(const QString & file,const QStringList & trackers, - int chunk_size,const QString & name, - const QString & comments,bool seed, - const QString & output_file,bool priv_tor,KProgress* prog, bool decentralized) +void KTorrentCore::makeTorrent(const TQString & file,const TQStringList & trackers, + int chunk_size,const TQString & name, + const TQString & comments,bool seed, + const TQString & output_file,bool priv_tor,KProgress* prog, bool decentralized) { - QString tdir; + TQString tdir; try { if (chunk_size < 0) @@ -764,7 +764,7 @@ void KTorrentCore::makeTorrent(const QString & file,const QStringList & trackers // Show error message KMessageBox::error(0, - i18n("Cannot create torrent: %1").arg(e.toString()), + i18n("Cannot create torrent: %1").tqarg(e.toString()), i18n("Error")); } } @@ -776,7 +776,7 @@ CurrentStats KTorrentCore::getStats() Uint32 speed_dl = 0, speed_ul = 0; - for ( QPtrList::iterator i = qman->begin(); i != qman->end(); ++i ) + for ( TQPtrList::iterator i = qman->begin(); i != qman->end(); ++i ) { kt::TorrentInterface* tc = *i; const TorrentStats & s = tc->getStats(); @@ -806,7 +806,7 @@ bool KTorrentCore::changePort(Uint16 port) } } -void KTorrentCore::slotStoppedByError(kt::TorrentInterface* tc, QString msg) +void KTorrentCore::slotStoppedByError(kt::TorrentInterface* tc, TQString msg) { emit torrentStoppedByError(tc, msg); } @@ -831,13 +831,13 @@ int KTorrentCore::countDownloads() const return qman->countDownloads(); } -void KTorrentCore::addBlockedIP(QString& ip) +void KTorrentCore::addBlockedIP(TQString& ip) { IPBlocklist& filter = IPBlocklist::instance(); filter.addRange(ip); } -void KTorrentCore::removeBlockedIP(QString& ip) +void KTorrentCore::removeBlockedIP(TQString& ip) { IPBlocklist& filter = IPBlocklist::instance(); filter.removeRange(ip); @@ -889,13 +889,13 @@ void KTorrentCore::queue(kt::TorrentInterface* tc) TorrentInterface* KTorrentCore::getTorFromNumber(int tornumber) { - QString tordir = data_dir + "tor" + QString("%1").arg(tornumber) + "/"; + TQString tordir = data_dir + "tor" + TQString("%1").tqarg(tornumber) + "/"; Out() << "tordir " << tordir << endl; - QPtrList::iterator i = qman->begin(); + TQPtrList::iterator i = qman->begin(); while(i != qman->end()) { TorrentInterface* tc = *i; - QString td = tc->getTorDir(); + TQString td = tc->getTorDir(); if(td == tordir) return tc; i++; @@ -904,10 +904,10 @@ TorrentInterface* KTorrentCore::getTorFromNumber(int tornumber) return nullinterface; } -QValueList KTorrentCore::getTorrentNumbers(int type = 3) +TQValueList KTorrentCore::getTorrentNumbers(int type = 3) { - QValueList tornums; - QPtrList::iterator i = qman->begin(); + TQValueList tornums; + TQPtrList::iterator i = qman->begin(); while(i != qman->end()) { TorrentInterface* tc = *i; @@ -918,10 +918,10 @@ QValueList KTorrentCore::getTorrentNumbers(int type = 3) i++; continue; } - QString td = tc->getTorDir(); + TQString td = tc->getTorDir(); Out() << td << endl; td = td.remove(0, td.length() - 6); - td = td.remove(QRegExp("[^0-9]*")); + td = td.remove(TQRegExp("[^0-9]*")); Out() << td << endl; tornums.append(td.toInt()); i++; @@ -946,16 +946,16 @@ QCStringList KTorrentCore::getFileNames(int tornumber) return filenames; for(Uint32 i = 0; i < tc->getNumFiles(); i++) { - QCString filename = tc->getTorrentFile(i).getPath().ascii(); + TQCString filename = tc->getTorrentFile(i).getPath().ascii(); filenames.append(filename); } return filenames; } -QValueList KTorrentCore::getFilePriorities(int tornumber) +TQValueList KTorrentCore::getFilePriorities(int tornumber) { - QValueList priorities; + TQValueList priorities; kt::TorrentInterface* tc = getTorFromNumber(tornumber); if(!tc || tc->getNumFiles() == 0) return priorities; @@ -1018,16 +1018,16 @@ void KTorrentCore::aboutToBeStarted(kt::TorrentInterface* tc,bool & ret) { ret = true; - QStringList missing; + TQStringList missing; if (!tc->hasMissingFiles(missing)) return; if (tc->getStats().multi_file_torrent) { - QString msg = i18n("Several data files of the torrent \"%1\" are missing, do you want to recreate them, or do you want to not download them?").arg(tc->getStats().torrent_name); + TQString msg = i18n("Several data files of the torrent \"%1\" are missing, do you want to recreate them, or do you want to not download them?").tqarg(tc->getStats().torrent_name); - int ret = KMessageBox::warningYesNoCancelList(0,msg,missing,QString::null, + int ret = KMessageBox::warningYesNoCancelList(0,msg,missing,TQString(), KGuiItem(i18n("Recreate")),KGuiItem(i18n("Do Not Download"))); if (ret == KMessageBox::Yes) { @@ -1038,7 +1038,7 @@ void KTorrentCore::aboutToBeStarted(kt::TorrentInterface* tc,bool & ret) } catch (bt::Error & e) { - KMessageBox::error(0,i18n("Cannot recreate missing files: %1").arg(e.toString())); + KMessageBox::error(0,i18n("Cannot recreate missing files: %1").tqarg(e.toString())); tc->handleError(i18n("Data files are missing")); ret = false; } @@ -1052,7 +1052,7 @@ void KTorrentCore::aboutToBeStarted(kt::TorrentInterface* tc,bool & ret) } catch (bt::Error & e) { - KMessageBox::error(0,i18n("Cannot deselect missing files: %1").arg(e.toString())); + KMessageBox::error(0,i18n("Cannot deselect missing files: %1").tqarg(e.toString())); tc->handleError(i18n("Data files are missing")); ret = false; } @@ -1065,7 +1065,7 @@ void KTorrentCore::aboutToBeStarted(kt::TorrentInterface* tc,bool & ret) } else { - QString msg = i18n("The file where the data is saved of the torrent \"%1\" is missing, do you want to recreate it?").arg(tc->getStats().torrent_name); + TQString msg = i18n("The file where the data is saved of the torrent \"%1\" is missing, do you want to recreate it?").tqarg(tc->getStats().torrent_name); int ret = KMessageBox::warningYesNo(0,msg, i18n("Recreate"),KGuiItem(i18n("Recreate")),KGuiItem(i18n("Do Not Recreate"))); if (ret == KMessageBox::Yes) { @@ -1075,7 +1075,7 @@ void KTorrentCore::aboutToBeStarted(kt::TorrentInterface* tc,bool & ret) } catch (bt::Error & e) { - KMessageBox::error(0,i18n("Cannot recreate data file: %1").arg(e.toString())); + KMessageBox::error(0,i18n("Cannot recreate data file: %1").tqarg(e.toString())); tc->handleError(i18n("Data file is missing")); ret = false; } @@ -1097,20 +1097,20 @@ void KTorrentCore::emitCorruptedData(kt::TorrentInterface* tc) void KTorrentCore::connectSignals(kt::TorrentInterface* tc) { - connect(tc,SIGNAL(finished(kt::TorrentInterface*)), - this,SLOT(torrentFinished(kt::TorrentInterface* ))); - connect(tc, SIGNAL(stoppedByError(kt::TorrentInterface*, QString )), - this, SLOT(slotStoppedByError(kt::TorrentInterface*, QString ))); - connect(tc, SIGNAL(seedingAutoStopped(kt::TorrentInterface*, kt::AutoStopReason)), - this, SLOT(torrentSeedAutoStopped(kt::TorrentInterface*, kt::AutoStopReason))); - connect(tc,SIGNAL(aboutToBeStarted( kt::TorrentInterface*,bool & )), - this, SLOT(aboutToBeStarted( kt::TorrentInterface*,bool & ))); - connect(tc,SIGNAL(corruptedDataFound( kt::TorrentInterface* )), - this, SLOT(emitCorruptedData( kt::TorrentInterface* ))); - connect(qman, SIGNAL(queuingNotPossible(kt::TorrentInterface*)), - this, SLOT(enqueueTorrentOverMaxRatio( kt::TorrentInterface* ))); - connect(qman, SIGNAL(lowDiskSpace(kt::TorrentInterface*, bool)), - this, SLOT(onLowDiskSpace(kt::TorrentInterface*, bool))); + connect(tc,TQT_SIGNAL(finished(kt::TorrentInterface*)), + this,TQT_SLOT(torrentFinished(kt::TorrentInterface* ))); + connect(tc, TQT_SIGNAL(stoppedByError(kt::TorrentInterface*, TQString )), + TQT_TQOBJECT(this), TQT_SLOT(slotStoppedByError(kt::TorrentInterface*, TQString ))); + connect(tc, TQT_SIGNAL(seedingAutoStopped(kt::TorrentInterface*, kt::AutoStopReason)), + TQT_TQOBJECT(this), TQT_SLOT(torrentSeedAutoStopped(kt::TorrentInterface*, kt::AutoStopReason))); + connect(tc,TQT_SIGNAL(aboutToBeStarted( kt::TorrentInterface*,bool & )), + TQT_TQOBJECT(this), TQT_SLOT(aboutToBeStarted( kt::TorrentInterface*,bool & ))); + connect(tc,TQT_SIGNAL(corruptedDataFound( kt::TorrentInterface* )), + TQT_TQOBJECT(this), TQT_SLOT(emitCorruptedData( kt::TorrentInterface* ))); + connect(qman, TQT_SIGNAL(queuingNotPossible(kt::TorrentInterface*)), + TQT_TQOBJECT(this), TQT_SLOT(enqueueTorrentOverMaxRatio( kt::TorrentInterface* ))); + connect(qman, TQT_SIGNAL(lowDiskSpace(kt::TorrentInterface*, bool)), + TQT_TQOBJECT(this), TQT_SLOT(onLowDiskSpace(kt::TorrentInterface*, bool))); } diff --git a/apps/ktorrent/ktorrentcore.h b/apps/ktorrent/ktorrentcore.h index e0ed362..4cafb65 100644 --- a/apps/ktorrent/ktorrentcore.h +++ b/apps/ktorrent/ktorrentcore.h @@ -20,13 +20,13 @@ #ifndef KTORRENTCORE_H #define KTORRENTCORE_H -#include -#include -#include +#include +#include +#include #include #include -typedef QValueList QCStringList; +typedef TQValueList QCStringList; namespace bt { @@ -63,6 +63,7 @@ class KProgress; class KTorrentCore : public kt::CoreInterface { Q_OBJECT + TQ_OBJECT public: KTorrentCore(kt::GUIInterface* gui); virtual ~KTorrentCore(); @@ -80,7 +81,7 @@ public: * Load an existing torrent, which has already a properly set up torX dir. * @param tor_dir The torX dir */ - void loadExistingTorrent(const QString & tor_dir); + void loadExistingTorrent(const TQString & tor_dir); /** * Set the maximum number of simultanious downloads. @@ -109,7 +110,7 @@ public: * and leaves everything where it supposed to be. * @param new_dir The new directory */ - bool changeDataDir(const QString & new_dir); + bool changeDataDir(const TQString & new_dir); /** * Save active torrents on exit. @@ -140,9 +141,9 @@ public: * @param priv_tor Is this a private torrent * @param prog Progress bar to update */ - void makeTorrent(const QString & file,const QStringList & trackers, - int chunk_size,const QString & name,const QString & comments, - bool seed,const QString & output_file,bool priv_tor,KProgress* prog, bool decentralized); + void makeTorrent(const TQString & file,const TQStringList & trackers, + int chunk_size,const TQString & name,const TQString & comments, + bool seed,const TQString & output_file,bool priv_tor,KProgress* prog, bool decentralized); CurrentStats getStats(); @@ -160,16 +161,16 @@ public: bt::Uint32 getNumTorrentsNotRunning() const; ///Inserts blocked IP range into IPBlocklist - void addBlockedIP(QString& ip); + void addBlockedIP(TQString& ip); ///Removes blocked IP range from IPBlocklist - void removeBlockedIP(QString& ip); + void removeBlockedIP(TQString& ip); /** * Find the next free torX dir. * @return Path to the dir (including the torX part) */ - QString findNewTorrentDir() const; + TQString findNewTorrentDir() const; /** * Load plugins. @@ -202,10 +203,10 @@ public: void setPausedState(bool pause); kt::TorrentInterface* getTorFromNumber(int tornumber); - QValueList getTorrentNumbers(int type); + TQValueList getTorrentNumbers(int type); unsigned int getFileCount(int tornumber); QCStringList getFileNames(int tornumber); - QValueList getFilePriorities(int tornumber); + TQValueList getFilePriorities(int tornumber); void setFilePriority(kt::TorrentInterface* tc, bt::Uint32 index, int priority); void announceByTorNum(int tornumber); @@ -218,7 +219,7 @@ public slots: * @param dir Directory to save the data * @param silently Wether or not to do this silently */ - bool load(const QString & file,const QString & dir,bool silently); + bool load(const TQString & file,const TQString & dir,bool silently); /** * Load a torrent file. Pops up an error dialog @@ -227,7 +228,7 @@ public slots: * @param dir Directory to save the data * @param silently Wether or not to do this silently */ - bool load(const QByteArray & data,const QString & dir,bool silently, const KURL& url); + bool load(const TQByteArray & data,const TQString & dir,bool silently, const KURL& url); /** * Remove a download.This will delete all temp @@ -330,28 +331,28 @@ signals: void lowDiskSpace(kt::TorrentInterface* tc, bool stopped); private: - void rollback(const QPtrList & success); + void rollback(const TQPtrList & success); void connectSignals(kt::TorrentInterface* tc); bool init(bt::TorrentControl* tc,bool silently); private slots: void torrentFinished(kt::TorrentInterface* tc); - void slotStoppedByError(kt::TorrentInterface* tc, QString msg); + void slotStoppedByError(kt::TorrentInterface* tc, TQString msg); void torrentSeedAutoStopped(kt::TorrentInterface* tc,kt::AutoStopReason reason); void downloadFinished(KIO::Job *job); void downloadFinishedSilently(KIO::Job *job); void emitCorruptedData(kt::TorrentInterface* tc); private: - QString data_dir; + TQString data_dir; int max_downloads; bool keep_seeding; - QTimer update_timer; + TQTimer update_timer; bt::Uint64 removed_bytes_up,removed_bytes_down; kt::PluginManager* pman; bt::QueueManager* qman; kt::GroupManager* gman; - QMap custom_save_locations; // map to store save locations + TQMap custom_save_locations; // map to store save locations }; #endif diff --git a/apps/ktorrent/ktorrentdcop.cpp b/apps/ktorrent/ktorrentdcop.cpp index 592f74d..10e09cb 100644 --- a/apps/ktorrent/ktorrentdcop.cpp +++ b/apps/ktorrent/ktorrentdcop.cpp @@ -33,19 +33,19 @@ KTorrentDCOP::~KTorrentDCOP() {} -bool KTorrentDCOP::changeDataDir(const QString& new_dir) +bool KTorrentDCOP::changeDataDir(const TQString& new_dir) { Settings::setTempDir(new_dir); Settings::writeConfig(); return app->getCore().changeDataDir(new_dir); } -void KTorrentDCOP::openTorrent(const QString& file) +void KTorrentDCOP::openTorrent(const TQString& file) { app->load(KURL::fromPathOrURL(file)); } -void KTorrentDCOP::openTorrentSilently(const QString & file) +void KTorrentDCOP::openTorrentSilently(const TQString & file) { app->loadSilently(KURL::fromPathOrURL(file)); } @@ -123,7 +123,7 @@ void KTorrentDCOP::stop(int tornumber, bool user) app->getCore().stop(tc, user); } -QValueList KTorrentDCOP::getTorrentNumbers(int type) +TQValueList KTorrentDCOP::getTorrentNumbers(int type) { return app->getCore().getTorrentNumbers(type); } @@ -141,7 +141,7 @@ QCStringList KTorrentDCOP::getTorrentInfo(int tornumber) QCStringList KTorrentDCOP::getInfo() { QCStringList info; - QString thisinfo = app->getStatusInfo(); + TQString thisinfo = app->getStatusInfo(); info.append(thisinfo.ascii()); thisinfo = app->getStatusTransfer(); info.append(thisinfo.ascii()); @@ -162,7 +162,7 @@ QCStringList KTorrentDCOP::getFileNames(int tornumber) return app->getCore().getFileNames(tornumber); } -QValueList KTorrentDCOP::getFilePriorities(int tornumber) +TQValueList KTorrentDCOP::getFilePriorities(int tornumber) { return app->getCore().getFilePriorities(tornumber); } @@ -187,9 +187,9 @@ void KTorrentDCOP::announce(int tornumber) app->getCore().announceByTorNum(tornumber); } -QCString KTorrentDCOP::dataDir() +TQCString KTorrentDCOP::dataDir() { - QCString dir = Settings::tempDir().ascii(); + TQCString dir = Settings::tempDir().ascii(); return dir; } @@ -228,9 +228,9 @@ bool KTorrentDCOP::showSystemTrayIcon() return Settings::showSystemTrayIcon(); } -QValueList KTorrentDCOP::intSettings() +TQValueList KTorrentDCOP::intSettings() { - QValueList intsettings; + TQValueList intsettings; intsettings.append(Settings::maxDownloads()); intsettings.append(Settings::maxSeeds()); intsettings.append(Settings::maxConnections()); @@ -241,12 +241,12 @@ QValueList KTorrentDCOP::intSettings() return intsettings; } -bool KTorrentDCOP::isBlockedIP(QString ip) +bool KTorrentDCOP::isBlockedIP(TQString ip) { return bt::IPBlocklist::instance().isBlocked(ip); } -void KTorrentDCOP::openTorrentSilentlyDir(const QString & file, const QString & savedir) +void KTorrentDCOP::openTorrentSilentlyDir(const TQString & file, const TQString & savedir) { app->loadSilentlyDir(KURL::fromPathOrURL(file), KURL::fromPathOrURL(savedir)); } diff --git a/apps/ktorrent/ktorrentdcop.h b/apps/ktorrent/ktorrentdcop.h index 287e191..769cc60 100644 --- a/apps/ktorrent/ktorrentdcop.h +++ b/apps/ktorrent/ktorrentdcop.h @@ -27,17 +27,18 @@ class KTorrent; /** @author Joris Guisson */ -class KTorrentDCOP : public QObject,virtual public DCOPInterface +class KTorrentDCOP : public TQObject,virtual public DCOPInterface { Q_OBJECT + TQ_OBJECT KTorrent* app; public: KTorrentDCOP(KTorrent* app); ~KTorrentDCOP(); - virtual bool changeDataDir(const QString& new_dir); - virtual void openTorrent(const QString& file); - virtual void openTorrentSilently(const QString & file); + virtual bool changeDataDir(const TQString& new_dir); + virtual void openTorrent(const TQString& file); + virtual void openTorrentSilently(const TQString & file); virtual void setKeepSeeding(bool ks); virtual void setMaxConnectionsPerDownload(int max); virtual void setMaxDownloads(int max); @@ -47,18 +48,18 @@ public: virtual void setShowSysTrayIcon(bool yes); virtual void startAll(int type = 3); virtual void stopAll(int type = 3); - virtual QValueList getTorrentNumbers(int type = 3); + virtual TQValueList getTorrentNumbers(int type = 3); virtual QCStringList getTorrentInfo(int tornumber); virtual int getFileCount(int tornumber); virtual QCStringList getInfo(); virtual QCStringList getFileNames(int tornumber); - virtual QValueList getFilePriorities(int tornumber); + virtual TQValueList getFilePriorities(int tornumber); virtual void setFilePriority(int tornumber, int index, int priority); virtual void start(int tornumber); virtual void stop(int tornumber, bool user); virtual void remove(int tornumber, bool del_data); virtual void announce(int tornumber); - virtual QCString dataDir(); + virtual TQCString dataDir(); virtual int maxDownloads(); virtual int maxSeeds(); virtual int maxConnections(); @@ -66,9 +67,9 @@ public: virtual int maxDownloadRate(); virtual bool keepSeeding(); virtual bool showSystemTrayIcon(); - virtual QValueList intSettings(); - virtual bool isBlockedIP(QString ip); - virtual void openTorrentSilentlyDir(const QString & file, const QString & savedir); + virtual TQValueList intSettings(); + virtual bool isBlockedIP(TQString ip); + virtual void openTorrentSilentlyDir(const TQString & file, const TQString & savedir); }; diff --git a/apps/ktorrent/ktorrentview.cpp b/apps/ktorrent/ktorrentview.cpp index d1b41c5..9cc96a4 100644 --- a/apps/ktorrent/ktorrentview.cpp +++ b/apps/ktorrent/ktorrentview.cpp @@ -37,10 +37,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "ktorrentview.h" #include "ktorrentviewitem.h" @@ -55,22 +55,22 @@ using namespace bt; using namespace kt; -TorrentView::TorrentView(KTorrentView* parent) : KListView(parent),ktview(parent) +TorrentView::TorrentView(KTorrentView* tqparent) : KListView(tqparent),ktview(tqparent) {} TorrentView::~TorrentView() {} -bool TorrentView::eventFilter(QObject* watched, QEvent* e) +bool TorrentView::eventFilter(TQObject* watched, TQEvent* e) { - if((QHeader*)watched == header()) + if((TQHeader*)watched == header()) { switch(e->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - if(static_cast(e)->button() == RightButton) - ktview->m_headerMenu->popup(QCursor::pos()); + if(TQT_TQMOUSEEVENT(e)->button() == Qt::RightButton) + ktview->m_headerMenu->popup(TQCursor::pos()); break; } @@ -82,41 +82,41 @@ bool TorrentView::eventFilter(QObject* watched, QEvent* e) return KListView::eventFilter(watched, e); } -KTorrentView::KTorrentView(QWidget *parent) - : QWidget(parent),menu(0),current_group(0),running(0),total(0),view(0),filter_bar(0) +KTorrentView::KTorrentView(TQWidget *tqparent) + : TQWidget(tqparent),menu(0),current_group(0),running(0),total(0),view(0),filter_bar(0) { - QVBoxLayout* layout = new QVBoxLayout(this); - layout->setAutoAdd(true); + TQVBoxLayout* tqlayout = new TQVBoxLayout(this); + tqlayout->setAutoAdd(true); view = new TorrentView(this); filter_bar = new FilterBar(this); filter_bar->setHidden(true); setupColumns(); - connect(view,SIGNAL(executed(QListViewItem* )), - this,SLOT(onExecuted(QListViewItem* ))); + connect(view,TQT_SIGNAL(executed(TQListViewItem* )), + this,TQT_SLOT(onExecuted(TQListViewItem* ))); - connect(view,SIGNAL(currentChanged(QListViewItem* )), - this,SLOT(onExecuted(QListViewItem* ))); + connect(view,TQT_SIGNAL(currentChanged(TQListViewItem* )), + this,TQT_SLOT(onExecuted(TQListViewItem* ))); - connect(view,SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint& )), - this,SLOT(showContextMenu(KListView*, QListViewItem*, const QPoint& ))); + connect(view,TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint& )), + this,TQT_SLOT(showContextMenu(KListView*, TQListViewItem*, const TQPoint& ))); - connect(view,SIGNAL(selectionChanged()),this,SLOT(onSelectionChanged())); + connect(view,TQT_SIGNAL(selectionChanged()),this,TQT_SLOT(onSelectionChanged())); menu = new KTorrentViewMenu(this); - connect(menu,SIGNAL(groupItemActivated(const QString&)),this,SLOT(gsmItemActived(const QString&))); + connect(menu,TQT_SIGNAL(groupItemActivated(const TQString&)),this,TQT_SLOT(gsmItemActived(const TQString&))); - connect(m_headerMenu, SIGNAL(activated(int)), this, SLOT(onColumnVisibilityChange( int ))); + connect(m_headerMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(onColumnVisibilityChange( int ))); - view->setFrameShape(QFrame::NoFrame); + view->setFrameShape(TQFrame::NoFrame); } KTorrentView::~KTorrentView() { } -void KTorrentView::insertColumn(QString label, Qt::AlignmentFlags align) +void KTorrentView::insertColumn(TQString label, TQt::AlignmentFlags align) { m_headerMenu->insertItem(label); @@ -131,29 +131,29 @@ void KTorrentView::setupColumns() m_headerMenu->setCheckable(true); m_headerMenu->insertTitle(i18n("Visible columns")); - insertColumn(i18n("File"), Qt::AlignLeft); - insertColumn(i18n("Status"), Qt::AlignLeft); - insertColumn(i18n("Downloaded"), Qt::AlignRight); - insertColumn(i18n("Size"), Qt::AlignRight); - insertColumn(i18n("Uploaded"), Qt::AlignRight); - insertColumn(i18n("Down Speed"), Qt::AlignRight); - insertColumn(i18n("Up Speed"), Qt::AlignRight); - insertColumn(i18n("Time Left"), Qt::AlignCenter); - insertColumn(i18n("Seeders"), Qt::AlignRight); - insertColumn(i18n("Leechers"), Qt::AlignRight); - insertColumn(i18n("% Complete"), Qt::AlignRight); - insertColumn(i18n("Share Ratio"), Qt::AlignRight); - insertColumn(i18n("Time Downloaded"), Qt::AlignRight); - insertColumn(i18n("Time Seeded"), Qt::AlignRight); + insertColumn(i18n("File"), TQt::AlignLeft); + insertColumn(i18n("tqStatus"), TQt::AlignLeft); + insertColumn(i18n("Downloaded"), TQt::AlignRight); + insertColumn(i18n("Size"), TQt::AlignRight); + insertColumn(i18n("Uploaded"), TQt::AlignRight); + insertColumn(i18n("Down Speed"), TQt::AlignRight); + insertColumn(i18n("Up Speed"), TQt::AlignRight); + insertColumn(i18n("Time Left"), TQt::AlignCenter); + insertColumn(i18n("Seeders"), TQt::AlignRight); + insertColumn(i18n("Leechers"), TQt::AlignRight); + insertColumn(i18n("% Complete"), TQt::AlignRight); + insertColumn(i18n("Share Ratio"), TQt::AlignRight); + insertColumn(i18n("Time Downloaded"), TQt::AlignRight); + insertColumn(i18n("Time Seeded"), TQt::AlignRight); view->setAllColumnsShowFocus(true); view->setShowSortIndicator(true); view->setAcceptDrops(true); - view->setSelectionMode(QListView::Extended); + view->setSelectionMode(TQListView::Extended); for (Uint32 i = 0;i < (Uint32)view->columns();i++) { view->setColumnWidth(i, 100); - view->setColumnWidthMode(i,QListView::Manual); + view->setColumnWidthMode(i,TQListView::Manual); } } @@ -168,7 +168,7 @@ void KTorrentView::setCurrentGroup(Group* group) total = 0; // go over the current items, if they still match keep them, else remove them // add new itesm if necessary - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -198,9 +198,9 @@ void KTorrentView::setCurrentGroup(Group* group) } if (current_group) - setCaption(QString("%1 %2/%3").arg(current_group->groupName()).arg(running).arg(total)); + setCaption(TQString("%1 %2/%3").tqarg(current_group->groupName()).tqarg(running).tqarg(total)); else - setCaption(i18n("All Torrents %1/%2").arg(running).arg(total)); + setCaption(i18n("All Torrents %1/%2").tqarg(running).tqarg(total)); onSelectionChanged(); onExecuted(view->currentItem()); @@ -208,7 +208,7 @@ void KTorrentView::setCurrentGroup(Group* group) void KTorrentView::saveSettings(KConfig* cfg,int idx) { - QString group = QString("KTorrentView-%1").arg(idx); + TQString group = TQString("KTorrentView-%1").tqarg(idx); view->saveLayout(cfg,group); cfg->setGroup(group); filter_bar->saveSettings(cfg); @@ -217,7 +217,7 @@ void KTorrentView::saveSettings(KConfig* cfg,int idx) void KTorrentView::loadSettings(KConfig* cfg,int idx) { - QString group = QString("KTorrentView-%1").arg(idx); + TQString group = TQString("KTorrentView-%1").tqarg(idx); view->restoreLayout(cfg,group); view->setDragEnabled(true); @@ -236,7 +236,7 @@ void KTorrentView::loadSettings(KConfig* cfg,int idx) int KTorrentView::getNumRunning() { int num = 0; - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -279,7 +279,7 @@ void KTorrentView::stopDownload(kt::TorrentInterface* tc) void KTorrentView::showStartError() { - QString err = i18n("Cannot start more than 1 download, ", + TQString err = i18n("Cannot start more than 1 download, ", "Cannot start more than %n downloads, ",Settings::maxDownloads()); err += i18n("and 1 seed. ","and %n seeds. ",Settings::maxSeeds()); @@ -291,8 +291,8 @@ void KTorrentView::startDownloads() { bool err = false; - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -312,8 +312,8 @@ void KTorrentView::startDownloads() void KTorrentView::stopDownloads() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; stopDownload(kvi->getTC()); @@ -326,7 +326,7 @@ void KTorrentView::stopDownloads() void KTorrentView::startAllDownloads() { bool err = false; - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -346,7 +346,7 @@ void KTorrentView::startAllDownloads() void KTorrentView::stopAllDownloads() { - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -360,8 +360,8 @@ void KTorrentView::stopAllDownloads() void KTorrentView::removeDownloads() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -372,8 +372,8 @@ void KTorrentView::removeDownloads() bool data_to = false; if (!s.completed) { - QString msg = i18n("The torrent %1 has not finished downloading, " - "do you want to delete the incomplete data, too?").arg(s.torrent_name); + TQString msg = i18n("The torrent %1 has not finished downloading, " + "do you want to delete the incomplete data, too?").tqarg(s.torrent_name); int ret = KMessageBox::questionYesNoCancel( this,msg,i18n("Remove Download"), i18n("Delete Data"),i18n("Keep Data")); @@ -392,14 +392,14 @@ void KTorrentView::removeDownloads() void KTorrentView::removeDownloadsAndData() { - QString msg = i18n("You will lose all the downloaded data. Are you sure you want to do this?"); + TQString msg = i18n("You will lose all the downloaded data. Are you sure you want to do this?"); // TODO: replace i18n("Remove") by KStdGuiItem::remove() in KDE4 if (KMessageBox::warningYesNo(this,msg, i18n("Remove Torrent"), i18n("&Remove"), KStdGuiItem::cancel()) == KMessageBox::No) return; - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -413,8 +413,8 @@ void KTorrentView::removeDownloadsAndData() void KTorrentView::manualAnnounce() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -425,14 +425,14 @@ void KTorrentView::manualAnnounce() void KTorrentView::previewFiles() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); if (tc && tc->readyForPreview() && !tc->getStats().multi_file_torrent) { - QFileInfo fi(tc->getTorDir()+"cache"); + TQFileInfo fi(tc->getTorDir()+"cache"); new KRun(KURL::fromPathOrURL(fi.readLink()), 0, true, true); } } @@ -447,7 +447,7 @@ TorrentInterface* KTorrentView::getCurrentTC() return 0; } -void KTorrentView::onExecuted(QListViewItem* item) +void KTorrentView::onExecuted(TQListViewItem* item) { KTorrentViewItem* tvi = dynamic_cast(item); if (tvi) @@ -461,7 +461,7 @@ void KTorrentView::onExecuted(QListViewItem* item) } } -void KTorrentView::showContextMenu(KListView* ,QListViewItem*,const QPoint & p) +void KTorrentView::showContextMenu(KListView* ,TQListViewItem*,const TQPoint & p) { updateGroupsSubMenu(menu->getGroupsSubMenu()); menu->show(p); @@ -485,7 +485,7 @@ void KTorrentView::addTorrent(TorrentInterface* tc) void KTorrentView::removeTorrent(TorrentInterface* tc) { - QMap::iterator i = items.find(tc); + TQMap::iterator i = items.tqfind(tc); if (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -505,7 +505,7 @@ void KTorrentView::update() Uint32 r = 0; Uint32 t = 0; - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { bool count = true; @@ -546,16 +546,16 @@ void KTorrentView::update() total = t; if (current_group) - setCaption(QString("%1 %2/%3").arg(current_group->groupName()).arg(running).arg(total)); + setCaption(TQString("%1 %2/%3").tqarg(current_group->groupName()).tqarg(running).tqarg(total)); else - setCaption(i18n("All Torrents %1/%2").arg(running).arg(total)); + setCaption(i18n("All Torrents %1/%2").tqarg(running).tqarg(total)); onSelectionChanged(); } view->sort(); } -bool KTorrentView::acceptDrag(QDropEvent* event) const +bool KTorrentView::acceptDrag(TQDropEvent* event) const { // accept uri drops only return KURLDrag::canDecode(event); @@ -565,8 +565,8 @@ void KTorrentView::onSelectionChanged() { int flags = 0; - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -601,8 +601,8 @@ void KTorrentView::onSelectionChanged() void KTorrentView::queueSlot() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -615,7 +615,7 @@ void KTorrentView::queueSlot() void KTorrentView::checkDataIntegrity() { - QPtrList sel = view->selectedItems(); + TQPtrList sel = view->selectedItems(); if (sel.count() == 0) return; @@ -628,26 +628,26 @@ void KTorrentView::checkDataIntegrity() } else { - KMessageBox::error(0,i18n("You are already checking the data of the torrent %1 !").arg(tc->getStats().torrent_name)); + KMessageBox::error(0,i18n("You are already checking the data of the torrent %1 !").tqarg(tc->getStats().torrent_name)); } } -QDragObject* KTorrentView::dragObject() +TQDragObject* KTorrentView::dragObject() { - QPtrList sel = view->selectedItems(); + TQPtrList sel = view->selectedItems(); if (sel.count() == 0) return 0; return new TorrentDrag(this); } -void KTorrentView::getSelection(QValueList & sel) +void KTorrentView::getSelection(TQValueList & sel) { - QPtrList s = view->selectedItems(); + TQPtrList s = view->selectedItems(); if (s.count() == 0) return; - QPtrList::iterator i = s.begin(); + TQPtrList::iterator i = s.begin(); while (i != s.end()) { KTorrentViewItem* kvi = (KTorrentViewItem*)*i; @@ -659,11 +659,11 @@ void KTorrentView::getSelection(QValueList & sel) void KTorrentView::removeFromGroup() { - QPtrList s = view->selectedItems(); + TQPtrList s = view->selectedItems(); if (s.count() == 0 || !current_group || current_group->isStandardGroup()) return; - QPtrList::iterator i = s.begin(); + TQPtrList::iterator i = s.begin(); while (i != s.end()) { KTorrentViewItem* kvi = (KTorrentViewItem*)*i; @@ -677,11 +677,11 @@ void KTorrentView::removeFromGroup() void KTorrentView::addSelectionToGroup(kt::Group* g) { - QPtrList s = view->selectedItems(); + TQPtrList s = view->selectedItems(); if (s.count() == 0 || !g) return; - QPtrList::iterator i = s.begin(); + TQPtrList::iterator i = s.begin(); while (i != s.end()) { KTorrentViewItem* kvi = (KTorrentViewItem*)*i; @@ -693,8 +693,8 @@ void KTorrentView::addSelectionToGroup(kt::Group* g) void KTorrentView::showAddPeersWidget() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -709,8 +709,8 @@ void KTorrentView::showAddPeersWidget() void KTorrentView::openOutputDirectory() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -726,8 +726,8 @@ void KTorrentView::openOutputDirectory() void KTorrentView::openTorXDirectory() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -740,15 +740,15 @@ void KTorrentView::openTorXDirectory() void KTorrentView::setDownloadLocationSlot() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); if (tc) { - QString dn; - dn = KFileDialog::getExistingDirectory(tc->getStats().output_path, this, i18n("Choose download location for %1").arg(tc->getStats().torrent_name)); + TQString dn; + dn = KFileDialog::getExistingDirectory(tc->getStats().output_path, this, i18n("Choose download location for %1").tqarg(tc->getStats().torrent_name)); if(dn.isNull() || dn.isEmpty()) continue; @@ -764,8 +764,8 @@ void KTorrentView::setDownloadLocationSlot() void KTorrentView::dhtSlot() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -780,8 +780,8 @@ void KTorrentView::dhtSlot() void KTorrentView::utPexSlot() { - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); @@ -796,7 +796,7 @@ void KTorrentView::utPexSlot() void KTorrentView::speedLimits() { - QPtrList sel = view->selectedItems(); + TQPtrList sel = view->selectedItems(); if (sel.count() != 1) return; @@ -844,7 +844,7 @@ void KTorrentView::onColumnVisibilityChange(int id) columnHide(mid); } -void KTorrentView::gsmItemActived(const QString & group) +void KTorrentView::gsmItemActived(const TQString & group) { groupsSubMenuItemActivated(this,group); } @@ -853,7 +853,7 @@ void KTorrentView::updateCaption() { Uint32 r = 0; Uint32 t = 0; - QMap::iterator i = items.begin(); + TQMap::iterator i = items.begin(); while (i != items.end()) { if (!current_group || current_group->isMember(i.key())) @@ -872,9 +872,9 @@ void KTorrentView::updateCaption() total = t; if (current_group) - setCaption(QString("%1 %2/%3").arg(current_group->groupName()).arg(running).arg(total)); + setCaption(TQString("%1 %2/%3").tqarg(current_group->groupName()).tqarg(running).tqarg(total)); else - setCaption(i18n("All Torrents %1/%2").arg(running).arg(total)); + setCaption(i18n("All Torrents %1/%2").tqarg(running).tqarg(total)); } } diff --git a/apps/ktorrent/ktorrentview.h b/apps/ktorrent/ktorrentview.h index 218b0b0..fea5b4f 100644 --- a/apps/ktorrent/ktorrentview.h +++ b/apps/ktorrent/ktorrentview.h @@ -25,7 +25,7 @@ #include -typedef QValueList QCStringList; +typedef TQValueList QCStringList; class KURL; class KTorrentViewItem; @@ -34,7 +34,7 @@ class KTorrentCore; class KTorrentViewMenu; class KTorrentView; class ScanDialog; -class QString; +class TQString; class FilterBar; namespace kt @@ -48,10 +48,10 @@ using namespace bt; class TorrentView : public KListView { public: - TorrentView(KTorrentView* parent); + TorrentView(KTorrentView* tqparent); virtual ~TorrentView(); - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); private: KTorrentView* ktview; @@ -63,9 +63,10 @@ private: /** * List view which shows information about torrents. */ -class KTorrentView : public QWidget +class KTorrentView : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum ActionEnableFlags { @@ -80,7 +81,7 @@ public: /** * Default constructor */ - KTorrentView(QWidget *parent); + KTorrentView(TQWidget *tqparent); /** * Destructor @@ -109,7 +110,7 @@ public: * Put the current selection in a list. * @param sel The list to put it in */ - void getSelection(QValueList & sel); + void getSelection(TQValueList & sel); /** * Add the current selection to a group. @@ -128,7 +129,7 @@ public: */ void setupViewColumns(); - QPtrList selectedItems() {return view->selectedItems();} + TQPtrList selectedItems() {return view->selectedItems();} KListView* listView() {return view;} @@ -163,10 +164,10 @@ public slots: void speedLimits(); private slots: - void onExecuted(QListViewItem* item); - void showContextMenu(KListView* ,QListViewItem* item,const QPoint & p); + void onExecuted(TQListViewItem* item); + void showContextMenu(KListView* ,TQListViewItem* item,const TQPoint & p); void onColumnVisibilityChange(int); - void gsmItemActived(const QString & group); + void gsmItemActived(const TQString & group); signals: @@ -185,23 +186,23 @@ signals: void queue(kt::TorrentInterface* tc); void needsDataCheck(kt::TorrentInterface* tc); void updateGroupsSubMenu(KPopupMenu* gsm); - void groupsSubMenuItemActivated(KTorrentView* v,const QString & group); + void groupsSubMenuItemActivated(KTorrentView* v,const TQString & group); private: - bool acceptDrag(QDropEvent* event) const; + bool acceptDrag(TQDropEvent* event) const; int getNumRunning(); bool startDownload(kt::TorrentInterface* tc); void stopDownload(kt::TorrentInterface* tc); void showStartError(); - virtual QDragObject* dragObject(); + virtual TQDragObject* dragObject(); void setupColumns(); - void insertColumn(QString label, Qt::AlignmentFlags); + void insertColumn(TQString label, TQt::AlignmentFlags); void columnHide(int index); void columnShow(int index); private: - QMap items; + TQMap items; KTorrentViewMenu* menu; KPopupMenu* m_headerMenu; kt::Group* current_group; diff --git a/apps/ktorrent/ktorrentviewitem.cpp b/apps/ktorrent/ktorrentviewitem.cpp index d00e2f7..6709088 100644 --- a/apps/ktorrent/ktorrentviewitem.cpp +++ b/apps/ktorrent/ktorrentviewitem.cpp @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "ktorrentview.h" @@ -30,7 +30,7 @@ using namespace bt; using namespace kt; /* -static QString StatusToString(TorrentInterface* tc,TorrentStatus s) +static TQString StatusToString(TorrentInterface* tc,TorrenttqStatus s) { switch (s) { @@ -51,14 +51,14 @@ static QString StatusToString(TorrentInterface* tc,TorrentStatus s) case kt::ALLOCATING_DISKSPACE: return i18n("Allocating diskspace"); } - return QString::null; + return TQString(); } */ -static QColor StatusToColor(TorrentStatus s,const QColorGroup & cg) +static TQColor StatusToColor(TorrenttqStatus s,const TQColorGroup & cg) { - QColor green(40,205,40); - QColor yellow(255,174,0); + TQColor green(40,205,40); + TQColor yellow(255,174,0); switch (s) { case kt::SEEDING : @@ -69,10 +69,10 @@ static QColor StatusToColor(TorrentStatus s,const QColorGroup & cg) case kt::CHECKING_DATA: return yellow; case kt::ERROR : - return Qt::red; + return TQt::red; case kt::NOT_STARTED : case kt::STOPPED: - case kt::QUEUED: + case kt::TQUEUED: case kt::DOWNLOAD_COMPLETE : case kt::SEEDING_COMPLETE : default: @@ -81,10 +81,10 @@ static QColor StatusToColor(TorrentStatus s,const QColorGroup & cg) return cg.text(); } -static QColor ratioToColor(float ratio) +static TQColor ratioToColor(float ratio) { - QColor green(40,205,40); - return ratio > 0.8 ? green : Qt::red; + TQColor green(40,205,40); + return ratio > 0.8 ? green : TQt::red; } static double Percentage(const TorrentStats & s) @@ -116,10 +116,10 @@ static double Percentage(const TorrentStats & s) -KTorrentViewItem::KTorrentViewItem(KTorrentView* parent,TorrentInterface* tc) - : KListViewItem(parent->listView()),tc(tc) +KTorrentViewItem::KTorrentViewItem(KTorrentView* tqparent,TorrentInterface* tc) + : KListViewItem(tqparent->listView()),tc(tc) { - m_parent = parent; + m_parent = tqparent; update(); } @@ -144,7 +144,7 @@ QCStringList KTorrentViewItem::getTorrentInfo(kt::TorrentInterface* tc) info.append(KBytesPerSecToString(s.upload_rate / 1024.0).local8Bit()); if (s.bytes_left_to_download == 0) { - info.append(QCString("")); + info.append(TQCString("")); } else if (s.running) { @@ -159,11 +159,11 @@ QCStringList KTorrentViewItem::getTorrentInfo(kt::TorrentInterface* tc) info.append(i18n("infinity").local8Bit()); } - info.append(QString::number(s.num_peers).local8Bit()); - info.append(QString(KGlobal::locale()->formatNumber(Percentage(s),2) + " %").local8Bit()); + info.append(TQString::number(s.num_peers).local8Bit()); + info.append(TQString(KGlobal::locale()->formatNumber(Percentage(s),2) + " %").local8Bit()); info.append(KGlobal::locale()->formatNumber(kt::ShareRatio(s),2).local8Bit()); - info.append(QString::number(s.seeders_connected_to).local8Bit()); - info.append(QString::number(s.leechers_connected_to).local8Bit()); + info.append(TQString::number(s.seeders_connected_to).local8Bit()); + info.append(TQString::number(s.leechers_connected_to).local8Bit()); return info; } @@ -214,7 +214,7 @@ void KTorrentViewItem::update() { if (s.bytes_left_to_download == 0) { - setText(7,QString::null); + setText(7,TQString()); eta = -1; } else if (s.running) @@ -222,7 +222,7 @@ void KTorrentViewItem::update() Uint32 secs = tc->getETA(); if(secs == -1) { - setText(7,QString("%1").arg(QChar(0x221E))); + setText(7,TQString("%1").tqarg(TQChar(0x221E))); eta = -2; } else @@ -233,32 +233,32 @@ void KTorrentViewItem::update() } else { - setText(7,QString("%1").arg(QChar(0x221E))); + setText(7,TQString("%1").tqarg(TQChar(0x221E))); eta = -2; } } if(m_parent->columnVisible(8)) - setText(8,QString::number(s.num_peers)); + setText(8,TQString::number(s.num_peers)); if(m_parent->columnVisible(8)) { - setText(8,QString("%1 (%2)").arg(QString::number(s.seeders_connected_to)).arg(QString::number(s.seeders_total))); + setText(8,TQString("%1 (%2)").tqarg(TQString::number(s.seeders_connected_to)).tqarg(TQString::number(s.seeders_total))); } if(m_parent->columnVisible(9)) { - setText(9,QString("%1 (%2)").arg(QString::number(s.leechers_connected_to)).arg(QString::number(s.leechers_total))); + setText(9,TQString("%1 (%2)").tqarg(TQString::number(s.leechers_connected_to)).tqarg(TQString::number(s.leechers_total))); } if(m_parent->columnVisible(10)) { - setText(10,i18n("%1 %").arg(KGlobal::locale()->formatNumber(Percentage(s),2))); + setText(10,i18n("%1 %").tqarg(KGlobal::locale()->formatNumber(Percentage(s),2))); } if(m_parent->columnVisible(11)) { float ratio = kt::ShareRatio(s); - setText(11,QString("%1").arg(KGlobal::locale()->formatNumber(ratio,2))); + setText(11,TQString("%1").tqarg(KGlobal::locale()->formatNumber(ratio,2))); } if (m_parent->columnVisible(12)) @@ -276,7 +276,7 @@ void KTorrentViewItem::update() -int KTorrentViewItem::compare(QListViewItem * i,int col,bool) const +int KTorrentViewItem::compare(TQListViewItem * i,int col,bool) const { KTorrentViewItem* other = (KTorrentViewItem*)i; TorrentInterface* otc = other->tc; @@ -284,8 +284,8 @@ int KTorrentViewItem::compare(QListViewItem * i,int col,bool) const const TorrentStats & os = otc->getStats(); switch (col) { - case 0: return QString::compare(s.torrent_name,os.torrent_name); - case 1: return QString::compare(tc->statusToString(),otc->statusToString()); + case 0: return TQString::compare(s.torrent_name,os.torrent_name); + case 1: return TQString::compare(tc->statusToString(),otc->statusToString()); case 2: return CompareVal(s.bytes_downloaded,os.bytes_downloaded); case 3: return CompareVal(s.total_bytes_to_download,os.total_bytes_to_download); case 4: return CompareVal(s.bytes_uploaded,os.bytes_uploaded); @@ -337,17 +337,17 @@ int KTorrentViewItem::compare(QListViewItem * i,int col,bool) const return 0; } -void KTorrentViewItem::paintCell(QPainter* p,const QColorGroup & cg, +void KTorrentViewItem::paintCell(TQPainter* p,const TQColorGroup & cg, int column,int width,int align) { - QColorGroup _cg( cg ); - QColor c = _cg.text(); + TQColorGroup _cg( cg ); + TQColor c = _cg.text(); if (column == 1) - _cg.setColor(QColorGroup::Text, StatusToColor(tc->getStats().status,cg)); + _cg.setColor(TQColorGroup::Text, StatusToColor(tc->getStats().status,cg)); if (column == 11) - _cg.setColor(QColorGroup::Text, ratioToColor(kt::ShareRatio(tc->getStats()))); + _cg.setColor(TQColorGroup::Text, ratioToColor(kt::ShareRatio(tc->getStats()))); KListViewItem::paintCell(p,_cg,column,width,align); diff --git a/apps/ktorrent/ktorrentviewitem.h b/apps/ktorrent/ktorrentviewitem.h index a49e868..b38710c 100644 --- a/apps/ktorrent/ktorrentviewitem.h +++ b/apps/ktorrent/ktorrentviewitem.h @@ -39,7 +39,7 @@ class KTorrentViewItem : public KListViewItem kt::TorrentInterface* tc; bt::Int64 eta; public: - KTorrentViewItem(KTorrentView* parent,kt::TorrentInterface* tc); + KTorrentViewItem(KTorrentView* tqparent,kt::TorrentInterface* tc); virtual ~KTorrentViewItem(); kt::TorrentInterface* getTC() {return tc;} @@ -48,8 +48,8 @@ public: static QCStringList getTorrentInfo(kt::TorrentInterface* tc); private: - int compare(QListViewItem * i,int col,bool ascending) const; - void paintCell(QPainter* p,const QColorGroup & cg,int column,int width,int align); + int compare(TQListViewItem * i,int col,bool ascending) const; + void paintCell(TQPainter* p,const TQColorGroup & cg,int column,int width,int align); KTorrentView* m_parent; diff --git a/apps/ktorrent/ktorrentviewmenu.cpp b/apps/ktorrent/ktorrentviewmenu.cpp index 6ddafb2..96e2c94 100644 --- a/apps/ktorrent/ktorrentviewmenu.cpp +++ b/apps/ktorrent/ktorrentviewmenu.cpp @@ -28,76 +28,76 @@ using namespace kt; -KTorrentViewMenu::KTorrentViewMenu (KTorrentView *parent, const char *name ) - : KPopupMenu ( parent, name ),view(parent) +KTorrentViewMenu::KTorrentViewMenu (KTorrentView *tqparent, const char *name ) + : KPopupMenu ( tqparent, name ),view(tqparent) { KIconLoader* iload = KGlobal::iconLoader(); stop_id = insertItem( iload->loadIconSet("ktstop",KIcon::Small),i18n("to stop", "Stop"), - parent,SLOT(stopDownloads())); + tqparent,TQT_SLOT(stopDownloads())); start_id = insertItem( iload->loadIconSet("ktstart",KIcon::Small),i18n("to start", "Start"), - parent,SLOT(startDownloads())); + tqparent,TQT_SLOT(startDownloads())); remove_id = insertItem( iload->loadIconSet("ktremove",KIcon::Small),i18n("Remove Torrent"), - parent,SLOT(removeDownloads())); + tqparent,TQT_SLOT(removeDownloads())); remove_all_id = insertItem( iload->loadIconSet("ktremove",KIcon::Small),i18n("Remove Torrent and Data"), - parent,SLOT(removeDownloadsAndData())); + tqparent,TQT_SLOT(removeDownloadsAndData())); queue_id = insertItem( iload->loadIconSet("player_playlist",KIcon::Small),i18n("Enqueue/Dequeue"), - parent,SLOT(queueSlot())); + tqparent,TQT_SLOT(queueSlot())); insertSeparator(); add_peer_id = insertItem( iload->loadIconSet("add", KIcon::Small), i18n("Add Peers"), - parent, SLOT(showAddPeersWidget())); + tqparent, TQT_SLOT(showAddPeersWidget())); peer_sources_menu = new KPopupMenu(this); peer_sources_id = insertItem(i18n("Additional Peer Sources"), peer_sources_menu); peer_sources_menu->insertTitle(i18n("Torrent Peer Sources:")); peer_sources_menu->setCheckable(true); - dht_id = peer_sources_menu->insertItem(i18n("DHT"), parent, SLOT(dhtSlot())); - ut_pex_id = peer_sources_menu->insertItem(i18n("Peer Exchange"), parent, SLOT(utPexSlot())); + dht_id = peer_sources_menu->insertItem(i18n("DHT"), tqparent, TQT_SLOT(dhtSlot())); + ut_pex_id = peer_sources_menu->insertItem(i18n("Peer Exchange"), tqparent, TQT_SLOT(utPexSlot())); insertSeparator(); announce_id = insertItem( iload->loadIconSet("apply",KIcon::Small),i18n("Manual Announce"), - parent,SLOT(manualAnnounce())); + tqparent,TQT_SLOT(manualAnnounce())); preview_id = insertItem( iload->loadIconSet("frame_image",KIcon::Small),i18n("Preview"), - parent, SLOT(previewFiles())); + tqparent, TQT_SLOT(previewFiles())); insertSeparator(); dirs_sub_menu = new KPopupMenu(this); dirs_id = insertItem(i18n("Open Directory"), dirs_sub_menu); outputdir_id = dirs_sub_menu->insertItem(iload->loadIconSet("folder",KIcon::Small), i18n("Data Directory"), - parent, SLOT(openOutputDirectory())); + tqparent, TQT_SLOT(openOutputDirectory())); torxdir_id = dirs_sub_menu->insertItem(iload->loadIconSet("folder",KIcon::Small), i18n("Temporary Directory"), - parent, SLOT(openTorXDirectory())); + tqparent, TQT_SLOT(openTorXDirectory())); - downloaddir_id = insertItem(i18n("Set Download Location"), parent, SLOT(setDownloadLocationSlot())); + downloaddir_id = insertItem(i18n("Set Download Location"), tqparent, TQT_SLOT(setDownloadLocationSlot())); insertSeparator(); - remove_from_group_id = insertItem(i18n("Remove From Group"),parent, SLOT(removeFromGroup())); + remove_from_group_id = insertItem(i18n("Remove From Group"),tqparent, TQT_SLOT(removeFromGroup())); groups_sub_menu = new KPopupMenu(this); add_to_group_id = insertItem(i18n("Add to Group"),groups_sub_menu); insertSeparator(); - scan_id = insertItem(i18n("Check Data Integrity"),parent, SLOT(checkDataIntegrity())); + scan_id = insertItem(i18n("Check Data Integrity"),tqparent, TQT_SLOT(checkDataIntegrity())); - connect(groups_sub_menu,SIGNAL(activated(int)),this,SLOT(gsmItemActived(int))); + connect(groups_sub_menu,TQT_SIGNAL(activated(int)),this,TQT_SLOT(gsmItemActived(int))); - traffic_lim_id = insertItem(i18n("Speed Limits"),parent,SLOT(speedLimits())); + traffic_lim_id = insertItem(i18n("Speed Limits"),tqparent,TQT_SLOT(speedLimits())); } @@ -109,7 +109,7 @@ void KTorrentViewMenu::gsmItemActived(int id) groupItemActivated(groups_sub_menu->text(id).remove('&')); } -void KTorrentViewMenu::show(const QPoint & p) +void KTorrentViewMenu::show(const TQPoint & p) { bool en_start = false; bool en_stop = false; @@ -121,8 +121,8 @@ void KTorrentViewMenu::show(const QPoint & p) bool en_peer_sources = false; bool dummy = false; - QPtrList sel = view->selectedItems(); - for (QPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList sel = view->selectedItems(); + for (TQPtrList::iterator itr = sel.begin(); itr != sel.end();itr++) { KTorrentViewItem* kvi = (KTorrentViewItem*)*itr; TorrentInterface* tc = kvi->getTC(); diff --git a/apps/ktorrent/ktorrentviewmenu.h b/apps/ktorrent/ktorrentviewmenu.h index b1827e2..313d9bf 100644 --- a/apps/ktorrent/ktorrentviewmenu.h +++ b/apps/ktorrent/ktorrentviewmenu.h @@ -30,12 +30,13 @@ class KTorrentView; class KTorrentViewMenu : public KPopupMenu { Q_OBJECT + TQ_OBJECT public: - KTorrentViewMenu(KTorrentView *parent, const char *name = 0 ); + KTorrentViewMenu(KTorrentView *tqparent, const char *name = 0 ); virtual ~KTorrentViewMenu(); /// Show the menu at the given point - void show(const QPoint & p); + void show(const TQPoint & p); /// Get the group sub menu KPopupMenu* getGroupsSubMenu() {return groups_sub_menu;} @@ -45,7 +46,7 @@ public slots: signals: /// A item in the groups sub menu has been activated - void groupItemActivated(const QString & group); + void groupItemActivated(const TQString & group); private: KTorrentView* view; diff --git a/apps/ktorrent/leaktrace.cpp b/apps/ktorrent/leaktrace.cpp index 76439ce..b6c3304 100644 --- a/apps/ktorrent/leaktrace.cpp +++ b/apps/ktorrent/leaktrace.cpp @@ -91,7 +91,7 @@ static void WriteLeakReport() fclose(report); } -static void PrintStatus() +static void PrinttqStatus() { if (mtree.count == 0) { @@ -124,7 +124,7 @@ static void RegisterAlloc(void* ptr,Uint32 size) for (Uint32 b = 0;b < SOME_PRIME;b++) mtree.buckets[b] = 0; mtree.num_buckets = SOME_PRIME; - atexit(PrintStatus); + atexit(PrinttqStatus); } // hash the address @@ -147,7 +147,7 @@ static void RegisterAlloc(void* ptr,Uint32 size) static void DeregisterAlloc(void* ptr) { if (print_status_done) - printf("PrintStatus already happened !!!!!!!!!!\n"); + printf("PrinttqStatus already happened !!!!!!!!!!\n"); Uint32 b = ADDR_HASH(ptr); MemAlloc* p = mtree.buckets[b]; @@ -180,7 +180,7 @@ static void DeregisterAlloc(void* ptr) if (!p->left && !p->right) { - // no children so just free p + // no tqchildren so just free p if (prev->left == p) { free(prev->left); @@ -214,7 +214,7 @@ static void DeregisterAlloc(void* ptr) } else { - // both children exist + // both tqchildren exist if (prev->left == p) { // attach the left child of p diff --git a/apps/ktorrent/main.cpp b/apps/ktorrent/main.cpp index 77a99a5..a7a44cb 100644 --- a/apps/ktorrent/main.cpp +++ b/apps/ktorrent/main.cpp @@ -31,7 +31,7 @@ #include "ktorrentapp.h" -#include +#include #include #include #include @@ -46,25 +46,25 @@ #include #include #include -#include -#include +#include +#include using namespace bt; -void StupidWarningMessagesFromQt( QtMsgType type, const char *msg ) +void StupidWarningMessagesFromTQt( TQtMsgType type, const char *msg ) { switch ( type ) { case QtDebugMsg: - // printf("Qt: Debug: %s\n",msg); + // printf("TQt: Debug: %s\n",msg); break; case QtWarningMsg: - printf("Qt: Warning: %s\n",msg); + printf("TQt: Warning: %s\n",msg); break; case QtFatalMsg: - printf("Qt: Fatal : %s\n",msg); + printf("TQt: Fatal : %s\n",msg); abort(); // deliberately core dump break; } @@ -79,9 +79,9 @@ static const char description[] = bool GrabPIDLock() { // create a lock file in /tmp/ with the user id of the current user included in the name - QString pid_file = QString("/tmp/.ktorrent_%1.lock").arg(getuid()); + TQString pid_file = TQString("/tmp/.ktorrent_%1.lock").tqarg(getuid()); - int fd = open(QFile::encodeName(pid_file),O_RDWR|O_CREAT,0640); + int fd = open(TQFile::encodeName(pid_file),O_RDWR|O_CREAT,0640); if (fd < 0) { fprintf(stderr,"Failed to open KT lock file %s : %s\n",pid_file.ascii(),strerror(errno)); @@ -116,7 +116,7 @@ int main(int argc, char **argv) // ignore SIGPIPE's signal(SIGPIPE,SIG_IGN); signal(SIGXFSZ,SIG_IGN); - qInstallMsgHandler( StupidWarningMessagesFromQt ); + tqInstallMsgHandler( StupidWarningMessagesFromTQt ); KAboutData about("ktorrent", I18N_NOOP("KTorrent"), kt::VERSION_STRING, description, KAboutData::License_GPL, "(C) 2005 -2008 Joris Guisson and Ivan Vasic", 0, "http://www.ktorrent.org/"); diff --git a/apps/ktorrent/newui/button.cpp b/apps/ktorrent/newui/button.cpp index d133064..7a99f86 100644 --- a/apps/ktorrent/newui/button.cpp +++ b/apps/ktorrent/newui/button.cpp @@ -19,11 +19,11 @@ ***************************************************************************/ #include "button.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,32 +39,32 @@ namespace Ideal { -Button::Button(ButtonBar *parent, const QString text, const QIconSet &icon, - const QString &description) - :QPushButton(icon, text, parent), m_buttonBar(parent), m_description(description), - m_place(parent->place()), m_realText(text), m_realIconSet(icon) +Button::Button(ButtonBar *tqparent, const TQString text, const TQIconSet &icon, + const TQString &description) + :TQPushButton(icon, text, tqparent), m_buttonBar(tqparent), m_description(description), + m_place(tqparent->place()), m_realText(text), m_realIconSet(icon) { hide(); setFlat(true); setToggleButton(true); - setFocusPolicy(NoFocus); + setFocusPolicy(TQ_NoFocus); setDescription(m_description); - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - resize(sizeHint()); + tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + resize(tqsizeHint()); fixDimensions(Ideal::Bottom); - QToolTip::add(this, m_realText); + TQToolTip::add(this, m_realText); m_assignAccelAction = new KAction(i18n("Assign Accelerator..."), 0, - this, SLOT(assignAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(assignAccel()), TQT_TQOBJECT(this)); m_clearAccelAction = new KAction(i18n("Clear Accelerator"), 0, - this, SLOT(clearAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(clearAccel()), TQT_TQOBJECT(this)); KConfig *config = kapp->config(); config->setGroup("UI"); - QString accel = config->readEntry(QString("button_%1").arg(text), ""); + TQString accel = config->readEntry(TQString("button_%1").tqarg(text), ""); if (!accel.isEmpty()) - setRealText(QString("&%1 %2").arg(accel).arg(m_realText)); + setRealText(TQString("&%1 %2").tqarg(accel).tqarg(m_realText)); } Button::~Button() @@ -73,37 +73,37 @@ Button::~Button() KConfig *config = kapp->config(); config->setGroup("UI"); - QRegExp r("^&([0-9])\\s.*"); - QRegExp r2("^&[0-9]\\s"); + TQRegExp r("^&([0-9])\\s.*"); + TQRegExp r2("^&[0-9]\\s"); if (r.search(m_realText) > -1) { - QString text = m_realText; - if (text.contains(r2)) + TQString text = m_realText; + if (text.tqcontains(r2)) text.remove(r2); - config->writeEntry(QString("button_%1").arg(text), r.cap(1)); + config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1)); } else { - config->writeEntry(QString("button_%1").arg(m_realText), ""); + config->writeEntry(TQString("button_%1").tqarg(m_realText), ""); } } -void Button::setDescription(const QString &description) +void Button::setDescription(const TQString &description) { m_description = description; - QToolTip::remove(this); - QToolTip::add(this, m_description); + TQToolTip::remove(this); + TQToolTip::add(this, m_description); } -QString Button::description() const +TQString Button::description() const { return m_description; } -void Button::drawButton(QPainter *p) +void Button::drawButton(TQPainter *p) { - QRect r = rect(); - QSize sh = r.size(); + TQRect r = rect(); + TQSize sh = r.size(); switch (m_place) { case Ideal::Left: @@ -113,29 +113,29 @@ void Button::drawButton(QPainter *p) break; } - QStyle::SFlags flags = QStyle::Style_Default; + TQStyle::SFlags flags = TQStyle::Style_Default; if (isEnabled()) - flags |= QStyle::Style_Enabled; + flags |= TQStyle::Style_Enabled; if (hasFocus()) - flags |= QStyle::Style_HasFocus; + flags |= TQStyle::Style_HasFocus; if (isDown()) - flags |= QStyle::Style_Down; + flags |= TQStyle::Style_Down; if (isOn()) - flags |= QStyle::Style_On; + flags |= TQStyle::Style_On; if (! isFlat() && ! isDown()) - flags |= QStyle::Style_Raised; + flags |= TQStyle::Style_Raised; if (isDefault()) - flags |= QStyle::Style_ButtonDefault; + flags |= TQStyle::Style_ButtonDefault; - QPixmap pm(sh.width(), sh.height()); + TQPixmap pm(sh.width(), sh.height()); pm.fill(eraseColor()); - QPainter p2(&pm); + TQPainter p2(&pm); - style().drawControl(QStyle::CE_PushButton,&p2,this, QRect(0,0,pm.width(),pm.height()), colorGroup(),flags); + tqstyle().tqdrawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), tqcolorGroup(),flags); - style().drawControl(QStyle::CE_PushButtonLabel, &p2, this, - QRect(0,0,pm.width(),pm.height()), - colorGroup(), flags, QStyleOption()); + tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel, &p2, this, + TQRect(0,0,pm.width(),pm.height()), + tqcolorGroup(), flags, TQStyleOption()); switch (m_place) { @@ -153,7 +153,7 @@ void Button::drawButton(QPainter *p) } } -void Button::drawButtonLabel(QPainter */*p*/) +void Button::drawButtonLabel(TQPainter */*p*/) { } @@ -178,7 +178,7 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top)) { setFixedWidth(height()); - setMinimumHeight(sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); setMaximumHeight(32767); } break; @@ -187,50 +187,50 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right)) { setFixedHeight(width()); - setMinimumWidth(sizeHint().height()); + setMinimumWidth(tqsizeHint().height()); setMaximumWidth(32767); } break; } } -QSize Button::sizeHint() const +TQSize Button::tqsizeHint() const { - return sizeHint(text()); + return tqsizeHint(text()); } -QSize Button::sizeHint(const QString &text) const +TQSize Button::tqsizeHint(const TQString &text) const { constPolish(); int w = 0, h = 0; if ( iconSet() && !iconSet()->isNull() && (m_buttonBar->mode() != Text) ) { - int iw = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4; - int ih = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + int iw = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; + int ih = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).height(); w += iw; - h = QMAX( h, ih ); + h = TQMAX( h, ih ); } if ( isMenuButton() ) - w += style().pixelMetric(QStyle::PM_MenuButtonIndicator, this); + w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this); if ( pixmap() ) { - QPixmap *pm = (QPixmap *)pixmap(); + TQPixmap *pm = (TQPixmap *)pixmap(); w += pm->width(); h += pm->height(); } else if (m_buttonBar->mode() != Icons) { - QString s( text ); + TQString s( text ); bool empty = s.isEmpty(); if ( empty ) - s = QString::fromLatin1("XXXX"); - QFontMetrics fm = fontMetrics(); - QSize sz = fm.size( ShowPrefix, s ); + s = TQString::tqfromLatin1("XXXX"); + TQFontMetrics fm = fontMetrics(); + TQSize sz = fm.size( ShowPrefix, s ); if(!empty || !w) w += sz.width(); if(!empty || !h) - h = QMAX(h, sz.height()); + h = TQMAX(h, sz.height()); } - return (style().sizeFromContents(QStyle::CT_ToolButton, this, QSize(w, h)). - expandedTo(QApplication::globalStrut())); + return (tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). + expandedTo(TQApplication::globalStrut())); } void Button::updateSize() @@ -239,17 +239,17 @@ void Button::updateSize() { case Ideal::Left: case Ideal::Right: - setMinimumHeight(sizeHint().width()); - resize(sizeHint().height(), sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); + resize(tqsizeHint().height(), tqsizeHint().width()); break; case Ideal::Top: case Ideal::Bottom: - resize(sizeHint().width(), sizeHint().height()); + resize(tqsizeHint().width(), tqsizeHint().height()); break; } } -QString Button::realText() const +TQString Button::realText() const { return m_realText; } @@ -285,7 +285,7 @@ void Button::enableIconSet() void Button::disableIconSet() { - setIconSet(QIconSet()); + setIconSet(TQIconSet()); } void Button::disableText() @@ -299,12 +299,12 @@ void Button::enableText() setText(m_realText); } -void Button::contextMenuEvent(QContextMenuEvent *e) +void Button::contextMenuEvent(TQContextMenuEvent *e) { -/* QPopupMenu menu; +/* TQPopupMenu menu; m_assignAccelAction->plug(&menu); - if (m_realText.contains(QRegExp("^&[0-9]\\s"))) + if (m_realText.tqcontains(TQRegExp("^&[0-9]\\s"))) m_clearAccelAction->plug(&menu); emit contextMenu( &menu ); @@ -319,13 +319,13 @@ void Button::assignAccel() int num = KInputDialog::getInteger(i18n("Change Button Number"), i18n("New accelerator number:"), 1, 0, 10, 1, &ok, this); if (ok) { - QString text = realTextWithoutAccel(); - text = QString("&%1 %2").arg(num).arg(text); + TQString text = realTextWithoutAccel(); + text = TQString("&%1 %2").tqarg(num).tqarg(text); setRealText(text); } } -void Button::setRealText(const QString &text) +void Button::setRealText(const TQString &text) { m_realText = text; setText(text); @@ -337,11 +337,11 @@ void Button::clearAccel() setRealText(realTextWithoutAccel()); } -QString Button::realTextWithoutAccel() const +TQString Button::realTextWithoutAccel() const { - QString text = m_realText; - QRegExp r("^&[0-9]\\s"); - if (text.contains(r)) + TQString text = m_realText; + TQRegExp r("^&[0-9]\\s"); + if (text.tqcontains(r)) text.remove(r); return text; } diff --git a/apps/ktorrent/newui/button.h b/apps/ktorrent/newui/button.h index a7afbcf..fd668f8 100644 --- a/apps/ktorrent/newui/button.h +++ b/apps/ktorrent/newui/button.h @@ -20,8 +20,8 @@ #ifndef IDEALBUTTON_H #define IDEALBUTTON_H -#include -#include +#include +#include #include "comdefs.h" @@ -34,50 +34,51 @@ class ButtonBar; /** @short A button to place onto the ButtonBar -A QPushButton derivative with a size of a QToolBar. Button can be rotated +A TQPushButton derivative with a size of a TQToolBar. Button can be rotated (placed onto different places in ideal mode). */ -class Button : public QPushButton { +class Button : public TQPushButton { Q_OBJECT + TQ_OBJECT public: - Button(ButtonBar *parent, const QString text, const QIconSet &icon = QIconSet(), - const QString &description = QString::null); + Button(ButtonBar *tqparent, const TQString text, const TQIconSet &icon = TQIconSet(), + const TQString &description = TQString()); /**Sets the description used as a tooltip.*/ - void setDescription(const QString &description); + void setDescription(const TQString &description); /**Returns the description.*/ - QString description() const; + TQString description() const; /**Sets the place of a button.*/ void setPlace(Ideal::Place place); /**Sets the mode of a button.*/ void setMode(Ideal::ButtonMode mode); - QSize sizeHint() const; - QSize sizeHint(const QString &text) const; + TQSize tqsizeHint() const; + TQSize tqsizeHint(const TQString &text) const; /**Updates size of a widget. Used after squeezing button's text.*/ void updateSize(); /**Returns the real (i.e. not squeezed) text of a button.*/ - QString realText() const; - QString realTextWithoutAccel() const; - void setRealText(const QString &text); + TQString realText() const; + TQString realTextWithoutAccel() const; + void setRealText(const TQString &text); protected: ButtonMode mode(); - virtual void drawButton(QPainter *p); - virtual void drawButtonLabel(QPainter *p); + virtual void drawButton(TQPainter *p); + virtual void drawButtonLabel(TQPainter *p); - virtual void contextMenuEvent(QContextMenuEvent *e); + virtual void contextMenuEvent(TQContextMenuEvent *e); protected slots: void assignAccel(); void clearAccel(); signals: - void contextMenu(QPopupMenu*); + void contextMenu(TQPopupMenu*); private: virtual ~Button(); @@ -91,11 +92,11 @@ private: ButtonBar *m_buttonBar; - QString m_description; + TQString m_description; Place m_place; - QString m_realText; - QIconSet m_realIconSet; + TQString m_realText; + TQIconSet m_realIconSet; KAction *m_assignAccelAction; KAction *m_clearAccelAction; diff --git a/apps/ktorrent/newui/buttonbar.cpp b/apps/ktorrent/newui/buttonbar.cpp index 8f60dab..0118358 100644 --- a/apps/ktorrent/newui/buttonbar.cpp +++ b/apps/ktorrent/newui/buttonbar.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "buttonbar.h" -#include +#include #include #include @@ -32,14 +32,14 @@ namespace Ideal { //ButtonLayout class -ButtonLayout::ButtonLayout(ButtonBar *parent, Direction d, int margin, int spacing, const char *name) - :QBoxLayout(parent, d, margin, spacing, name), m_buttonBar(parent) +ButtonLayout::ButtonLayout(ButtonBar *tqparent, Direction d, int margin, int spacing, const char *name) + :TQBoxLayout(tqparent, d, margin, spacing, name), m_buttonBar(tqparent) { } -QSize ButtonLayout::minimumSize() const +TQSize ButtonLayout::tqminimumSize() const { - QSize size = QBoxLayout::minimumSize(); + TQSize size = TQBoxLayout::tqminimumSize(); if (!m_buttonBar->autoResize()) return size; @@ -48,13 +48,13 @@ QSize ButtonLayout::minimumSize() const { case Ideal::Left: case Ideal::Right: - return QSize(size.width(),0); + return TQSize(size.width(),0); break; case Ideal::Top: case Ideal::Bottom: - return QSize(0,size.height()); + return TQSize(0,size.height()); } - return QBoxLayout::minimumSize(); + return TQBoxLayout::tqminimumSize(); } @@ -62,22 +62,22 @@ QSize ButtonLayout::minimumSize() const //ButtonBar class -ButtonBar::ButtonBar(Place place, ButtonMode mode, QWidget *parent, const char *name) - :QWidget(parent, name), m_place(place), l(0), m_shrinked(false), m_autoResize(true) +ButtonBar::ButtonBar(Place place, ButtonMode mode, TQWidget *tqparent, const char *name) + :TQWidget(tqparent, name), m_place(place), l(0), m_shrinked(false), m_autoResize(true) { switch (m_place) { case Ideal::Left: case Ideal::Right: - l = new ButtonLayout(this, QBoxLayout::TopToBottom, 0, 0); + l = new ButtonLayout(this, TQBoxLayout::TopToBottom, 0, 0); break; case Ideal::Top: case Ideal::Bottom: - l = new ButtonLayout(this, QBoxLayout::LeftToRight, 0, 0); + l = new ButtonLayout(this, TQBoxLayout::LeftToRight, 0, 0); break; } - l->setResizeMode(QLayout::Minimum); + l->setResizeMode(TQLayout::Minimum); setMode(mode); l->insertStretch(-1); @@ -128,14 +128,14 @@ void ButtonBar::fixDimensions() { case Ideal::Left: case Ideal::Right: - setFixedWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); + setFixedWidth(tqsizeHint().width()); + setMinimumHeight(tqsizeHint().height()); setMaximumHeight(32767); break; case Ideal::Top: case Ideal::Bottom: - setFixedHeight(sizeHint().height()); - setMinimumWidth(sizeHint().width()); + setFixedHeight(tqsizeHint().height()); + setMinimumWidth(tqsizeHint().width()); setMaximumWidth(32767); break; } @@ -147,7 +147,7 @@ void ButtonBar::setButtonsPlace(Ideal::Place place) (*it)->setPlace(place); } -void ButtonBar::resizeEvent(QResizeEvent *ev) +void ButtonBar::resizeEvent(TQResizeEvent *ev) { int preferredDimension = 0; int actualDimension = 0; @@ -156,13 +156,13 @@ void ButtonBar::resizeEvent(QResizeEvent *ev) { case Ideal::Left: case Ideal::Right: - preferredDimension = l->QBoxLayout::minimumSize().height(); + preferredDimension = l->TQBoxLayout::tqminimumSize().height(); actualDimension = size().height(); oldDimension = ev->oldSize().height(); break; case Ideal::Top: case Ideal::Bottom: - preferredDimension = l->QBoxLayout::minimumSize().width(); + preferredDimension = l->TQBoxLayout::tqminimumSize().width(); actualDimension = size().width(); oldDimension = ev->oldSize().width(); break; @@ -175,7 +175,7 @@ void ButtonBar::resizeEvent(QResizeEvent *ev) else if (m_shrinked && actualDimension > oldDimension) deshrink(preferredDimension, actualDimension); - QWidget::resizeEvent(ev); + TQWidget::resizeEvent(ev); } void ButtonBar::shrink(int preferredDimension, int actualDimension) @@ -186,7 +186,7 @@ void ButtonBar::shrink(int preferredDimension, int actualDimension) m_shrinked = true; uint textLength = 0; - QValueList texts; + TQValueList texts; uint maxLength = 0; for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it) { @@ -203,7 +203,7 @@ void ButtonBar::shrink(int preferredDimension, int actualDimension) do { newMaxLength -= 1; newTextLength = 0; - for (QValueList::iterator it = texts.begin(); it != texts.end(); ++it) + for (TQValueList::iterator it = texts.begin(); it != texts.end(); ++it) { if (*it > newMaxLength) *it = newMaxLength; @@ -227,7 +227,7 @@ void ButtonBar::deshrink(int preferredDimension, int actualDimension) m_shrinked = true; uint textLength = 0; - QValueList texts; + TQValueList texts; uint maxLength = 0; for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it) { @@ -247,9 +247,9 @@ void ButtonBar::deshrink(int preferredDimension, int actualDimension) do { newTextLength = 0; int i = 0; - for (QValueList::iterator it = texts.begin(); it != texts.end(); ++it, i++) + for (TQValueList::iterator it = texts.begin(); it != texts.end(); ++it, i++) { - if (m_buttons[i]->text().contains("...")) + if (m_buttons[i]->text().tqcontains("...")) (*it)++; newTextLength += *it; } @@ -285,7 +285,7 @@ int ButtonBar::originalDimension() int size = 0; for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it) { - size += (*it)->sizeHint((*it)->realText()).width(); + size += (*it)->tqsizeHint((*it)->realText()).width(); } return size; } @@ -309,7 +309,7 @@ Button *ButtonBar::firstButton() Button *ButtonBar::nextTo(Button *button) { - ButtonList::iterator it = m_buttons.find(button); + ButtonList::iterator it = m_buttons.tqfind(button); Button *next = 0; if ((*it) == m_buttons.last()) next = m_buttons.first(); @@ -326,7 +326,7 @@ Button *ButtonBar::nextTo(Button *button) Button *ButtonBar::prevTo(Button *button) { - ButtonList::iterator it = m_buttons.find(button); + ButtonList::iterator it = m_buttons.tqfind(button); Button *prev = 0; if (it == m_buttons.begin()) prev = m_buttons.last(); diff --git a/apps/ktorrent/newui/buttonbar.h b/apps/ktorrent/newui/buttonbar.h index 5f5a7e3..7e25278 100644 --- a/apps/ktorrent/newui/buttonbar.h +++ b/apps/ktorrent/newui/buttonbar.h @@ -20,26 +20,26 @@ #ifndef IDEALBUTTONBAR_H #define IDEALBUTTONBAR_H -#include -#include +#include +#include #include "comdefs.h" -#include +#include namespace Ideal { class Button; class ButtonBar; -/**@short A layout for a ButtonBar class. +/**@short A tqlayout for a ButtonBar class. -Overrides minimumSize method to allow shrinking button bar buttons.*/ -class ButtonLayout: public QBoxLayout{ +Overrides tqminimumSize method to allow shrinking button bar buttons.*/ +class ButtonLayout: public TQBoxLayout{ public: - ButtonLayout(ButtonBar *parent, Direction d, int margin = 0, int spacing = -1, const char * name = 0); + ButtonLayout(ButtonBar *tqparent, Direction d, int margin = 0, int spacing = -1, const char * name = 0); - virtual QSize minimumSize() const; + virtual TQSize tqminimumSize() const; private: ButtonBar *m_buttonBar; @@ -51,11 +51,12 @@ private: Looks like a toolbar but has another behaviour. It is suitable for placing on the left(right, bottom, top) corners of a window as a bar with slider. */ -class ButtonBar : public QWidget { +class ButtonBar : public TQWidget { Q_OBJECT + TQ_OBJECT public: ButtonBar(Place place, ButtonMode mode = IconsAndText, - QWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); virtual ~ButtonBar(); /**Adds a button to the bar.*/ @@ -87,7 +88,7 @@ public: Button *prevTo(Button *button); protected: - virtual void resizeEvent ( QResizeEvent *ev ); + virtual void resizeEvent ( TQResizeEvent *ev ); int originalDimension(); @@ -95,7 +96,7 @@ private: void fixDimensions(); void setButtonsPlace(Ideal::Place place); - typedef QValueList ButtonList; + typedef TQValueList ButtonList; ButtonList m_buttons; ButtonMode m_mode; diff --git a/apps/ktorrent/newui/ddockwindow.cpp b/apps/ktorrent/newui/ddockwindow.cpp index 9edfc7c..1dbd7c7 100644 --- a/apps/ktorrent/newui/ddockwindow.cpp +++ b/apps/ktorrent/newui/ddockwindow.cpp @@ -19,13 +19,13 @@ ***************************************************************************/ #include "ddockwindow.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,9 +39,9 @@ #include "button.h" #include "dmainwindow.h" -DDockWindow::DDockWindow(DMainWindow *parent, Position position) - :QDockWindow(QDockWindow::InDock, parent), m_position(position), m_visible(false), - m_mainWindow(parent), m_doNotCloseActiveWidget(false), m_toggledButton(0), m_lastContextMenuButton(0) +DDockWindow::DDockWindow(DMainWindow *tqparent, Position position) + :TQDockWindow(TQDockWindow::InDock, tqparent), m_position(position), m_visible(false), + m_mainWindow(tqparent), m_doNotCloseActiveWidget(false), m_toggledButton(0), m_lastContextMenuButton(0) { setMovingEnabled(false); setResizeEnabled(true); @@ -51,20 +51,20 @@ DDockWindow::DDockWindow(DMainWindow *parent, Position position) case DDockWindow::Bottom: m_name = "BottomToolWindow"; place = Ideal::Bottom; - m_internalLayout = new QVBoxLayout(boxLayout(), 0); - m_internalLayout->setDirection(QBoxLayout::BottomToTop); + m_internalLayout = new TQVBoxLayout(boxLayout(), 0); + m_internalLayout->setDirection(TQBoxLayout::BottomToTop); break; case DDockWindow::Left: m_name = "LeftToolWindow"; place = Ideal::Left; - m_internalLayout = new QHBoxLayout(boxLayout(), 0); - m_internalLayout->setDirection(QBoxLayout::LeftToRight); + m_internalLayout = new TQHBoxLayout(boxLayout(), 0); + m_internalLayout->setDirection(TQBoxLayout::LeftToRight); break; case DDockWindow::Right: m_name = "RightToolWindow"; place = Ideal::Right; - m_internalLayout = new QHBoxLayout(boxLayout(), 0); - m_internalLayout->setDirection(QBoxLayout::RightToLeft); + m_internalLayout = new TQHBoxLayout(boxLayout(), 0); + m_internalLayout->setDirection(TQBoxLayout::RightToLeft); break; } @@ -82,12 +82,12 @@ DDockWindow::DDockWindow(DMainWindow *parent, Position position) m_bar = new Ideal::ButtonBar(place, buttonMode, this); m_internalLayout->addWidget(m_bar); - m_widgetStack = new QWidgetStack(this); + m_widgetStack = new TQWidgetStack(this); m_internalLayout->addWidget(m_widgetStack); - m_moveToDockLeft = new KAction( i18n("Move to left dock"), 0, this, SLOT(moveToDockLeft()), this ); - m_moveToDockRight = new KAction( i18n("Move to right dock"), 0, this, SLOT(moveToDockRight()), this ); - m_moveToDockBottom = new KAction( i18n("Move to bottom dock"), 0, this, SLOT(moveToDockBottom()), this ); + m_moveToDockLeft = new KAction( i18n("Move to left dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockLeft()), TQT_TQOBJECT(this) ); + m_moveToDockRight = new KAction( i18n("Move to right dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockRight()), TQT_TQOBJECT(this) ); + m_moveToDockBottom = new KAction( i18n("Move to bottom dock"), 0, TQT_TQOBJECT(this), TQT_SLOT(moveToDockBottom()), TQT_TQOBJECT(this) ); setVisible(m_visible); @@ -104,7 +104,7 @@ void DDockWindow::setVisible(bool v) { //write dock width to the config file KConfig *config = kapp->config(); - QString group = QString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); config->setGroup(group); if (m_visible) @@ -115,13 +115,13 @@ void DDockWindow::setVisible(bool v) v ? m_widgetStack->show() : m_widgetStack->hide(); m_visible = v; - m_internalLayout->invalidate(); + m_internalLayout->tqinvalidate(); if (!m_visible) { if (m_position == DDockWindow::Bottom) - setFixedExtentHeight(m_internalLayout->sizeHint().height()); + setFixedExtentHeight(m_internalLayout->tqsizeHint().height()); else - setFixedExtentWidth(m_internalLayout->sizeHint().width()); + setFixedExtentWidth(m_internalLayout->tqsizeHint().width()); emit hidden(); } else @@ -130,12 +130,12 @@ void DDockWindow::setVisible(bool v) int size = 0; if (m_position == DDockWindow::Bottom) { - size = config->readNumEntry("ViewWidth", m_internalLayout->minimumSize().height()); + size = config->readNumEntry("ViewWidth", m_internalLayout->tqminimumSize().height()); setFixedExtentHeight(size); } else { - size = config->readNumEntry("ViewWidth", m_internalLayout->minimumSize().width()); + size = config->readNumEntry("ViewWidth", m_internalLayout->tqminimumSize().width()); setFixedExtentWidth(size); } } @@ -148,7 +148,7 @@ void DDockWindow::loadSettings() void DDockWindow::saveSettings() { KConfig *config = kapp->config(); - QString group = QString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); int invisibleWidth = 0; config->setGroup(group); if (config->hasKey("ViewWidth")) @@ -164,22 +164,22 @@ void DDockWindow::saveSettings() config->writeEntry("ViewWidth", invisibleWidth); } -QWidget *DDockWindow::currentWidget() const +TQWidget *DDockWindow::currentWidget() const { return m_widgetStack->visibleWidget(); } -void DDockWindow::addWidget(const QString &title, QWidget *widget, bool skipActivation) +void DDockWindow::addWidget(const TQString &title, TQWidget *widget, bool skipActivation) { kdDebug(9000) << k_funcinfo << endl; - QPixmap *pm = const_cast(widget->icon()); + TQPixmap *pm = const_cast(widget->icon()); Ideal::Button *button; if (pm != 0) { //force 16pt for now if (pm->height() > 16) { - QImage img = pm->convertToImage(); + TQImage img = pm->convertToImage(); img = img.smoothScale(16, 16); pm->convertFromImage(img); } @@ -192,15 +192,15 @@ void DDockWindow::addWidget(const QString &title, QWidget *widget, bool skipActi m_bar->addButton(button); m_widgetStack->addWidget(widget); - connect(button, SIGNAL(clicked()), this, SLOT(selectWidget())); - connect(button, SIGNAL(contextMenu(QPopupMenu*)), this, SLOT(contextMenu(QPopupMenu*)) ); + connect(button, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(selectWidget())); + connect(button, TQT_SIGNAL(contextMenu(TQPopupMenu*)), TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQPopupMenu*)) ); if (!skipActivation) { //if the widget was selected last time the dock is deleted //we need to show it KConfig *config = kapp->config(); - QString group = QString("%1").arg(m_name); + TQString group = TQString("%1").tqarg(m_name); config->setGroup(group); if (config->readEntry("ViewLastWidget") == title) { @@ -211,7 +211,7 @@ void DDockWindow::addWidget(const QString &title, QWidget *widget, bool skipActi } } -void DDockWindow::raiseWidget(QWidget *widget) +void DDockWindow::raiseWidget(TQWidget *widget) { kdDebug(9000) << k_funcinfo << endl; @@ -225,7 +225,7 @@ void DDockWindow::raiseWidget(QWidget *widget) } } -void DDockWindow::lowerWidget(QWidget * widget) +void DDockWindow::lowerWidget(TQWidget * widget) { kdDebug(9000) << k_funcinfo << endl; @@ -239,7 +239,7 @@ void DDockWindow::lowerWidget(QWidget * widget) } } -void DDockWindow::removeWidget(QWidget *widget) +void DDockWindow::removeWidget(TQWidget *widget) { kdDebug(9000) << k_funcinfo << endl; if (m_widgetStack->id(widget) == -1) @@ -294,10 +294,10 @@ void DDockWindow::selectWidget(Ideal::Button *button) void DDockWindow::selectWidget() { - selectWidget((Ideal::Button*)sender()); + selectWidget((Ideal::Button*)TQT_TQOBJECT(const_cast(sender()))); } -void DDockWindow::hideWidget(QWidget *widget) +void DDockWindow::hideWidget(TQWidget *widget) { Ideal::Button *button = m_buttons[widget]; if (button != 0) @@ -310,7 +310,7 @@ void DDockWindow::hideWidget(QWidget *widget) setVisible(false); } -void DDockWindow::showWidget(QWidget *widget) +void DDockWindow::showWidget(TQWidget *widget) { Ideal::Button *button = m_buttons[widget]; if (button != 0) @@ -322,7 +322,7 @@ void DDockWindow::setMovingEnabled(bool) { //some operations on KMainWindow cause moving to be enabled //but we always don't want DDockWindow instances to be movable - QDockWindow::setMovingEnabled(false); + TQDockWindow::setMovingEnabled(false); } void DDockWindow::selectLastWidget() @@ -338,16 +338,16 @@ bool DDockWindow::isActive() { if (m_toggledButton) { - QWidget *w = qApp->focusWidget(); + TQWidget *w = tqApp->tqfocusWidget(); if (!w) return false; - QWidget *toolWidget = m_widgets[m_toggledButton]; + TQWidget *toolWidget = m_widgets[m_toggledButton]; if (toolWidget == w) return true; else { do { - w = (QWidget*)w->parent(); + w = (TQWidget*)w->tqparent(); if (w && (w == toolWidget)) return true; } while (w); } @@ -373,9 +373,9 @@ void DDockWindow::selectPrevWidget() b->animateClick(); } -void DDockWindow::contextMenu(QPopupMenu * menu) +void DDockWindow::contextMenu(TQPopupMenu * menu) { - m_lastContextMenuButton = static_cast( const_cast( sender() ) ); + m_lastContextMenuButton = static_cast( TQT_TQWIDGET(const_cast(sender())) ); menu->insertSeparator(); @@ -404,7 +404,7 @@ void DDockWindow::moveToDockBottom() void DDockWindow::moveToDock(DDockWindow::Position position ) { - if ( m_widgets.contains( m_lastContextMenuButton ) ) + if ( m_widgets.tqcontains( m_lastContextMenuButton ) ) { mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() ); } diff --git a/apps/ktorrent/newui/ddockwindow.h b/apps/ktorrent/newui/ddockwindow.h index d0cc655..daecc60 100644 --- a/apps/ktorrent/newui/ddockwindow.h +++ b/apps/ktorrent/newui/ddockwindow.h @@ -20,13 +20,13 @@ #ifndef DDOCKWINDOW_H #define DDOCKWINDOW_H -#include -#include +#include +#include -class QBoxLayout; -class QToolButton; -class QWidgetStack; -class QPopupMenu; +class TQBoxLayout; +class TQToolButton; +class TQWidgetStack; +class TQPopupMenu; class KComboBox; class KAction; @@ -38,28 +38,29 @@ namespace Ideal { class ButtonBar; } -class DDockWindow : public QDockWindow { +class DDockWindow : public TQDockWindow { Q_OBJECT + TQ_OBJECT public: enum Position { Bottom, Left, Right }; - DDockWindow(DMainWindow *parent, Position position); + DDockWindow(DMainWindow *tqparent, Position position); virtual ~DDockWindow(); virtual void setVisible(bool v); bool visible() const { return m_visible; } Position position() const { return m_position; } - virtual void addWidget(const QString &title, QWidget *widget, bool skipActivation = false); - virtual void raiseWidget(QWidget *widget); - virtual void lowerWidget(QWidget *widget); + virtual void addWidget(const TQString &title, TQWidget *widget, bool skipActivation = false); + virtual void raiseWidget(TQWidget *widget); + virtual void lowerWidget(TQWidget *widget); /**Removes the widget from dock. Does not delete it.*/ - virtual void removeWidget(QWidget *widget); + virtual void removeWidget(TQWidget *widget); - virtual void hideWidget(QWidget *widget); - virtual void showWidget(QWidget *widget); + virtual void hideWidget(TQWidget *widget); + virtual void showWidget(TQWidget *widget); - virtual QWidget *currentWidget() const; + virtual TQWidget *currentWidget() const; virtual void setMovingEnabled(bool b); @@ -81,7 +82,7 @@ signals: private slots: void selectWidget(); void selectWidget(Ideal::Button *button); - void contextMenu(QPopupMenu*); + void contextMenu(TQPopupMenu*); void moveToDockLeft(); void moveToDockRight(); void moveToDockBottom(); @@ -91,21 +92,21 @@ protected: virtual void loadSettings(); Ideal::ButtonBar *m_bar; - QWidgetStack *m_widgetStack; + TQWidgetStack *m_widgetStack; - QMap m_widgets; - QMap m_buttons; + TQMap m_widgets; + TQMap m_buttons; private: Position m_position; bool m_visible; - QString m_name; + TQString m_name; DMainWindow *m_mainWindow; bool m_doNotCloseActiveWidget; Ideal::Button *m_toggledButton; Ideal::Button *m_lastContextMenuButton; - QBoxLayout *m_internalLayout; + TQBoxLayout *m_internalLayout; KAction * m_moveToDockLeft; diff --git a/apps/ktorrent/newui/dmainwindow.cpp b/apps/ktorrent/newui/dmainwindow.cpp index ff24980..b90045c 100644 --- a/apps/ktorrent/newui/dmainwindow.cpp +++ b/apps/ktorrent/newui/dmainwindow.cpp @@ -24,13 +24,13 @@ #include #include -#include +#include #include "dtabwidget.h" #include "docksplitter.h" -DMainWindow::DMainWindow(QWidget *parent, const char *name) - :KParts::MainWindow(parent, name), m_firstRemoved(false), m_currentWidget(0) +DMainWindow::DMainWindow(TQWidget *tqparent, const char *name) + :KParts::MainWindow(tqparent, name), m_firstRemoved(false), m_currentWidget(0) { loadSettings(); createToolWindows(); @@ -57,7 +57,7 @@ void DMainWindow::saveSettings() DMainWindow::~DMainWindow() { -/* for (QValueList::iterator it = m_widgets.begin(); it != m_widgets.end(); ++it) +/* for (TQValueList::iterator it = m_widgets.begin(); it != m_widgets.end(); ++it) removeWidget(*it);*/ } @@ -74,11 +74,11 @@ DDockWindow *DMainWindow::toolWindow(DDockWindow::Position position) const void DMainWindow::createToolWindows() { m_bottomDock = new DDockWindow(this, DDockWindow::Bottom); - moveDockWindow(m_bottomDock, Qt::DockBottom); + moveDockWindow(m_bottomDock, TQt::DockBottom); m_leftDock = new DDockWindow(this, DDockWindow::Left); - moveDockWindow(m_leftDock, Qt::DockLeft); + moveDockWindow(m_leftDock, TQt::DockLeft); m_rightDock = new DDockWindow(this, DDockWindow::Right); - moveDockWindow(m_rightDock, Qt::DockRight); + moveDockWindow(m_rightDock, TQt::DockRight); // hide all docks until we add stuff to it m_bottomDock->hide(); @@ -86,9 +86,9 @@ void DMainWindow::createToolWindows() m_rightDock->hide(); } -void DMainWindow::addWidget(QWidget *widget, const QString &title) +void DMainWindow::addWidget(TQWidget *widget, const TQString &title) { -// invalidateActiveTabWidget(); +// tqinvalidateActiveTabWidget(); if (m_firstRemoved && m_activeTabWidget == m_tabs.first()) { m_central->addDock(0, 0, m_activeTabWidget); @@ -98,17 +98,17 @@ void DMainWindow::addWidget(QWidget *widget, const QString &title) addWidget(m_activeTabWidget, widget, title); } -void DMainWindow::addWidget(DTabWidget *tab, QWidget *widget, const QString &title) +void DMainWindow::addWidget(DTabWidget *tab, TQWidget *widget, const TQString &title) { - static QPixmap emptyPixmap; + static TQPixmap emptyPixmap; int idx = -1; if (m_openTabAfterCurrent && (tab->count() > 0)) idx = tab->currentPageIndex() + 1; if (m_showIconsOnTabs) { - const QPixmap *pixmap = widget->icon(); - const QIconSet &icons = (pixmap && (pixmap->size().height() <= 16)) ? *(pixmap) : SmallIcon("kdevelop"); + const TQPixmap *pixmap = widget->icon(); + const TQIconSet &icons = (pixmap && (pixmap->size().height() <= 16)) ? *(pixmap) : SmallIcon("kdevelop"); tab->insertTab(widget, icons, title, idx); } else @@ -119,18 +119,18 @@ void DMainWindow::addWidget(DTabWidget *tab, QWidget *widget, const QString &tit tab->showPage(widget); } -void DMainWindow::removeWidget(QWidget *widget) +void DMainWindow::removeWidget(TQWidget *widget) { - if (!m_widgets.contains(widget)) + if (!m_widgets.tqcontains(widget)) return; //not a widget in main window - if (m_widgetTabs.contains(widget)) + if (m_widgetTabs.tqcontains(widget)) { DTabWidget *tab = m_widgetTabs[widget]; if (tab->indexOf(widget) >= 0) { tab->removePage(widget); - widget->reparent(0,QPoint(0,0),false); + widget->reparent(0,TQPoint(0,0),false); if (tab->count() == 0) { if (tab->closeButton()) @@ -138,7 +138,7 @@ void DMainWindow::removeWidget(QWidget *widget) //remove and delete tabwidget if it is not the first one if (tab != m_tabs.first()) { - QPair idx = m_central->indexOf(tab); + TQPair idx = m_central->indexOf(tab); m_tabs.remove(tab); m_activeTabWidget = m_tabs.first(); m_central->removeDock(idx.first, idx.second, true); @@ -166,8 +166,8 @@ void DMainWindow::removeWidget(QWidget *widget) if (m_activeTabWidget && m_activeTabWidget->currentPage()) { //a hack to please multibuffer and actually switch the active part - QFocusEvent ev(QEvent::FocusIn); - QApplication::sendEvent(m_activeTabWidget->currentPage(), &ev); + TQFocusEvent ev(TQEvent::FocusIn); + TQApplication::sendEvent(m_activeTabWidget->currentPage(), &ev); } } @@ -180,25 +180,25 @@ DTabWidget *DMainWindow::splitHorizontal() DTabWidget *DMainWindow::splitVertical() { -// invalidateActiveTabWidget(); +// tqinvalidateActiveTabWidget(); int row = m_central->indexOf(m_activeTabWidget).first; m_activeTabWidget = createTab(); m_central->addDock(row, m_central->numCols(row), m_activeTabWidget); return m_activeTabWidget; } -void DMainWindow::invalidateActiveTabWidget() +void DMainWindow::tqinvalidateActiveTabWidget() { -/* QWidget *focused = m_central->focusWidget(); - kdDebug(9000) << "invalidate: " << focused << endl; +/* TQWidget *focused = m_central->tqfocusWidget(); + kdDebug(9000) << "tqinvalidate: " << focused << endl; if (focused == 0) return; - if (!m_widgets.contains(focused)) + if (!m_widgets.tqcontains(focused)) { kdDebug(9000) << " focused is not in m_widgets" << endl; return; } - if (m_widgetTabs.contains(focused)) + if (m_widgetTabs.tqcontains(focused)) { kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl; DTabWidget *tab = m_widgetTabs[focused]; @@ -213,33 +213,33 @@ DTabWidget *DMainWindow::createTab() DTabWidget *tab = new DTabWidget(m_central); m_tabs.append(tab); if (tab->closeButton()) - connect(tab->closeButton(), SIGNAL(clicked()), this, SLOT(closeTab())); - connect(tab, SIGNAL(closeRequest(QWidget*)), this, SLOT(closeTab(QWidget*))); - connect(tab, SIGNAL(contextMenu(QWidget*,const QPoint &)), - this, SLOT(tabContext(QWidget*,const QPoint &))); + connect(tab->closeButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(closeTab())); + connect(tab, TQT_SIGNAL(closeRequest(TQWidget*)), this, TQT_SLOT(closeTab(TQWidget*))); + connect(tab, TQT_SIGNAL(contextMenu(TQWidget*,const TQPoint &)), + this, TQT_SLOT(tabContext(TQWidget*,const TQPoint &))); return tab; } -bool DMainWindow::eventFilter(QObject *obj, QEvent *ev) +bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev) { - QWidget *w = (QWidget*)obj; - if (!m_widgets.contains(w)) + TQWidget *w = (TQWidget*)obj; + if (!m_widgets.tqcontains(w)) return KParts::MainWindow::eventFilter(obj, ev); - if ((m_currentWidget != w) && (ev->type() == QEvent::FocusIn)) + if ((m_currentWidget != w) && (ev->type() == TQEvent::FocusIn)) { m_currentWidget = w; emit widgetChanged(w); } - else if (ev->type() == QEvent::IconChange) + else if (ev->type() == TQEvent::IconChange) { - if (m_widgetTabs.contains(w)) + if (m_widgetTabs.tqcontains(w)) { DTabWidget *tab = m_widgetTabs[w]; - tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : QPixmap()); + tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : TQPixmap()); } } - else if (ev->type() == QEvent::CaptionChange) + else if (ev->type() == TQEvent::CaptionChange) { kdDebug(9000) << "caption change" << endl; DTabWidget *tab = m_widgetTabs[w]; @@ -254,19 +254,19 @@ void DMainWindow::closeTab() //nothing to do here, should be reimplemented } -void DMainWindow::tabContext(QWidget *, const QPoint &) +void DMainWindow::tabContext(TQWidget *, const TQPoint &) { //nothing to do here, should be reimplemented } -void DMainWindow::closeTab(QWidget *) +void DMainWindow::closeTab(TQWidget *) { //nothing to do here, should be reimplemented } -void DMainWindow::moveWidget(DDockWindow::Position position, QWidget * view, const QString & title) +void DMainWindow::moveWidget(DDockWindow::Position position, TQWidget * view, const TQString & title) { - if (m_docks.contains(view)) + if (m_docks.tqcontains(view)) { toolWindow(m_docks[view])->removeWidget(view); @@ -275,17 +275,17 @@ void DMainWindow::moveWidget(DDockWindow::Position position, QWidget * view, con } } -void DMainWindow::addDockWidget(DDockWindow::Position position, QWidget *view, const QString &title) +void DMainWindow::addDockWidget(DDockWindow::Position position, TQWidget *view, const TQString &title) { DDockWindow* dock = toolWindow(position); dock->addWidget(title, view); m_docks[view] = position; - connect(view, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); + connect(view, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDestroyed())); if (dock->isHidden()) dock->show(); } -void DMainWindow::removeDockWidget(QWidget *view) +void DMainWindow::removeDockWidget(TQWidget *view) { DDockWindow* dock = toolWindow(m_docks[view]); dock->removeWidget(view); @@ -294,21 +294,21 @@ void DMainWindow::removeDockWidget(QWidget *view) dock->hide(); } -bool DMainWindow::hasDockWidget(QWidget *view) +bool DMainWindow::hasDockWidget(TQWidget *view) { - return m_docks.contains(view); + return m_docks.tqcontains(view); } -DDockWindow::Position DMainWindow::dockWidgetPosition(QWidget *view) +DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view) { return m_docks[view]; } void DMainWindow::widgetDestroyed() { - QWidget *w = static_cast(const_cast(sender())); + TQWidget *w = TQT_TQWIDGET(const_cast(sender())); - if (m_docks.contains(w)) + if (m_docks.tqcontains(w)) { kdError() << "Widget destroyed before being removed from UI!" << endl; m_docks.remove(w); @@ -317,4 +317,4 @@ void DMainWindow::widgetDestroyed() #include "dmainwindow.moc" -// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on +// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on diff --git a/apps/ktorrent/newui/dmainwindow.h b/apps/ktorrent/newui/dmainwindow.h index 326d0c0..be40b61 100644 --- a/apps/ktorrent/newui/dmainwindow.h +++ b/apps/ktorrent/newui/dmainwindow.h @@ -33,8 +33,9 @@ namespace Ideal { /**Main window which provides simplified IDEA mode.*/ class DMainWindow: public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: - DMainWindow(QWidget *parent = 0, const char *name = 0); + DMainWindow(TQWidget *tqparent = 0, const char *name = 0); virtual ~DMainWindow(); /**@return The tool window in given @p position.*/ @@ -42,22 +43,22 @@ public: /**Adds a tabbed widget into the active (focused) tab widget. If @p widget is null then only tab is created.*/ - virtual void addWidget(QWidget *widget, const QString &title); - virtual void addWidget(DTabWidget *tab, QWidget *widget, const QString &title); + virtual void addWidget(TQWidget *widget, const TQString &title); + virtual void addWidget(DTabWidget *tab, TQWidget *widget, const TQString &title); /**Removes widget. Does not delete it.*/ - virtual void removeWidget(QWidget *widget); + virtual void removeWidget(TQWidget *widget); /**Moves a widget from an existing dockposition to a new position**/ - virtual void moveWidget(DDockWindow::Position newPosition, QWidget *widget, const QString & title); + virtual void moveWidget(DDockWindow::Position newPosition, TQWidget *widget, const TQString & title); /**Adds a dock widget into given position.*/ - virtual void addDockWidget(DDockWindow::Position position, QWidget *view, const QString &title); + virtual void addDockWidget(DDockWindow::Position position, TQWidget *view, const TQString &title); /**Removes a dock widget.*/ - virtual void removeDockWidget(QWidget *view); + virtual void removeDockWidget(TQWidget *view); virtual void saveSettings(); - bool hasDockWidget(QWidget *view); - DDockWindow::Position dockWidgetPosition(QWidget *view); + bool hasDockWidget(TQWidget *view); + DDockWindow::Position dockWidgetPosition(TQWidget *view); public slots: DTabWidget *splitHorizontal(); @@ -69,17 +70,17 @@ protected slots: virtual void closeTab(); /**This does nothing. Reimplement in subclass to close the tab when hover close button is pressed.*/ - virtual void closeTab(QWidget*); + virtual void closeTab(TQWidget*); /**This does nothing. Reimplement in subclass to show tab context menu.*/ - virtual void tabContext(QWidget*,const QPoint &); + virtual void tabContext(TQWidget*,const TQPoint &); void widgetDestroyed(); signals: - void widgetChanged(QWidget *); + void widgetChanged(TQWidget *); protected: - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(TQObject *obj, TQEvent *ev); virtual void loadSettings(); @@ -90,23 +91,23 @@ protected: DDockWindow *m_rightDock; DDockWindow *m_bottomDock; - QMap m_docks; + TQMap m_docks; Ideal::DockSplitter *m_central; DTabWidget *m_activeTabWidget; - QValueList m_tabs; + TQValueList m_tabs; bool m_openTabAfterCurrent; bool m_showIconsOnTabs; bool m_firstRemoved; - QValueList m_widgets; - QMap m_widgetTabs; - QWidget *m_currentWidget; + TQValueList m_widgets; + TQMap m_widgetTabs; + TQWidget *m_currentWidget; private slots: - void invalidateActiveTabWidget(); + void tqinvalidateActiveTabWidget(); }; diff --git a/apps/ktorrent/newui/docksplitter.cpp b/apps/ktorrent/newui/docksplitter.cpp index 46212f6..b41a5b1 100644 --- a/apps/ktorrent/newui/docksplitter.cpp +++ b/apps/ktorrent/newui/docksplitter.cpp @@ -23,16 +23,16 @@ namespace Ideal { -DockSplitter::DockSplitter(Orientation orientation, QWidget *parent, const char *name) - :QSplitter(parent, name), m_orientation(orientation) +DockSplitter::DockSplitter(Qt::Orientation orientation, TQWidget *tqparent, const char *name) + :TQSplitter(tqparent, name), m_orientation(orientation) { switch (m_orientation) { - case Horizontal: - setOrientation(Vertical); + case Qt::Horizontal: + setOrientation(Qt::Vertical); break; - case Vertical: - setOrientation(Horizontal); + case Qt::Vertical: + setOrientation(Qt::Horizontal); break; } setOpaqueResize(true); @@ -43,11 +43,11 @@ DockSplitter::~DockSplitter() { } -void DockSplitter::addDock(uint row, uint col, QWidget *dock) +void DockSplitter::addDock(uint row, uint col, TQWidget *dock) { if (m_docks.count() <= row) for (uint i = m_docks.count(); i <= row ; ++i) - m_docks.append(QValueList()); + m_docks.append(TQValueList()); if (m_docks[row].count() <= col) { @@ -62,9 +62,9 @@ void DockSplitter::addDock(uint row, uint col, QWidget *dock) if (m_splitters.count() <= row) createSplitters(row); - QSplitter *splitter = m_splitters[row]; + TQSplitter *splitter = m_splitters[row]; - dock->reparent(splitter, QPoint(0,0), true); + dock->reparent(splitter, TQPoint(0,0), true); if (col < m_docks[row].count()-1) shiftWidgets(splitter, row, col+1); } @@ -73,11 +73,11 @@ void DockSplitter::appendSplitter() { switch (m_orientation) { - case Horizontal: - m_splitters.append(new QSplitter(Horizontal, this)); + case Qt::Horizontal: + m_splitters.append(new TQSplitter(Qt::Horizontal, this)); break; - case Vertical: - m_splitters.append(new QSplitter(Vertical, this)); + case Qt::Vertical: + m_splitters.append(new TQSplitter(Qt::Vertical, this)); break; } m_splitters[m_splitters.size()-1]->setOpaqueResize(true); @@ -99,7 +99,7 @@ void DockSplitter::removeDock(uint row, uint col, bool alsoDelete) if ((row >= m_docks.count()) || (col >= m_docks[row].count())) return; - QWidget *w = m_docks[row][col]; + TQWidget *w = m_docks[row][col]; m_docks[row].remove(m_docks[row].at(col)); if (alsoDelete) @@ -109,11 +109,11 @@ void DockSplitter::removeDock(uint row, uint col, bool alsoDelete) } else { - w->reparent(0, QPoint(0,0), false); + w->reparent(0, TQPoint(0,0), false); w->hide(); } - m_splitters[row]->setMinimumSize(m_splitters[row]->minimumSizeHint()); + m_splitters[row]->setMinimumSize(m_splitters[row]->tqminimumSizeHint()); if (isRowEmpty(row)) { @@ -134,7 +134,7 @@ bool DockSplitter::isRowEmpty(int row) return true; } -void DockSplitter::shiftWidgets(QSplitter *splitter, uint row, uint fromCol) +void DockSplitter::shiftWidgets(TQSplitter *splitter, uint row, uint fromCol) { kdDebug(9000) << "shiftWidgets: row=" << row << " from col=" << fromCol << endl; kdDebug(9000) << "row size is: " << m_docks[row].count() << endl; @@ -161,13 +161,13 @@ int DockSplitter::numCols(int row) const return 0; } -QPair DockSplitter::indexOf(QWidget *dock) +TQPair DockSplitter::indexOf(TQWidget *dock) { for (uint i = 0; i < m_docks.count(); ++i) for (uint j = 0; j < m_docks[i].count(); ++j) if (dock == m_docks[i][j]) - return qMakePair(i, j); - return qMakePair(0u, 0u); + return tqMakePair(i, j); + return tqMakePair(0u, 0u); } } diff --git a/apps/ktorrent/newui/docksplitter.h b/apps/ktorrent/newui/docksplitter.h index 214ad52..a9569d3 100644 --- a/apps/ktorrent/newui/docksplitter.h +++ b/apps/ktorrent/newui/docksplitter.h @@ -20,8 +20,8 @@ #ifndef IDEALDOCKSPLITTER_H #define IDEALDOCKSPLITTER_H -#include -#include +#include +#include namespace Ideal { @@ -30,16 +30,17 @@ class DockWidget; /** @short Splitter for docks */ -class DockSplitter: public QSplitter { +class DockSplitter: public TQSplitter { Q_OBJECT + TQ_OBJECT public: - DockSplitter(Orientation orientation, QWidget *parent = 0, const char *name = 0); + DockSplitter(Qt::Orientation orientation, TQWidget *tqparent = 0, const char *name = 0); ~DockSplitter(); - void addDock(uint row, uint col, QWidget *dock); + void addDock(uint row, uint col, TQWidget *dock); void removeDock(uint row, uint col, bool alsoDelete = false); - QPair indexOf(QWidget *dock); + TQPair indexOf(TQWidget *dock); int numRows() const; int numCols(int row) const; @@ -47,14 +48,14 @@ public: protected: void appendSplitter(); void createSplitters(uint index); - void shiftWidgets(QSplitter *splitter, uint row, uint fromCol); + void shiftWidgets(TQSplitter *splitter, uint row, uint fromCol); bool isRowEmpty(int row); private: - Orientation m_orientation; - QValueList m_splitters; - QValueList > m_docks; + Qt::Orientation m_orientation; + TQValueList m_splitters; + TQValueList > m_docks; }; } diff --git a/apps/ktorrent/newui/dtabwidget.cpp b/apps/ktorrent/newui/dtabwidget.cpp index 2bfd188..42fffd3 100644 --- a/apps/ktorrent/newui/dtabwidget.cpp +++ b/apps/ktorrent/newui/dtabwidget.cpp @@ -19,17 +19,17 @@ ***************************************************************************/ #include "dtabwidget.h" -#include -#include +#include +#include #include #include #include -DTabWidget::DTabWidget(QWidget *parent, const char *name) - :KTabWidget(parent, name), m_closeButton(0) +DTabWidget::DTabWidget(TQWidget *tqparent, const char *name) + :KTabWidget(tqparent, name), m_closeButton(0) { - setFocusPolicy(NoFocus); + setFocusPolicy(TQ_NoFocus); setMargin(0); loadSettings(); @@ -37,7 +37,7 @@ DTabWidget::DTabWidget(QWidget *parent, const char *name) if (!m_tabBarShown) tabBar()->hide(); else { - m_closeButton = new QToolButton(this); + m_closeButton = new TQToolButton(this); m_closeButton->setIconSet(SmallIconSet("tab_remove")); m_closeButton->adjustSize(); m_closeButton->hide(); @@ -49,8 +49,8 @@ DTabWidget::DTabWidget(QWidget *parent, const char *name) setTabReorderingEnabled(true); } - connect(this, SIGNAL(currentChanged(QWidget*)), this, SLOT(setFocus(QWidget*))); -// connect(this, SIGNAL(currentChanged(QWidget*)), this, SLOT(updateHistory(QWidget*))); + connect(this, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(setFocus(TQWidget*))); +// connect(this, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(updateHistory(TQWidget*))); } void DTabWidget::loadSettings() @@ -74,35 +74,35 @@ void DTabWidget::saveSettings() { } -QToolButton *DTabWidget::closeButton() const +TQToolButton *DTabWidget::closeButton() const { return m_closeButton; } -void DTabWidget::setFocus(QWidget *w) +void DTabWidget::setFocus(TQWidget *w) { if (w) w->setFocus(); } -void DTabWidget::insertTab(QWidget *child, const QString &label, int index) +void DTabWidget::insertTab(TQWidget *child, const TQString &label, int index) { if (m_closeButton && m_closeButtonShown) m_closeButton->show(); KTabWidget::insertTab(child, label, index); - if (index != -1) tabBar()->repaint(); + if (index != -1) tabBar()->tqrepaint(); } -void DTabWidget::insertTab(QWidget *child, const QIconSet &iconset, - const QString &label, int index) +void DTabWidget::insertTab(TQWidget *child, const TQIconSet &iconset, + const TQString &label, int index) { if (m_closeButton && m_closeButtonShown) m_closeButton->show(); KTabWidget::insertTab(child, iconset, label, index); - if (index != -1) tabBar()->repaint(); + if (index != -1) tabBar()->tqrepaint(); } -/*void DTabWidget::updateHistory(QWidget *w) +/*void DTabWidget::updateHistory(TQWidget *w) { if (m_history.top() != w) m_history.push(w); diff --git a/apps/ktorrent/newui/dtabwidget.h b/apps/ktorrent/newui/dtabwidget.h index 4f51e47..3fa3945 100644 --- a/apps/ktorrent/newui/dtabwidget.h +++ b/apps/ktorrent/newui/dtabwidget.h @@ -22,36 +22,37 @@ #include -class QToolButton; +class TQToolButton; class DTabWidget: public KTabWidget { Q_OBJECT + TQ_OBJECT public: - DTabWidget(QWidget *parent=0, const char *name=0); + DTabWidget(TQWidget *tqparent=0, const char *name=0); /**@return The close button at the top right corner. May be 0 if the configuration do not allow close buttons or the tabbar.*/ - QToolButton *closeButton() const; + TQToolButton *closeButton() const; - virtual void insertTab(QWidget *child, const QString &label, int index = -1 ); - virtual void insertTab(QWidget *child, const QIconSet &iconset, - const QString &label, int index = -1); + virtual void insertTab(TQWidget *child, const TQString &label, int index = -1 ); + virtual void insertTab(TQWidget *child, const TQIconSet &iconset, + const TQString &label, int index = -1); protected: virtual void loadSettings(); virtual void saveSettings(); private slots: - void setFocus(QWidget *w); -// void updateHistory(QWidget *w); + void setFocus(TQWidget *w); +// void updateHistory(TQWidget *w); private: bool m_tabBarShown; bool m_closeOnHover; bool m_closeButtonShown; - QToolButton *m_closeButton; -// QValueStack *m_history; + TQToolButton *m_closeButton; +// TQValueStack *m_history; }; diff --git a/apps/ktorrent/pastedialog.cpp b/apps/ktorrent/pastedialog.cpp index aa0095a..91587d5 100644 --- a/apps/ktorrent/pastedialog.cpp +++ b/apps/ktorrent/pastedialog.cpp @@ -22,19 +22,19 @@ #include "ktorrentcore.h" #include #include -#include -#include +#include +#include #include #include #include #include -PasteDialog::PasteDialog(KTorrentCore* core, QWidget *parent, const char *name) - :PasteDlgBase(parent, name) +PasteDialog::PasteDialog(KTorrentCore* core, TQWidget *tqparent, const char *name) + :PasteDlgBase(tqparent, name) { m_core = core; - QClipboard *cb = QApplication::clipboard(); - QString text = cb->text(QClipboard::Clipboard); + TQClipboard *cb = TQApplication::tqclipboard(); + TQString text = cb->text(TQClipboard::Clipboard); KURL url = KURL::fromPathOrURL(text); if ( url.isValid() ) m_url->setText(url.url()); @@ -49,7 +49,7 @@ void PasteDialog::btnOK_clicked() if ( url.isValid() ) { m_core->load(url); - QDialog::accept(); + TQDialog::accept(); } else { diff --git a/apps/ktorrent/pastedialog.h b/apps/ktorrent/pastedialog.h index 83b783d..e2699f1 100644 --- a/apps/ktorrent/pastedialog.h +++ b/apps/ktorrent/pastedialog.h @@ -31,11 +31,12 @@ class KTorrentCore; class PasteDialog: public PasteDlgBase { Q_OBJECT + TQ_OBJECT public slots: virtual void btnOK_clicked(); public: - PasteDialog(KTorrentCore* core, QWidget *parent = 0, const char *name = 0); + PasteDialog(KTorrentCore* core, TQWidget *tqparent = 0, const char *name = 0); private: KTorrentCore* m_core; diff --git a/apps/ktorrent/pastedlgbase.ui b/apps/ktorrent/pastedlgbase.ui index 0d3b813..15d4103 100644 --- a/apps/ktorrent/pastedlgbase.ui +++ b/apps/ktorrent/pastedlgbase.ui @@ -1,6 +1,6 @@ PasteDlgBase - + PasteDlgBase @@ -20,7 +20,7 @@ 0 - + 0 0 @@ -36,15 +36,15 @@ unnamed - + - layout2 + tqlayout2 unnamed - + textLabel1 @@ -64,7 +64,7 @@ 0 - + 400 0 @@ -73,9 +73,9 @@ - + - layout4 + tqlayout4 @@ -91,7 +91,7 @@ Expanding - + 297 20 @@ -132,10 +132,10 @@ reject() - + btnOK_clicked() - - + + klineedit.h diff --git a/apps/ktorrent/pref.cpp b/apps/ktorrent/pref.cpp index c1937f6..7bfdfbd 100644 --- a/apps/ktorrent/pref.cpp +++ b/apps/ktorrent/pref.cpp @@ -22,22 +22,22 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include #include "downloadpref.h" @@ -86,7 +86,7 @@ void KTorrentPreferences::slotOk() void KTorrentPreferences::slotApply() { validation_err = false; - QMap::iterator i = pages.begin(); + TQMap::iterator i = pages.begin(); while (i != pages.end()) { @@ -108,7 +108,7 @@ void KTorrentPreferences::slotApply() void KTorrentPreferences::updateData() { - QMap::iterator i = pages.begin(); + TQMap::iterator i = pages.begin(); while (i != pages.end()) { @@ -120,8 +120,8 @@ void KTorrentPreferences::updateData() void KTorrentPreferences::addPrefPage(kt::PrefPageInterface* prefInterface) { - QFrame* frame = addPage(prefInterface->getItemName(), prefInterface->getHeader(), prefInterface->getPixmap()); - QVBoxLayout* vbox = new QVBoxLayout(frame); + TQFrame* frame = addPage(prefInterface->getItemName(), prefInterface->getHeader(), prefInterface->getPixmap()); + TQVBoxLayout* vbox = new TQVBoxLayout(frame); vbox->setAutoAdd(true); prefInterface->createWidget(frame); @@ -130,10 +130,10 @@ void KTorrentPreferences::addPrefPage(kt::PrefPageInterface* prefInterface) void KTorrentPreferences::removePrefPage(kt::PrefPageInterface* pp) { - if (!pages.contains(pp)) + if (!pages.tqcontains(pp)) return; - QFrame* fr = pages[pp]; + TQFrame* fr = pages[pp]; pages.remove(pp); @@ -152,9 +152,9 @@ DownloadPrefPage::~ DownloadPrefPage() delete dp; } -void DownloadPrefPage::createWidget(QWidget* parent) +void DownloadPrefPage::createWidget(TQWidget* tqparent) { - dp = new DownloadPref(parent); + dp = new DownloadPref(tqparent); updateData(); } @@ -176,7 +176,7 @@ bool DownloadPrefPage::apply() if (Settings::dhtSupport() && dp->udp_tracker_port->value() == Settings::dhtPort()) { - QString msg = i18n("The DHT port needs to be different from the UDP tracker port!"); + TQString msg = i18n("The DHT port needs to be different from the UDP tracker port!"); KMessageBox::error(0, msg, i18n("Error")); return false; } @@ -222,16 +222,16 @@ GeneralPrefPage::~GeneralPrefPage() delete gp; } -void GeneralPrefPage::createWidget(QWidget* parent) +void GeneralPrefPage::createWidget(TQWidget* tqparent) { - gp = new GeneralPref(parent); + gp = new GeneralPref(tqparent); updateData(); - connect(gp->custom_ip_check, SIGNAL(toggled(bool)), - this, SLOT(customIPChecked(bool))); - connect(gp->use_dht, SIGNAL(toggled(bool)), - this, SLOT(dhtChecked(bool))); - connect(gp->use_encryption, SIGNAL(toggled(bool)), - this, SLOT(useEncryptionChecked(bool))); + connect(gp->custom_ip_check, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(customIPChecked(bool))); + connect(gp->use_dht, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(dhtChecked(bool))); + connect(gp->use_encryption, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(useEncryptionChecked(bool))); } bool GeneralPrefPage::apply() @@ -241,7 +241,7 @@ bool GeneralPrefPage::apply() Settings::setDownloadBandwidth(gp->downloadBandwidth->value()); Settings::setUploadBandwidth(gp->uploadBandwidth->value()); Settings::setShowPopups(gp->show_popups->isChecked()); - QString ourl = Settings::tempDir(); + TQString ourl = Settings::tempDir(); KURLRequester* u = gp->temp_dir; @@ -269,19 +269,19 @@ bool GeneralPrefPage::apply() bool useExternalIP = gp->custom_ip_check->isChecked(); Settings::setUseExternalIP(useExternalIP); - QString externalIP = gp->custom_ip->text(); + TQString externalIP = gp->custom_ip->text(); Settings::setExternalIP(externalIP); if (useExternalIP) { - KResolverResults res = KResolver::resolve(externalIP, QString::null); + KResolverResults res = KResolver::resolve(externalIP, TQString()); if (res.error()) { - QString err = KResolver::errorString(res.error()); - QString msg = i18n("Cannot lookup %1: %2\n" - "Please provide a valid IP address or hostname.").arg(externalIP).arg(err); + TQString err = KResolver::errorString(res.error()); + TQString msg = i18n("Cannot lookup %1: %2\n" + "Please provide a valid IP address or hostname.").tqarg(externalIP).tqarg(err); KMessageBox::error(0, msg, i18n("Error")); return false; } @@ -291,7 +291,7 @@ bool GeneralPrefPage::apply() if (gp->use_dht->isChecked() && gp->dht_port->value() == Settings::udpTrackerPort()) { - QString msg = i18n("The DHT port needs to be different from the UDP tracker port!"); + TQString msg = i18n("The DHT port needs to be different from the UDP tracker port!"); KMessageBox::error(0, msg, i18n("Error")); return false; } @@ -336,9 +336,9 @@ void GeneralPrefPage::updateData() KURLRequester* u = gp->temp_dir; u->fileDialog()->setMode(KFile::Directory); - if (Settings::tempDir() == QString::null) + if (Settings::tempDir() == TQString()) { - QString data_dir = KGlobal::dirs()->saveLocation("data", "ktorrent"); + TQString data_dir = KGlobal::dirs()->saveLocation("data", "ktorrent"); if (!data_dir.endsWith(bt::DirSeparator())) data_dir += bt::DirSeparator(); @@ -355,31 +355,31 @@ void GeneralPrefPage::updateData() u->fileDialog()->setMode(KFile::Directory); bool useSaveDir = Settings::useSaveDir(); - QString saveDir = Settings::saveDir(); + TQString saveDir = Settings::saveDir(); gp->autosave_downloads_check->setChecked(useSaveDir); u->setEnabled(useSaveDir); - u->setURL(!saveDir.isEmpty() ? saveDir : QDir::homeDirPath()); + u->setURL(!saveDir.isEmpty() ? saveDir : TQDir::homeDirPath()); //completed dir u = gp->urlCompletedDir; u->fileDialog()->setMode(KFile::Directory); bool useCompletedDir = Settings::useCompletedDir(); - QString completedDir = Settings::completedDir(); + TQString completedDir = Settings::completedDir(); gp->checkCompletedDir->setChecked(useCompletedDir); u->setEnabled(useCompletedDir); - u->setURL(!completedDir.isEmpty() ? completedDir : QDir::homeDirPath()); + u->setURL(!completedDir.isEmpty() ? completedDir : TQDir::homeDirPath()); //copy .torrent dir u = gp->urlTorrentDir; u->fileDialog()->setMode(KFile::Directory); bool useTorrentDir = Settings::useTorrentCopyDir(); - QString torrentDir = Settings::torrentCopyDir(); + TQString torrentDir = Settings::torrentCopyDir(); gp->checkTorrentDir->setChecked(useTorrentDir); u->setEnabled(useTorrentDir); - u->setURL(!torrentDir.isEmpty() ? torrentDir : QDir::homeDirPath()); + u->setURL(!torrentDir.isEmpty() ? torrentDir : TQDir::homeDirPath()); gp->custom_ip->setText(Settings::externalIP()); @@ -459,18 +459,18 @@ void AdvancedPrefPage::updateData() ap->max_con_setups->setValue(Settings::maxConnectingSockets()); } -void AdvancedPrefPage::createWidget(QWidget* parent) +void AdvancedPrefPage::createWidget(TQWidget* tqparent) { - ap = new AdvancedPref(parent); + ap = new AdvancedPref(tqparent); updateData(); - connect(ap->no_recheck, SIGNAL(toggled(bool)), - this, SLOT(noDataCheckChecked(bool))); - connect(ap->auto_recheck, SIGNAL(toggled(bool)), - this, SLOT(autoRecheckChecked(bool))); - connect(ap->do_not_use_kde_proxy, SIGNAL(toggled(bool)), - this, SLOT(doNotUseKDEProxyChecked(bool))); - connect(ap->prealloc_disabled,SIGNAL(toggled(bool)), - this,SLOT(preallocDisabledChecked(bool))); + connect(ap->no_recheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(noDataCheckChecked(bool))); + connect(ap->auto_recheck, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(autoRecheckChecked(bool))); + connect(ap->do_not_use_kde_proxy, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(doNotUseKDEProxyChecked(bool))); + connect(ap->prealloc_disabled,TQT_SIGNAL(toggled(bool)), + this,TQT_SLOT(preallocDisabledChecked(bool))); preallocDisabledChecked(ap->prealloc_disabled->isChecked()); } diff --git a/apps/ktorrent/pref.h b/apps/ktorrent/pref.h index f8852cd..b100595 100644 --- a/apps/ktorrent/pref.h +++ b/apps/ktorrent/pref.h @@ -23,8 +23,8 @@ #define _KTORRENTPREF_H_ #include -#include -#include +#include +#include #include @@ -32,7 +32,7 @@ class DownloadPref; class GeneralPref; class AdvancedPref; class KTorrent; -class QListViewItem; +class TQListViewItem; class DownloadPrefPage : public kt::PrefPageInterface @@ -44,13 +44,14 @@ public: virtual bool apply(); virtual void updateData(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void deleteWidget(); }; -class GeneralPrefPage : public QObject,public kt::PrefPageInterface +class GeneralPrefPage : public TQObject,public kt::PrefPageInterface { - Q_OBJECT + Q_OBJECT + TQ_OBJECT GeneralPref* gp; public: GeneralPrefPage(); @@ -58,7 +59,7 @@ public: virtual bool apply(); virtual void updateData(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void deleteWidget(); private slots: @@ -68,9 +69,10 @@ private slots: void useEncryptionChecked(bool on); }; -class AdvancedPrefPage : public QObject,public kt::PrefPageInterface +class AdvancedPrefPage : public TQObject,public kt::PrefPageInterface { Q_OBJECT + TQ_OBJECT AdvancedPref* ap; public: @@ -79,7 +81,7 @@ public: virtual bool apply(); virtual void updateData(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void deleteWidget(); private slots: @@ -93,6 +95,7 @@ private slots: class KTorrentPreferences : public KDialogBase { Q_OBJECT + TQ_OBJECT public: KTorrentPreferences(KTorrent & ktor); virtual ~KTorrentPreferences(); @@ -110,7 +113,7 @@ private: DownloadPrefPage* page_one; GeneralPrefPage* page_two; AdvancedPrefPage* page_three; - QMap pages; + TQMap pages; bool validation_err; }; diff --git a/apps/ktorrent/queuedialog.cpp b/apps/ktorrent/queuedialog.cpp index 11a7b95..2761770 100644 --- a/apps/ktorrent/queuedialog.cpp +++ b/apps/ktorrent/queuedialog.cpp @@ -22,15 +22,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,21 +44,21 @@ using namespace bt; using namespace kt; -QueueItem::QueueItem(kt::TorrentInterface* t, QListView* parent) - :QListViewItem(parent), tc(t) +QueueItem::QueueItem(kt::TorrentInterface* t, TQListView* tqparent) + :TQListViewItem(tqparent), tc(t) { setPriority(tc->getPriority()); - setText(0, QString(tc->getStats().torrent_name)); + setText(0, TQString(tc->getStats().torrent_name)); } -int QueueItem::compare(QListViewItem *i, int , bool ) const +int QueueItem::compare(TQListViewItem *i, int , bool ) const { QueueItem* it = (QueueItem*) i; if(it->getPriority() == torrentPriority) { const TorrentInterface* ti = it->getTC(); - QString name1 = tc->getStats().torrent_name; - QString name2 = ti->getStats().torrent_name; + TQString name1 = tc->getStats().torrent_name; + TQString name2 = ti->getStats().torrent_name; return name1.compare(name2); } @@ -80,23 +80,23 @@ void QueueItem::setTorrentPriority(int p) tc->setPriority(p); } -void QueueItem::paintCell(QPainter* p,const QColorGroup & cg,int column,int width,int align) +void QueueItem::paintCell(TQPainter* p,const TQColorGroup & cg,int column,int width,int align) { - QColorGroup colorGrp( cg ); - QColor txt = colorGrp.text(); + TQColorGroup colorGrp( cg ); + TQColor txt = colorGrp.text(); //if (column == 1) if(torrentPriority == 0) - colorGrp.setColor(QColorGroup::Text, Qt::gray); + colorGrp.setColor(TQColorGroup::Text, TQt::gray); else - colorGrp.setColor(QColorGroup::Text, txt); + colorGrp.setColor(TQColorGroup::Text, txt); - QListViewItem::paintCell(p,colorGrp,column,width,align); + TQListViewItem::paintCell(p,colorGrp,column,width,align); } -QueueDialog::QueueDialog(bt::QueueManager* qm, QWidget *parent, const char *name) - :QueueDlg(parent, name) +QueueDialog::QueueDialog(bt::QueueManager* qm, TQWidget *tqparent, const char *name) + :QueueDlg(tqparent, name) { KIconLoader* iload = KGlobal::iconLoader(); @@ -105,8 +105,8 @@ QueueDialog::QueueDialog(bt::QueueManager* qm, QWidget *parent, const char *name logo->setPixmap(iload->loadIcon("ktqueuemanager", KIcon::Desktop)); - connect(downloadList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(downloadList_currentChanged( QListViewItem* ))); - connect(seedList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(seedList_currentChanged( QListViewItem* ))); + connect(downloadList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(downloadList_currentChanged( TQListViewItem* ))); + connect(seedList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(seedList_currentChanged( TQListViewItem* ))); if(downloadList->firstChild()) downloadList->setCurrentItem(downloadList->firstChild()); @@ -119,11 +119,11 @@ QueueDialog::QueueDialog(bt::QueueManager* qm, QWidget *parent, const char *name this->qman = qm; - QPtrList::iterator it = qman->begin(); + TQPtrList::iterator it = qman->begin(); for( ; it != qman->end(); ++it) { TorrentInterface* tc = *it; - TorrentStatus ts = tc->getStats().status; + TorrenttqStatus ts = tc->getStats().status; if(ts == kt::SEEDING || ts == kt::DOWNLOAD_COMPLETE || ts == kt::SEEDING_COMPLETE || tc->getStats().completed) @@ -279,16 +279,16 @@ void QueueDialog::btnOk_clicked() this->close(); } -QListView* QueueDialog::getCurrentList() +TQListView* QueueDialog::getCurrentList() { return m_tabs->currentPageIndex() == 0 ? downloadList : seedList; } -void QueueDialog::downloadList_currentChanged(QListViewItem* item) +void QueueDialog::downloadList_currentChanged(TQListViewItem* item) { if(!item) { - dlStatus->clear(); + dltqStatus->clear(); dlTracker->clear(); dlRatio->clear(); dlDHT->clear(); @@ -298,18 +298,18 @@ void QueueDialog::downloadList_currentChanged(QListViewItem* item) const TorrentInterface* tc = ((QueueItem*)item)->getTC(); TorrentStats s = tc->getStats(); - dlStatus->setText(tc->statusToString()); + dltqStatus->setText(tc->statusToString()); dlTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL()); - dlRatio->setText(QString("%1").arg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); + dlRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); dlBytes->setText(BytesToString(s.bytes_left_to_download)); dlDHT->setText(s.priv_torrent ? i18n("No (private torrent)") : i18n("Yes")); } -void QueueDialog::seedList_currentChanged(QListViewItem* item) +void QueueDialog::seedList_currentChanged(TQListViewItem* item) { if(!item) { - ulStatus->clear(); + ultqStatus->clear(); ulTracker->clear(); ulRatio->clear(); ulDHT->clear(); @@ -319,9 +319,9 @@ void QueueDialog::seedList_currentChanged(QListViewItem* item) const TorrentInterface* tc = ((QueueItem*)item)->getTC(); TorrentStats s = tc->getStats(); - ulStatus->setText(tc->statusToString()); + ultqStatus->setText(tc->statusToString()); ulTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL()); - ulRatio->setText(QString("%1").arg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); + ulRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); ulBytes->setText(BytesToString(s.bytes_uploaded)); ulDHT->setText(s.priv_torrent ? i18n("No (private torrent)") : i18n("Yes")); } diff --git a/apps/ktorrent/queuedialog.h b/apps/ktorrent/queuedialog.h index e282867..c997556 100644 --- a/apps/ktorrent/queuedialog.h +++ b/apps/ktorrent/queuedialog.h @@ -17,24 +17,24 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QUEUEDIALOG_H -#define QUEUEDIALOG_H +#ifndef TQUEUEDIALOG_H +#define TQUEUEDIALOG_H #include "queuedlg.h" #include #include -#include -#include +#include +#include -class QueueItem: public QListViewItem +class QueueItem: public TQListViewItem { public: - QueueItem(kt::TorrentInterface* t, QListView* parent); + QueueItem(kt::TorrentInterface* t, TQListView* tqparent); int getPriority() { return torrentPriority; } void setPriority(int p); - int compare(QListViewItem *i, int col, bool ascending ) const; + int compare(TQListViewItem *i, int col, bool ascending ) const; void setTorrentPriority(int p); @@ -42,7 +42,7 @@ class QueueItem: public QListViewItem private: //void updatePriorities(QueueItem* to, bool from_end, int val); - void paintCell(QPainter* p,const QColorGroup & cg,int column,int width,int align); + void paintCell(TQPainter* p,const TQColorGroup & cg,int column,int width,int align); kt::TorrentInterface* tc; int torrentPriority; @@ -51,8 +51,9 @@ class QueueItem: public QListViewItem class QueueDialog: public QueueDlg { Q_OBJECT + TQ_OBJECT public: - QueueDialog(bt::QueueManager* qm, QWidget *parent = 0, const char *name = 0); + QueueDialog(bt::QueueManager* qm, TQWidget *tqparent = 0, const char *name = 0); public slots: virtual void btnMoveUp_clicked(); virtual void btnClose_clicked(); @@ -61,8 +62,8 @@ class QueueDialog: public QueueDlg virtual void btnEnqueue_clicked(); virtual void btnApply_clicked(); virtual void btnOk_clicked(); - virtual void seedList_currentChanged(QListViewItem*); - virtual void downloadList_currentChanged(QListViewItem*); + virtual void seedList_currentChanged(TQListViewItem*); + virtual void downloadList_currentChanged(TQListViewItem*); virtual void btnMoveBottom_clicked(); virtual void btnMoveTop_clicked(); @@ -75,7 +76,7 @@ class QueueDialog: public QueueDlg void writeQueue(); ///Gets the pointer to currently visible torrentList (download or seed) - QListView* getCurrentList(); + TQListView* getCurrentList(); bt::QueueManager* qman; }; diff --git a/apps/ktorrent/queuedlg.ui b/apps/ktorrent/queuedlg.ui index 3ffbe23..6c179be 100644 --- a/apps/ktorrent/queuedlg.ui +++ b/apps/ktorrent/queuedlg.ui @@ -1,6 +1,6 @@ QueueDlg - + QueueDlg @@ -19,11 +19,11 @@ unnamed - + m_tabs - + tab @@ -34,7 +34,7 @@ unnamed - + InfoDownload @@ -45,15 +45,15 @@ unnamed - + - layout25 + tqlayout25 unnamed - + textLabel3 @@ -66,10 +66,10 @@ - Status: + tqStatus: - + textLabel1 @@ -85,7 +85,7 @@ Tracker: - + textLabel1_4 @@ -93,7 +93,7 @@ DHT: - + textLabel4 @@ -109,7 +109,7 @@ Share ratio: - + textLabel2 @@ -119,17 +119,17 @@ - + - layout26 + tqlayout26 unnamed - + - dlStatus + dltqStatus @@ -143,7 +143,7 @@ - + dlDHT @@ -151,7 +151,7 @@ - + dlRatio @@ -159,7 +159,7 @@ - + dlBytes @@ -171,7 +171,7 @@ - + Torrent @@ -206,7 +206,7 @@ - + tab @@ -217,7 +217,7 @@ unnamed - + Torrent @@ -250,7 +250,7 @@ AllColumns - + InfoSeed @@ -261,15 +261,15 @@ unnamed - + - layout15 + tqlayout15 unnamed - + textLabel3_2 @@ -282,10 +282,10 @@ - Status: + tqStatus: - + textLabel1_2 @@ -301,7 +301,7 @@ Tracker: - + textLabel1_4_2 @@ -309,7 +309,7 @@ DHT: - + textLabel4_2 @@ -325,7 +325,7 @@ Share ratio: - + textLabel1_3 @@ -335,17 +335,17 @@ - + - layout27 + tqlayout27 unnamed - + - ulStatus + ultqStatus @@ -359,7 +359,7 @@ - + ulDHT @@ -367,7 +367,7 @@ - + ulRatio @@ -375,7 +375,7 @@ - + ulBytes @@ -390,17 +390,17 @@ - + - layout7 + tqlayout7 unnamed - + - layout49 + tqlayout49 @@ -416,14 +416,14 @@ Preferred - + 20 20 - + logo @@ -452,7 +452,7 @@ Preferred - + 40 20 @@ -471,14 +471,14 @@ Expanding - + 20 30 - + btnMoveUp @@ -486,7 +486,7 @@ M&ove up - + btnMoveDown @@ -504,14 +504,14 @@ Expanding - + 20 20 - + btnMoveTop @@ -522,7 +522,7 @@ - + btnMoveBottom @@ -540,14 +540,14 @@ Preferred - + 20 20 - + btnEnqueue @@ -555,7 +555,7 @@ &QM Controlled - + btnDequeue @@ -573,7 +573,7 @@ Expanding - + 20 20 @@ -649,15 +649,15 @@ downloadList - currentChanged(QListViewItem*) + currentChanged(TQListViewItem*) QueueDlg - downloadList_currentChanged(QListViewItem*) + downloadList_currentChanged(TQListViewItem*) seedList - currentChanged(QListViewItem*) + currentChanged(TQListViewItem*) QueueDlg - seedList_currentChanged(QListViewItem*) + seedList_currentChanged(TQListViewItem*) btnOk @@ -702,20 +702,20 @@ btnDequeue seedList - + btnMoveUp_clicked() btnMoveDown_clicked() btnEnqueue_clicked() btnDequeue_clicked() - downloadList_currentChanged(QListViewItem*) - seedList_currentChanged(QListViewItem*) + downloadList_currentChanged(TQListViewItem*) + seedList_currentChanged(TQListViewItem*) btnOk_clicked() btnApply_clicked() btnClose_clicked() btnMoveTop_clicked() btnMoveBottom_clicked() - - + + ksqueezedtextlabel.h ksqueezedtextlabel.h diff --git a/apps/ktorrent/scandialog.cpp b/apps/ktorrent/scandialog.cpp index cf04a47..ceabf53 100644 --- a/apps/ktorrent/scandialog.cpp +++ b/apps/ktorrent/scandialog.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include #include #include #include @@ -36,12 +36,12 @@ using namespace kt; ScanDialog::ScanDialog(KTorrentCore* core,bool auto_import, - QWidget* parent, const char* name, bool modal, WFlags fl) - : ScanDlgBase(parent,name, modal,fl),DataCheckerListener(auto_import),mutex(true),core(core) + TQWidget* tqparent, const char* name, bool modal, WFlags fl) + : ScanDlgBase(tqparent,name, modal,fl),DataCheckerListener(auto_import),mutex(true),core(core) { m_cancel->setGuiItem(KStdGuiItem::cancel()); - connect(m_cancel,SIGNAL(clicked()),this,SLOT(onCancelPressed())); - connect(&timer,SIGNAL(timeout()),this,SLOT(update())); + connect(m_cancel,TQT_SIGNAL(clicked()),this,TQT_SLOT(onCancelPressed())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(update())); tc = 0; silently = false; restart = false; @@ -67,14 +67,14 @@ void ScanDialog::scan() } catch (bt::Error & err) { - KMessageBox::error(0,i18n("Error scanning data: %1").arg(err.toString())); + KMessageBox::error(0,i18n("Error scanning data: %1").tqarg(err.toString())); } } void ScanDialog::execute(kt::TorrentInterface* tc,bool silently) { - m_torrent_label->setText(i18n("Scanning data of %1 :").arg(tc->getStats().torrent_name)); + m_torrent_label->setText(i18n("Scanning data of %1 :").tqarg(tc->getStats().torrent_name)); adjustSize(); m_cancel->setEnabled(true); this->silently = silently; @@ -103,7 +103,7 @@ void ScanDialog::execute(kt::TorrentInterface* tc,bool silently) void ScanDialog::finished() { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); scanning = false; timer.stop(); progress(100,100); @@ -127,8 +127,8 @@ void ScanDialog::finished() { // cancel now becomes a close button m_cancel->setGuiItem(KStdGuiItem::close()); - disconnect(m_cancel,SIGNAL(clicked()),this,SLOT(onCancelPressed())); - connect(m_cancel,SIGNAL(clicked()),this,SLOT(accept())); + disconnect(m_cancel,TQT_SIGNAL(clicked()),this,TQT_SLOT(onCancelPressed())); + connect(m_cancel,TQT_SIGNAL(clicked()),this,TQT_SLOT(accept())); } } else @@ -144,13 +144,13 @@ void ScanDialog::finished() } } - QDialog::reject(); + TQDialog::reject(); } } void ScanDialog::progress(bt::Uint32 num,bt::Uint32 total) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); num_chunks = num; total_chunks = total; @@ -158,16 +158,16 @@ void ScanDialog::progress(bt::Uint32 num,bt::Uint32 total) void ScanDialog::update() { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); m_progress->setTotalSteps(total_chunks); m_progress->setProgress(num_chunks); - m_chunks_found->setText(QString::number(num_downloaded)); - m_chunks_failed->setText(QString::number(num_failed)); + m_chunks_found->setText(TQString::number(num_downloaded)); + m_chunks_failed->setText(TQString::number(num_failed)); } void ScanDialog::status(bt::Uint32 failed,bt::Uint32 downloaded) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); num_failed = failed; num_downloaded = downloaded; } @@ -177,7 +177,7 @@ void ScanDialog::reject() if (scanning) stop(); else - QDialog::reject(); + TQDialog::reject(); } void ScanDialog::onCancelPressed() @@ -187,10 +187,10 @@ void ScanDialog::onCancelPressed() void ScanDialog::accept() { - QDialog::accept(); + TQDialog::accept(); } -void ScanDialog::closeEvent(QCloseEvent* e) +void ScanDialog::closeEvent(TQCloseEvent* e) { if (scanning) reject(); diff --git a/apps/ktorrent/scandialog.h b/apps/ktorrent/scandialog.h index 26271b8..bf1fe97 100644 --- a/apps/ktorrent/scandialog.h +++ b/apps/ktorrent/scandialog.h @@ -21,8 +21,8 @@ #ifndef SCANDIALOG_H #define SCANDIALOG_H -#include -#include +#include +#include #include #include "scandlgbase.h" @@ -37,8 +37,9 @@ class KTorrentCore; class ScanDialog : public ScanDlgBase, public bt::DataCheckerListener { Q_OBJECT + TQ_OBJECT public: - ScanDialog(KTorrentCore* core,bool auto_import,QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = WDestructiveClose ); + ScanDialog(KTorrentCore* core,bool auto_import,TQWidget* tqparent = 0, const char* name = 0, bool modal = false, WFlags fl = WDestructiveClose ); virtual ~ScanDialog(); /// Starts the scan thread @@ -55,7 +56,7 @@ protected: virtual void finished(); /// Handle the close event - virtual void closeEvent(QCloseEvent* e); + virtual void closeEvent(TQCloseEvent* e); protected slots: @@ -68,8 +69,8 @@ protected slots: private: kt::TorrentInterface* tc; - QMutex mutex; - QTimer timer; + TQMutex mutex; + TQTimer timer; bt::Uint32 num_chunks; bt::Uint32 total_chunks; bt::Uint32 num_downloaded; diff --git a/apps/ktorrent/scandlgbase.ui b/apps/ktorrent/scandlgbase.ui index 6a1b374..23e4b22 100644 --- a/apps/ktorrent/scandlgbase.ui +++ b/apps/ktorrent/scandlgbase.ui @@ -1,6 +1,6 @@ ScanDlgBase - + ScanDlgBase @@ -30,7 +30,7 @@ Minimum - + m_torrent_label @@ -38,23 +38,23 @@ Scanning data of torrent : - + - layout5 + tqlayout5 unnamed - + - layout3 + tqlayout3 unnamed - + textLabel2 @@ -62,7 +62,7 @@ Number of chunks found : - + textLabel3 @@ -72,19 +72,19 @@ - + - layout4 + tqlayout4 unnamed - + m_chunks_found - + 100 0 @@ -96,15 +96,15 @@ 0 - + AlignVCenter|AlignRight - + m_chunks_failed - + 100 0 @@ -119,7 +119,7 @@ 0 - + AlignVCenter|AlignRight @@ -146,9 +146,9 @@ Horizontal - + - layout8 + tqlayout8 @@ -164,7 +164,7 @@ Expanding - + 181 20 @@ -185,7 +185,7 @@ - + kprogress.h kpushbutton.h diff --git a/apps/ktorrent/speedlimitsdlg.cpp b/apps/ktorrent/speedlimitsdlg.cpp index d208b06..ad22a54 100644 --- a/apps/ktorrent/speedlimitsdlg.cpp +++ b/apps/ktorrent/speedlimitsdlg.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include #include #include #include @@ -30,10 +30,10 @@ using namespace bt; using namespace kt; -SpeedLimitsDlg::SpeedLimitsDlg(kt::TorrentInterface* ti,QWidget* parent, const char* name) - : SpeedLimitsDlgBase(parent,name,true,0),tor(ti) +SpeedLimitsDlg::SpeedLimitsDlg(kt::TorrentInterface* ti,TQWidget* tqparent, const char* name) + : SpeedLimitsDlgBase(tqparent,name,true,0),tor(ti) { - m_main_caption->setText(i18n("Speed limits for %1:").arg(tor->getStats().torrent_name)); + m_main_caption->setText(i18n("Speed limits for %1:").tqarg(tor->getStats().torrent_name)); Uint32 up,down; tor->getTrafficLimits(up,down); m_upload_rate->setValue(up / 1024); @@ -54,7 +54,7 @@ void SpeedLimitsDlg::accept() Uint32 up = m_upload_rate->value() * 1024; Uint32 down = m_download_rate->value() * 1024; tor->setTrafficLimits(up,down); - QDialog::accept(); + TQDialog::accept(); } diff --git a/apps/ktorrent/speedlimitsdlg.h b/apps/ktorrent/speedlimitsdlg.h index 3e31a4a..7f3c213 100644 --- a/apps/ktorrent/speedlimitsdlg.h +++ b/apps/ktorrent/speedlimitsdlg.h @@ -31,10 +31,11 @@ namespace kt class SpeedLimitsDlg : public SpeedLimitsDlgBase { Q_OBJECT + TQ_OBJECT kt::TorrentInterface* tor; public: - SpeedLimitsDlg(kt::TorrentInterface* ti,QWidget* parent = 0, const char* name = 0); + SpeedLimitsDlg(kt::TorrentInterface* ti,TQWidget* tqparent = 0, const char* name = 0); virtual ~SpeedLimitsDlg(); diff --git a/apps/ktorrent/speedlimitsdlgbase.ui b/apps/ktorrent/speedlimitsdlgbase.ui index cd1bbf4..9576f89 100644 --- a/apps/ktorrent/speedlimitsdlgbase.ui +++ b/apps/ktorrent/speedlimitsdlgbase.ui @@ -1,6 +1,6 @@ SpeedLimitsDlgBase - + SpeedLimitsDlgBase @@ -19,7 +19,7 @@ unnamed - + m_main_caption @@ -27,23 +27,23 @@ Set the speed limits for torrent - + - layout8 + tqlayout8 unnamed - + - layout7 + tqlayout7 unnamed - + textLabel2 @@ -51,7 +51,7 @@ Max upload rate: - + textLabel3 @@ -61,9 +61,9 @@ - + - layout5 + tqlayout5 @@ -81,15 +81,15 @@ - + - layout6 + tqlayout6 unnamed - + textLabel4 @@ -97,7 +97,7 @@ KB/s (0 is no limit) - + textLabel4_2 @@ -123,9 +123,9 @@ Horizontal - + - layout3 + tqlayout3 @@ -141,7 +141,7 @@ Expanding - + 121 20 @@ -184,7 +184,7 @@ accept() - + knuminput.h knuminput.h diff --git a/apps/ktorrent/torrentcreatordlg.cpp b/apps/ktorrent/torrentcreatordlg.cpp index d47086f..22b76d1 100644 --- a/apps/ktorrent/torrentcreatordlg.cpp +++ b/apps/ktorrent/torrentcreatordlg.cpp @@ -9,9 +9,9 @@ // Copyright: See COPYING file that comes with this distribution // // -#include -#include -#include +#include +#include +#include #include #include #include @@ -28,8 +28,8 @@ #include #include -TorrentCreatorDlg::TorrentCreatorDlg(KTorrentCore* core,QWidget *parent, const char *name) - :TorrentCreatorDlgBase(parent, name),core(core) +TorrentCreatorDlg::TorrentCreatorDlg(KTorrentCore* core,TQWidget *tqparent, const char *name) + :TorrentCreatorDlgBase(tqparent, name),core(core) { KURLRequester* r = m_file_or_dir; r->fileDialog()->setMode( @@ -38,15 +38,15 @@ TorrentCreatorDlg::TorrentCreatorDlg(KTorrentCore* core,QWidget *parent, const c KComboBox* cb = m_chunk_size; cb->setCurrentItem(3); - connect(m_create_btn,SIGNAL(clicked()),this,SLOT(onCreate())); - connect(m_cancel_btn,SIGNAL(clicked()),this,SLOT(reject())); + connect(m_create_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onCreate())); + connect(m_cancel_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject())); m_nodes->setHidden(true); - QMap n = bt::Globals::instance().getDHT().getClosestGoodNodes(10); + TQMap n = bt::Globals::instance().getDHT().getClosestGoodNodes(10); - for(QMap::iterator it = n.begin(); it!=n.end(); ++it) - new QListViewItem(m_nodeList, it.key(), QString("%1").arg(it.data())); + for(TQMap::iterator it = n.begin(); it!=n.end(); ++it) + new TQListViewItem(m_nodeList, it.key(), TQString("%1").tqarg(it.data())); } TorrentCreatorDlg::~TorrentCreatorDlg() @@ -68,7 +68,7 @@ void TorrentCreatorDlg::onCreate() if (eb->items().count() == 0 && !m_decentralized->isChecked()) { //errorMsg(i18n("You must add at least one tracker.")); - QString msg = i18n("You have not added a tracker, " + TQString msg = i18n("You have not added a tracker, " "are you sure you want to create this torrent ?"); if (KMessageBox::warningYesNo(this,msg) == KMessageBox::No) return; @@ -80,11 +80,11 @@ void TorrentCreatorDlg::onCreate() return; } - QString url = r->url(); + TQString url = r->url(); int chunk_size = cb->currentText().toInt(); - QString name = KURL::fromPathOrURL(r->url()).fileName(); + TQString name = KURL::fromPathOrURL(r->url()).fileName(); - QStringList trackers; + TQStringList trackers; if(m_decentralized->isChecked()) { @@ -94,8 +94,8 @@ void TorrentCreatorDlg::onCreate() else trackers = eb->items(); - QString s = KFileDialog::getSaveFileName( - QString::null,"*.torrent|" + i18n("Torrent Files (*.torrent)"), + TQString s = KFileDialog::getSaveFileName( + TQString(),"*.torrent|" + i18n("Torrent Files (*.torrent)"), 0,i18n("Choose File to Save Torrent")); if (s.isNull()) @@ -105,7 +105,7 @@ void TorrentCreatorDlg::onCreate() s += ".torrent"; KProgressDialog* dlg = new KProgressDialog(this,0); - dlg->setLabel(i18n("Creating %1...").arg(s)); + dlg->setLabel(i18n("Creating %1...").tqarg(s)); dlg->setModal(true); dlg->setAllowCancel(false); dlg->show(); @@ -120,14 +120,14 @@ void TorrentCreatorDlg::onCreate() accept(); } -void TorrentCreatorDlg::errorMsg(const QString & text) +void TorrentCreatorDlg::errorMsg(const TQString & text) { KMessageBox::error(this,text,i18n("Error")); } void TorrentCreatorDlg::btnRemoveNode_clicked() { - QListViewItem* item = m_nodeList->currentItem(); + TQListViewItem* item = m_nodeList->currentItem(); if(!item) return; @@ -136,15 +136,15 @@ void TorrentCreatorDlg::btnRemoveNode_clicked() void TorrentCreatorDlg::btnAddNode_clicked() { - new QListViewItem(m_nodeList, m_node->text(), QString("%1").arg(m_port->value())); + new TQListViewItem(m_nodeList, m_node->text(), TQString("%1").tqarg(m_port->value())); } -void TorrentCreatorDlg::m_nodeList_selectionChanged(QListViewItem*) +void TorrentCreatorDlg::m_nodeList_selectionChanged(TQListViewItem*) { btnRemoveNode->setEnabled(m_nodeList->selectedItem()!=0); } -void TorrentCreatorDlg::m_node_textChanged(const QString& txt) +void TorrentCreatorDlg::m_node_textChanged(const TQString& txt) { btnAddNode->setEnabled(!txt.isEmpty()); } diff --git a/apps/ktorrent/torrentcreatordlg.h b/apps/ktorrent/torrentcreatordlg.h index 3dec45d..cb3482c 100644 --- a/apps/ktorrent/torrentcreatordlg.h +++ b/apps/ktorrent/torrentcreatordlg.h @@ -19,18 +19,19 @@ class KTorrentCore; class TorrentCreatorDlg: public TorrentCreatorDlgBase { Q_OBJECT + TQ_OBJECT public: - TorrentCreatorDlg(KTorrentCore* core,QWidget *parent = 0, const char *name = 0); + TorrentCreatorDlg(KTorrentCore* core,TQWidget *tqparent = 0, const char *name = 0); virtual ~TorrentCreatorDlg(); public slots: void onCreate(); virtual void btnAddNode_clicked(); virtual void btnRemoveNode_clicked(); - virtual void m_nodeList_selectionChanged(QListViewItem*); - virtual void m_node_textChanged(const QString&); + virtual void m_nodeList_selectionChanged(TQListViewItem*); + virtual void m_node_textChanged(const TQString&); private: - void errorMsg(const QString & text); + void errorMsg(const TQString & text); private: KTorrentCore* core; diff --git a/apps/ktorrent/torrentcreatordlgbase.ui b/apps/ktorrent/torrentcreatordlgbase.ui index fb253f4..f11a4d9 100644 --- a/apps/ktorrent/torrentcreatordlgbase.ui +++ b/apps/ktorrent/torrentcreatordlgbase.ui @@ -1,6 +1,6 @@ TorrentCreatorDlgBase - + TorrentCreatorDlgBase @@ -22,15 +22,15 @@ unnamed - + - layout2 + tqlayout2 unnamed - + textLabel1 @@ -45,7 +45,7 @@ - + m_label1 @@ -53,7 +53,7 @@ You must add at least one tracker or node. - + groupBox1 @@ -64,15 +64,15 @@ unnamed - + - layout7 + tqlayout7 unnamed - + textLabel2 @@ -130,7 +130,7 @@ m_chunk_size - + textLabel3 @@ -148,7 +148,7 @@ Expanding - + 21 20 @@ -157,7 +157,7 @@ - + m_start_seeding @@ -168,7 +168,7 @@ true - + m_decentralized @@ -176,7 +176,7 @@ Decentrali&zed (DHT only) - + m_private @@ -186,15 +186,15 @@ - + - layout9 + tqlayout9 unnamed - + textLabel2_2 @@ -209,7 +209,7 @@ - + Layout1 @@ -233,14 +233,14 @@ Expanding - + 20 20 - + m_create_btn @@ -254,7 +254,7 @@ true - + m_cancel_btn @@ -275,7 +275,7 @@ Trackers - + m_nodes @@ -317,15 +317,15 @@ 27 - + - layout9 + tqlayout9 unnamed - + textLabel1_2 @@ -338,7 +338,7 @@ m_node - + textLabel1_2_2 @@ -372,7 +372,7 @@ Maximum - + 40 20 @@ -422,21 +422,21 @@ Expanding - + 20 40 - + textLabel1_3 NOTE: Some known good DHT nodes are already inserted. You should probably insert your own IP address and port too if you plan to seed this torrent. - + WordBreak|AlignVCenter @@ -489,9 +489,9 @@ m_nodeList - selectionChanged(QListViewItem*) + selectionChanged(TQListViewItem*) TorrentCreatorDlgBase - m_nodeList_selectionChanged(QListViewItem*) + m_nodeList_selectionChanged(TQListViewItem*) @@ -508,13 +508,13 @@ m_create_btn m_cancel_btn - + btnRemoveNode_clicked() btnAddNode_clicked() m_node_textChanged(const QString&) - m_nodeList_selectionChanged(QListViewItem*) - - + m_nodeList_selectionChanged(TQListViewItem*) + + kurlrequester.h klineedit.h diff --git a/apps/ktorrent/trayhoverpopup.cpp b/apps/ktorrent/trayhoverpopup.cpp index 196eb63..612944d 100644 --- a/apps/ktorrent/trayhoverpopup.cpp +++ b/apps/ktorrent/trayhoverpopup.cpp @@ -17,26 +17,26 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include "trayhoverpopup.h" using namespace bt; -TrayHoverPopup::TrayHoverPopup(const QPixmap & pix,QWidget *parent, const char *name ) - : KPassivePopup(KPassivePopup::Boxed,parent,name),pix(pix) +TrayHoverPopup::TrayHoverPopup(const TQPixmap & pix,TQWidget *tqparent, const char *name ) + : KPassivePopup(KPassivePopup::Boxed,tqparent,name),pix(pix) { setTimeout(0); setAutoDelete(false); - connect(&hover_timer,SIGNAL(timeout()),this,SLOT(onHoverTimeout())); - connect(&show_timer,SIGNAL(timeout()),this,SLOT(onShowTimeout())); + connect(&hover_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onHoverTimeout())); + connect(&show_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onShowTimeout())); create(); - setPalette(QToolTip::palette()); + setPalette(TQToolTip::palette()); setLineWidth(1); context_menu_shown = false; cursor_over_icon = false; @@ -96,39 +96,39 @@ void TrayHoverPopup::onShowTimeout() show(); } -void TrayHoverPopup::updateText(const QString & msg) +void TrayHoverPopup::updateText(const TQString & msg) { text->setText(msg); } void TrayHoverPopup::create() { - QVBox *vb = new QVBox(this); + TQVBox *vb = new TQVBox(this); vb->setSpacing(KDialog::spacingHint()); - QHBox *hb=0; + TQHBox *hb=0; if (!pix.isNull()) { - hb = new QHBox(vb); + hb = new TQHBox(vb); hb->setMargin(0); hb->setSpacing(KDialog::spacingHint()); - QLabel* pix_lbl = new QLabel(hb,"title_icon"); + TQLabel* pix_lbl = new TQLabel(hb,"title_icon"); pix_lbl->setPixmap(pix); - pix_lbl->setAlignment(AlignLeft); + pix_lbl->tqsetAlignment(AlignLeft); } - QLabel* title = new QLabel("KTorrent", hb ? hb : vb, "title_label" ); - QFont fnt = title->font(); + TQLabel* title = new TQLabel("KTorrent", hb ? hb : vb, "title_label" ); + TQFont fnt = title->font(); fnt.setBold( true ); title->setFont( fnt ); - title->setAlignment( Qt::AlignHCenter ); + title->tqsetAlignment( TQt::AlignHCenter ); if ( hb ) hb->setStretchFactor(title, 10 ); // enforce centering // text will be filled later - text = new QLabel( "Dummy", vb, "msg_label" ); - text->setAlignment( AlignLeft ); + text = new TQLabel( "Dummy", vb, "msg_label" ); + text->tqsetAlignment( AlignLeft ); setView(vb); } diff --git a/apps/ktorrent/trayhoverpopup.h b/apps/ktorrent/trayhoverpopup.h index 3da5985..de0ef04 100644 --- a/apps/ktorrent/trayhoverpopup.h +++ b/apps/ktorrent/trayhoverpopup.h @@ -20,11 +20,11 @@ #ifndef TRAYHOVERPOPUP_H #define TRAYHOVERPOPUP_H -#include +#include #include -class QLabel; -class QPixmap; +class TQLabel; +class TQPixmap; /** @author Joris Guisson @@ -34,8 +34,9 @@ class QPixmap; class TrayHoverPopup : public KPassivePopup { Q_OBJECT + TQ_OBJECT public: - TrayHoverPopup(const QPixmap & pix,QWidget *parent = 0, const char *name = 0 ); + TrayHoverPopup(const TQPixmap & pix,TQWidget *tqparent = 0, const char *name = 0 ); virtual ~TrayHoverPopup(); /// Cursor entered system tray icon @@ -45,7 +46,7 @@ public: void leaveEvent(); /// Update the text which is shown - void updateText(const QString & msg); + void updateText(const TQString & msg); public slots: void contextMenuAboutToShow(); @@ -60,10 +61,10 @@ private slots: private: - const QPixmap & pix; - QTimer hover_timer; - QTimer show_timer; - QLabel* text; + const TQPixmap & pix; + TQTimer hover_timer; + TQTimer show_timer; + TQLabel* text; bool context_menu_shown; bool cursor_over_icon; }; diff --git a/apps/ktorrent/trayicon.cpp b/apps/ktorrent/trayicon.cpp index e7cf9c5..f629268 100644 --- a/apps/ktorrent/trayicon.cpp +++ b/apps/ktorrent/trayicon.cpp @@ -23,7 +23,7 @@ #include #include "ktorrent.h" #include "trayicon.h" -#include +#include #include #include #include "ktorrentcore.h" @@ -36,76 +36,76 @@ using namespace bt; using namespace kt; -TrayIcon::TrayIcon( KTorrentCore* tc, QWidget *parent, const char *name) - : KSystemTray(parent, name) +TrayIcon::TrayIcon( KTorrentCore* tc, TQWidget *tqparent, const char *name) + : KSystemTray(tqparent, name) { m_core = tc; m_kt_pix = loadIcon("ktorrent"); setPixmap(m_kt_pix); - paint=new QPainter( this ); + paint=new TQPainter( this ); drawContents ( paint ); previousDownloadHeight=0; previousUploadHeight=0; m_hover_popup = new TrayHoverPopup(m_kt_pix,this); - connect(this,SIGNAL(quitSelected()),kapp,SLOT(quit())); - connect(m_core, SIGNAL(finished(kt::TorrentInterface* )), - this, SLOT(finished(kt::TorrentInterface* ))); - connect(m_core,SIGNAL(torrentStoppedByError(kt::TorrentInterface*, QString )), - this,SLOT(torrentStoppedByError(kt::TorrentInterface*, QString ))); - connect(m_core,SIGNAL(maxShareRatioReached( kt::TorrentInterface* )), - this,SLOT(maxShareRatioReached( kt::TorrentInterface* ))); - connect(m_core,SIGNAL(maxSeedTimeReached(kt::TorrentInterface*)), - this, SLOT(maxSeedTimeReached(kt::TorrentInterface*))); - connect(m_core,SIGNAL(corruptedData( kt::TorrentInterface* )), - this,SLOT(corruptedData( kt::TorrentInterface* ))); - connect(m_core, SIGNAL(queuingNotPossible( kt::TorrentInterface* )), - this, SLOT(queuingNotPossible( kt::TorrentInterface* ))); - connect(m_core,SIGNAL(canNotStart(kt::TorrentInterface*, kt::TorrentStartResponse)), - this,SLOT(canNotStart(kt::TorrentInterface*, kt::TorrentStartResponse))); - connect(m_core, SIGNAL(lowDiskSpace(kt::TorrentInterface*, bool)), - this, SLOT(lowDiskSpace(kt::TorrentInterface*, bool))); + connect(this,TQT_SIGNAL(quitSelected()),kapp,TQT_SLOT(quit())); + connect(m_core, TQT_SIGNAL(finished(kt::TorrentInterface* )), + this, TQT_SLOT(finished(kt::TorrentInterface* ))); + connect(m_core,TQT_SIGNAL(torrentStoppedByError(kt::TorrentInterface*, TQString )), + this,TQT_SLOT(torrentStoppedByError(kt::TorrentInterface*, TQString ))); + connect(m_core,TQT_SIGNAL(maxShareRatioReached( kt::TorrentInterface* )), + this,TQT_SLOT(maxShareRatioReached( kt::TorrentInterface* ))); + connect(m_core,TQT_SIGNAL(maxSeedTimeReached(kt::TorrentInterface*)), + this, TQT_SLOT(maxSeedTimeReached(kt::TorrentInterface*))); + connect(m_core,TQT_SIGNAL(corruptedData( kt::TorrentInterface* )), + this,TQT_SLOT(corruptedData( kt::TorrentInterface* ))); + connect(m_core, TQT_SIGNAL(queuingNotPossible( kt::TorrentInterface* )), + this, TQT_SLOT(queuingNotPossible( kt::TorrentInterface* ))); + connect(m_core,TQT_SIGNAL(canNotStart(kt::TorrentInterface*, kt::TorrentStartResponse)), + this,TQT_SLOT(canNotStart(kt::TorrentInterface*, kt::TorrentStartResponse))); + connect(m_core, TQT_SIGNAL(lowDiskSpace(kt::TorrentInterface*, bool)), + this, TQT_SLOT(lowDiskSpace(kt::TorrentInterface*, bool))); - connect(this->contextMenu(),SIGNAL(aboutToShow()),m_hover_popup,SLOT(contextMenuAboutToShow())); - connect(this->contextMenu(),SIGNAL(aboutToHide()),m_hover_popup,SLOT(contextMenuAboutToHide())); + connect(this->contextMenu(),TQT_SIGNAL(aboutToShow()),m_hover_popup,TQT_SLOT(contextMenuAboutToShow())); + connect(this->contextMenu(),TQT_SIGNAL(aboutToHide()),m_hover_popup,TQT_SLOT(contextMenuAboutToHide())); } TrayIcon::~TrayIcon() {} -void TrayIcon::enterEvent(QEvent* ev) +void TrayIcon::enterEvent(TQEvent* ev) { KSystemTray::enterEvent(ev); m_hover_popup->enterEvent(); } -void TrayIcon::leaveEvent(QEvent* ) +void TrayIcon::leaveEvent(TQEvent* ) { m_hover_popup->leaveEvent(); } void TrayIcon::updateStats(const CurrentStats stats, bool showBars,int downloadBandwidth, int uploadBandwidth ) { - QString tip = i18n("
Speed:
Download: %1Upload: %2
Transfer:
Download: %3Upload: %4
") - .arg(KBytesPerSecToString((double)stats.download_speed/1024.0)) - .arg(KBytesPerSecToString((double)stats.upload_speed/1024.0)) - .arg(BytesToString(stats.bytes_downloaded)) - .arg(BytesToString(stats.bytes_uploaded)); + TQString tip = i18n("
Speed:
Download: %1Upload: %2
Transfer:
Download: %3Upload: %4
") + .tqarg(KBytesPerSecToString((double)stats.download_speed/1024.0)) + .tqarg(KBytesPerSecToString((double)stats.upload_speed/1024.0)) + .tqarg(BytesToString(stats.bytes_downloaded)) + .tqarg(BytesToString(stats.bytes_uploaded)); m_hover_popup->updateText(tip); if(showBars) drawSpeedBar(stats.download_speed/1024,stats.upload_speed/1024, downloadBandwidth, uploadBandwidth); else if (previousDownloadHeight > 0 || previousUploadHeight > 0) { - repaint(); // clear the bars if they are disabled + tqrepaint(); // clear the bars if they are disabled previousDownloadHeight = previousUploadHeight = 0; } } void TrayIcon::drawSpeedBar(int downloadSpeed, int uploadSpeed, int downloadBandwidth, int uploadBandwidth ) { - //check if need repaint + //check if need tqrepaint if (uploadBandwidth == 0) uploadBandwidth = 1; if (downloadBandwidth == 0) @@ -116,10 +116,10 @@ void TrayIcon::drawSpeedBar(int downloadSpeed, int uploadSpeed, int downloadBand if(previousDownloadHeight==DownloadHeight && previousUploadHeight==UploadHeight) return; - repaint (); + tqrepaint (); - QBrush brushD(green); - QBrush brushU(red); + TQBrush brushD(green); + TQBrush brushU(red); paint->fillRect(0,pixmap()->height(),2,-DownloadHeight,brushD); paint->fillRect(pixmap()->width()-2,pixmap()->height(),2,-UploadHeight,brushU); @@ -127,10 +127,10 @@ void TrayIcon::drawSpeedBar(int downloadSpeed, int uploadSpeed, int downloadBand previousUploadHeight=UploadHeight; } -void TrayIcon::showPassivePopup(const QString & msg,const QString & title) +void TrayIcon::showPassivePopup(const TQString & msg,const TQString & title) { KPassivePopup* p = KPassivePopup::message(KPassivePopup::Boxed,title,msg,m_kt_pix, this); - p->setPalette(QToolTip::palette()); + p->setPalette(TQToolTip::palette()); p->setLineWidth(1); } @@ -144,11 +144,11 @@ void TrayIcon::finished(TorrentInterface* tc) double speed_up = (double)s.bytes_uploaded / 1024.0; double speed_down = (double)(s.bytes_downloaded - s.imported_bytes)/ 1024.0; - QString msg = i18n("%1 has completed downloading." + TQString msg = i18n("%1 has completed downloading." "
Average speed: %2 DL / %3 UL.") - .arg(s.torrent_name) - .arg(KBytesPerSecToString(speed_down / tc->getRunningTimeDL())) - .arg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); + .tqarg(s.torrent_name) + .tqarg(KBytesPerSecToString(speed_down / tc->getRunningTimeDL())) + .tqarg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); showPassivePopup(msg,i18n("Download completed")); } @@ -162,12 +162,12 @@ void TrayIcon::maxShareRatioReached(kt::TorrentInterface* tc) KLocale* loc = KGlobal::locale(); double speed_up = (double)s.bytes_uploaded / 1024.0; - QString msg = i18n("%1 has reached its maximum share ratio of %2 and has been stopped." + TQString msg = i18n("%1 has reached its maximum share ratio of %2 and has been stopped." "
Uploaded %3 at an average speed of %4.") - .arg(s.torrent_name) - .arg(loc->formatNumber(s.max_share_ratio,2)) - .arg(BytesToString(s.bytes_uploaded)) - .arg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); + .tqarg(s.torrent_name) + .tqarg(loc->formatNumber(s.max_share_ratio,2)) + .tqarg(BytesToString(s.bytes_uploaded)) + .tqarg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); showPassivePopup(msg,i18n("Seeding completed")); } @@ -181,24 +181,24 @@ void TrayIcon::maxSeedTimeReached(kt::TorrentInterface* tc) KLocale* loc = KGlobal::locale(); double speed_up = (double)s.bytes_uploaded / 1024.0; - QString msg = i18n("%1 has reached its maximum seed time of %2 hours and has been stopped." + TQString msg = i18n("%1 has reached its maximum seed time of %2 hours and has been stopped." "
Uploaded %3 at an average speed of %4.") - .arg(s.torrent_name) - .arg(loc->formatNumber(s.max_seed_time,2)) - .arg(BytesToString(s.bytes_uploaded)) - .arg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); + .tqarg(s.torrent_name) + .tqarg(loc->formatNumber(s.max_seed_time,2)) + .tqarg(BytesToString(s.bytes_uploaded)) + .tqarg(KBytesPerSecToString(speed_up / tc->getRunningTimeUL())); showPassivePopup(msg,i18n("Seeding completed")); } -void TrayIcon::torrentStoppedByError(kt::TorrentInterface* tc, QString msg) +void TrayIcon::torrentStoppedByError(kt::TorrentInterface* tc, TQString msg) { if (!Settings::showPopups()) return; const TorrentStats & s = tc->getStats(); - QString err_msg = i18n("%1 has been stopped with the following error:
%2") - .arg(s.torrent_name).arg(msg); + TQString err_msg = i18n("%1 has been stopped with the following error:
%2") + .tqarg(s.torrent_name).tqarg(msg); showPassivePopup(err_msg,i18n("Error")); } @@ -209,9 +209,9 @@ void TrayIcon::corruptedData(kt::TorrentInterface* tc) return; const TorrentStats & s = tc->getStats(); - QString err_msg = i18n("Corrupted data has been found in the torrent %1" + TQString err_msg = i18n("Corrupted data has been found in the torrent %1" "
It would be a good idea to do a data integrity check on the torrent.") - .arg(s.torrent_name); + .tqarg(s.torrent_name); showPassivePopup(err_msg,i18n("Error")); } @@ -222,15 +222,15 @@ void TrayIcon::queuingNotPossible(kt::TorrentInterface* tc) const TorrentStats & s = tc->getStats(); - QString msg; + TQString msg; KLocale* loc = KGlobal::locale(); if (tc->overMaxRatio()) msg = i18n("%1 has reached its maximum share ratio of %2 and cannot be enqueued. Remove the limit manually if you want to continue seeding.") - .arg(s.torrent_name).arg(loc->formatNumber(s.max_share_ratio,2)); + .tqarg(s.torrent_name).tqarg(loc->formatNumber(s.max_share_ratio,2)); else msg = i18n("%1 has reached its maximum seed time of %2 hours and cannot be enqueued. Remove the limit manually if you want to continue seeding.") - .arg(s.torrent_name).arg(loc->formatNumber(s.max_seed_time,2)); + .tqarg(s.torrent_name).tqarg(loc->formatNumber(s.max_seed_time,2)); showPassivePopup(msg,i18n("Torrent cannot be enqueued.")); } @@ -240,10 +240,10 @@ void TrayIcon::canNotStart(kt::TorrentInterface* tc,kt::TorrentStartResponse rea if (!Settings::showPopups()) return; - QString msg = i18n("Cannot start %1 :
").arg(tc->getStats().torrent_name); + TQString msg = i18n("Cannot start %1 :
").tqarg(tc->getStats().torrent_name); switch (reason) { - case kt::QM_LIMITS_REACHED: + case kt::TQM_LIMITS_REACHED: if (tc->getStats().bytes_left_to_download == 0) { // is a seeder @@ -274,7 +274,7 @@ void TrayIcon::lowDiskSpace(kt::TorrentInterface * tc, bool stopped) const TorrentStats & s = tc->getStats(); - QString msg = i18n("Your disk is running out of space.
%1 is being downloaded to '%2'.").arg(s.torrent_name).arg(tc->getDataDir()); + TQString msg = i18n("Your disk is running out of space.
%1 is being downloaded to '%2'.").tqarg(s.torrent_name).tqarg(tc->getDataDir()); if(stopped) msg.prepend(i18n("Torrent has been stopped.
")); @@ -282,12 +282,12 @@ void TrayIcon::lowDiskSpace(kt::TorrentInterface * tc, bool stopped) showPassivePopup(msg,i18n("Device running out of space")); } -SetMaxRate::SetMaxRate( KTorrentCore* tc, int t, QWidget *parent, const char *name):KPopupMenu(parent, name) +SetMaxRate::SetMaxRate( KTorrentCore* tc, int t, TQWidget *tqparent, const char *name):KPopupMenu(tqparent, name) { m_core = tc; type=t; makeMenu(); - connect(this,SIGNAL(activated (int)),this,SLOT(rateSelected(int ))); + connect(this,TQT_SIGNAL(activated (int)),this,TQT_SLOT(rateSelected(int ))); } void SetMaxRate::makeMenu() { @@ -312,7 +312,7 @@ void SetMaxRate::makeMenu() for (int i = 0; i < 15; i++) { - QValueList valuePair; + TQValueList valuePair; if (delta == 0) valuePair.append(maxBandwidth); else @@ -335,10 +335,10 @@ void SetMaxRate::makeMenu() { if(rate == valuePair[j] && j==0) { - setItemChecked(insertItem(QString("%1").arg(valuePair[j]),-1, (j == 0) ? 2 : count()), true); + setItemChecked(insertItem(TQString("%1").tqarg(valuePair[j]),-1, (j == 0) ? 2 : count()), true); } else - insertItem(QString("%1").arg(valuePair[j]),-1, (j == 0) ? 2 : count()); + insertItem(TQString("%1").tqarg(valuePair[j]),-1, (j == 0) ? 2 : count()); } } @@ -355,8 +355,8 @@ void SetMaxRate::update() void SetMaxRate::rateSelected(int id) { int rate; - QString ratestr = text(id).remove('&'); - if (ratestr.contains(i18n("Unlimited"))) + TQString ratestr = text(id).remove('&'); + if (ratestr.tqcontains(i18n("Unlimited"))) rate = 0; else rate = ratestr.toInt(); diff --git a/apps/ktorrent/trayicon.h b/apps/ktorrent/trayicon.h index 0c1af44..f2cd579 100644 --- a/apps/ktorrent/trayicon.h +++ b/apps/ktorrent/trayicon.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "ktorrentcore.h" #include "settings.h" @@ -32,7 +32,7 @@ #include using namespace bt; -class QString; +class TQString; class TrayHoverPopup; struct TrayStats @@ -50,8 +50,9 @@ struct TrayStats class TrayIcon : public KSystemTray { Q_OBJECT + TQ_OBJECT public: - TrayIcon(KTorrentCore* tc, QWidget *parent = 0, const char *name = 0); + TrayIcon(KTorrentCore* tc, TQWidget *tqparent = 0, const char *name = 0); virtual ~TrayIcon(); /// Update stats for system tray icon @@ -59,9 +60,9 @@ public: private: void drawSpeedBar(int downloadSpeed, int uploadSpeed, int downloadBandwidth, int uploadBandwidth); - void showPassivePopup(const QString & msg,const QString & titile); - virtual void enterEvent(QEvent* ev); - virtual void leaveEvent(QEvent* ev); + void showPassivePopup(const TQString & msg,const TQString & titile); + virtual void enterEvent(TQEvent* ev); + virtual void leaveEvent(TQEvent* ev); private slots: /** @@ -87,7 +88,7 @@ private slots: * @param tc The torrent * @param msg Error message */ - void torrentStoppedByError(kt::TorrentInterface* tc, QString msg); + void torrentStoppedByError(kt::TorrentInterface* tc, TQString msg); /** * Corrupted data has been found. @@ -113,18 +114,19 @@ private slots: private: KTorrentCore* m_core; - QPainter *paint; + TQPainter *paint; int previousDownloadHeight; int previousUploadHeight; TrayHoverPopup* m_hover_popup; - QPixmap m_kt_pix; + TQPixmap m_kt_pix; }; class SetMaxRate : public KPopupMenu { Q_OBJECT + TQ_OBJECT public: - SetMaxRate(KTorrentCore* tc, int t, QWidget *parent=0, const char *name=0); // type: 0 Upload; 1 Download + SetMaxRate(KTorrentCore* tc, int t, TQWidget *tqparent=0, const char *name=0); // type: 0 Upload; 1 Download ~SetMaxRate() {} ; diff --git a/apps/ktorrent/viewmanager.cpp b/apps/ktorrent/viewmanager.cpp index 17c2782..917b68e 100644 --- a/apps/ktorrent/viewmanager.cpp +++ b/apps/ktorrent/viewmanager.cpp @@ -26,10 +26,10 @@ #include "ktorrentview.h" #include "ktorrent.h" -typedef QValueList::iterator ViewItr; +typedef TQValueList::iterator ViewItr; -ViewManager::ViewManager ( QObject *parent, const char *name ) - : QObject ( parent, name ),current(0) +ViewManager::ViewManager ( TQObject *tqparent, const char *name ) + : TQObject ( tqparent, name ),current(0) {} @@ -45,7 +45,7 @@ KTorrentView* ViewManager::newView() void ViewManager::saveViewState(KConfig* cfg) { - QStringList cv; + TQStringList cv; int idx = 0; for (ViewItr i = views.begin();i != views.end();i++) { @@ -58,17 +58,17 @@ void ViewManager::saveViewState(KConfig* cfg) void ViewManager::restoreViewState(KConfig* cfg,KTorrent* ktor) { - QStringList def; + TQStringList def; def.append(i18n("Downloads")); def.append(i18n("Uploads")); cfg->setGroup("ViewManager"); - QStringList to_load = cfg->readListEntry("current_views",def); + TQStringList to_load = cfg->readListEntry("current_views",def); if (to_load.empty()) to_load = def; - for (QStringList::iterator i = to_load.begin();i != to_load.end();i++) + for (TQStringList::iterator i = to_load.begin();i != to_load.end();i++) { ktor->openView(*i); } @@ -76,7 +76,7 @@ void ViewManager::restoreViewState(KConfig* cfg,KTorrent* ktor) if (views.count() == 0) { // no view open, so open default ones - for (QStringList::iterator i = def.begin();i != def.end();i++) + for (TQStringList::iterator i = def.begin();i != def.end();i++) ktor->openView(*i); } @@ -173,13 +173,13 @@ void ViewManager::checkDataIntegrity() current->checkDataIntegrity(); } -void ViewManager::getSelection(QValueList & sel) +void ViewManager::getSelection(TQValueList & sel) { if (current) current->getSelection(sel); } -void ViewManager::onCurrentTabChanged(QWidget* w) +void ViewManager::onCurrentTabChanged(TQWidget* w) { KTorrentView* old = current; current = 0; @@ -198,12 +198,12 @@ void ViewManager::onCurrentTabChanged(QWidget* w) } } -bool ViewManager::closeAllowed(QWidget* ) +bool ViewManager::closeAllowed(TQWidget* ) { return views.count() > 1; } -void ViewManager::tabCloseRequest(kt::GUIInterface* gui,QWidget* tab) +void ViewManager::tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab) { for (ViewItr i = views.begin();i != views.end();i++) { diff --git a/apps/ktorrent/viewmanager.h b/apps/ktorrent/viewmanager.h index d008c62..c9465d2 100644 --- a/apps/ktorrent/viewmanager.h +++ b/apps/ktorrent/viewmanager.h @@ -20,8 +20,8 @@ #ifndef VIEWMANAGER_H #define VIEWMANAGER_H -#include -#include +#include +#include #include class KConfig; @@ -32,11 +32,12 @@ class KTorrent; /** @author Joris Guisson */ -class ViewManager : public QObject, public kt::CloseTabListener +class ViewManager : public TQObject, public kt::CloseTabListener { Q_OBJECT + TQ_OBJECT public: - ViewManager(QObject *parent = 0, const char *name = 0); + ViewManager(TQObject *tqparent = 0, const char *name = 0); virtual ~ViewManager(); /// Create a new view @@ -73,13 +74,13 @@ public: * Put the current selection of the current view in a list. * @param sel The list to put it in */ - void getSelection(QValueList & sel); + void getSelection(TQValueList & sel); /// Get the current view KTorrentView* getCurrentView() {return current;} - virtual bool closeAllowed(QWidget* tab); - virtual void tabCloseRequest(kt::GUIInterface* gui,QWidget* tab); + virtual bool closeAllowed(TQWidget* tab); + virtual void tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab); /// A group was renamed, modify all view which where showing this group void groupRenamed(kt::Group* g,KTabWidget* mtw); @@ -104,10 +105,10 @@ public slots: void checkDataIntegrity(); /// The current tab has changed - void onCurrentTabChanged(QWidget* w); + void onCurrentTabChanged(TQWidget* w); private: - QValueList views; + TQValueList views; KTorrentView* current; }; diff --git a/apps/kttorinfo/main.cpp b/apps/kttorinfo/main.cpp index e33a763..2208f7f 100644 --- a/apps/kttorinfo/main.cpp +++ b/apps/kttorinfo/main.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ int main(int argc,char** argv) try { Torrent tor; - tor.load(argv[1],false); + tor.load(TQString(argv[1]),false); tor.debugPrintInfo(); } catch (Error & e) diff --git a/apps/ktupnptest/main.cpp b/apps/ktupnptest/main.cpp index c2629ef..c585f73 100644 --- a/apps/ktupnptest/main.cpp +++ b/apps/ktupnptest/main.cpp @@ -66,12 +66,12 @@ int main(int argc,char** argv) /* if (argc >= 2) { - kt::UPnPRouter router(QString::null,"http://foobar.com"); + kt::UPnPRouter router(TQString(),"http://foobar.com"); kt::UPnPDescriptionParser dp; if (!dp.parse(argv[1],&router)) { - Out() << "Cannot parse " << QString(argv[1]) << endl; + Out() << "Cannot parse " << TQString(argv[1]) << endl; } else { @@ -83,7 +83,7 @@ int main(int argc,char** argv) Out() << "Doing second test" << endl; UPnPMCastSocket mcast; - UPnPRouter* r = mcast.parseResponse(QCString(test_ps)); + UPnPRouter* r = mcast.parseResponse(TQCString(test_ps)); if (r) { Out() << "Succesfully parsed test_ps" << endl; diff --git a/apps/ktupnptest/mainwidget.ui b/apps/ktupnptest/mainwidget.ui index cb375f8..b3cce96 100644 --- a/apps/ktupnptest/mainwidget.ui +++ b/apps/ktupnptest/mainwidget.ui @@ -1,6 +1,6 @@ MainWidget - + MainWidget @@ -16,14 +16,14 @@ unnamed - + output - + - layout1 + tqlayout1 @@ -39,7 +39,7 @@ Expanding - + 61 20 @@ -68,7 +68,7 @@ - + kpushbutton.h kpushbutton.h diff --git a/apps/ktupnptest/upnptestapp.cpp b/apps/ktupnptest/upnptestapp.cpp index d50b314..1cb6d31 100644 --- a/apps/ktupnptest/upnptestapp.cpp +++ b/apps/ktupnptest/upnptestapp.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "upnptestapp.h" #include "mainwidget.h" @@ -29,15 +29,15 @@ using namespace bt; using namespace kt; -UPnPTestApp::UPnPTestApp(QWidget *parent, const char *name) - : KMainWindow(parent, name) +UPnPTestApp::UPnPTestApp(TQWidget *tqparent, const char *name) + : KMainWindow(tqparent, name) { sock = new UPnPMCastSocket(true); - connect(sock,SIGNAL(discovered( UPnPRouter* )),this,SLOT(discovered( UPnPRouter* ))); + connect(sock,TQT_SIGNAL(discovered( UPnPRouter* )),this,TQT_SLOT(discovered( UPnPRouter* ))); mwnd = new MainWidget(this); setCentralWidget(mwnd); - connect(mwnd->test_btn,SIGNAL(clicked()),this,SLOT(onTestBtn())); - connect(mwnd->close_btn,SIGNAL(clicked()),this,SLOT(onCloseBtn())); + connect(mwnd->test_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onTestBtn())); + connect(mwnd->close_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onCloseBtn())); bt::Log & lg = bt::Globals::instance().getLog(0); lg.addMonitor(this); Out() << "UPnPTestApp started up !" << endl; @@ -78,7 +78,7 @@ bool UPnPTestApp::queryExit() return true; } -void UPnPTestApp::message(const QString& line, unsigned int arg) +void UPnPTestApp::message(const TQString& line, unsigned int arg) { mwnd->output->append(line); } diff --git a/apps/ktupnptest/upnptestapp.h b/apps/ktupnptest/upnptestapp.h index 6554687..c98facf 100644 --- a/apps/ktupnptest/upnptestapp.h +++ b/apps/ktupnptest/upnptestapp.h @@ -38,11 +38,12 @@ using kt::UPnPRouter; class UPnPTestApp : public KMainWindow, public kt::LogMonitorInterface { Q_OBJECT + TQ_OBJECT public: - UPnPTestApp(QWidget *parent = 0, const char *name = 0); + UPnPTestApp(TQWidget *tqparent = 0, const char *name = 0); virtual ~UPnPTestApp(); - virtual void message(const QString& line, unsigned int arg); + virtual void message(const TQString& line, unsigned int arg); bool queryExit(); private slots: -- cgit v1.2.3