diff options
514 files changed, 7187 insertions, 7049 deletions
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<bt::Uint32>::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 <set> -#include <qstring.h> +#include <tqstring.h> #include <util/functions.h> 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<bt::Uint32> downloaded_chunks; std::set<bt::Uint32> failed_chunks; std::set<bt::Uint32> 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 <knuminput.h> #include <kmessagebox.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qregexp.h> -#include <qvalidator.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqvalidator.h> 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 <qobject.h> +#include <tqobject.h> #include <interfaces/peersource.h> 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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>AddPeerWidgetBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>AddPeerWidgetBase</cstring> </property> @@ -19,15 +19,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -43,7 +43,7 @@ <string>127.0.0.1</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -77,16 +77,16 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> @@ -149,10 +149,10 @@ <tabstop>m_port</tabstop> <tabstop>btnAdd</tabstop> </tabstops> -<slots> +<Q_SLOTS> <slot>btnAdd_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>knuminput.h</includehint> 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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>AdvancedPref</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AdvancedPref</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox4</cstring> </property> @@ -30,15 +30,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout15</cstring> + <cstring>tqlayout15</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_5</cstring> </property> @@ -53,7 +53,7 @@ <b>Moving average algorithm:</b> Moving average speed calculated from X samples</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>KTorrent</string> @@ -90,7 +90,7 @@ <b>Moving average algorithm:</b> Moving average speed calculated from X samples</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -108,7 +108,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>148</width> <height>20</height> @@ -117,7 +117,7 @@ </spacer> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>prealloc_disabled</cstring> </property> @@ -125,15 +125,15 @@ <string>Disa&ble diskspace preallocation</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout25</cstring> + <cstring>tqlayout25</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>full_prealloc</cstring> </property> @@ -141,7 +141,7 @@ <string>F&ully preallocate diskspace (avoids fragmentation)</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Basic (slow)</string> @@ -166,7 +166,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -177,15 +177,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -223,7 +223,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>111</width> <height>20</height> @@ -232,15 +232,15 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5_2</cstring> + <cstring>tqlayout5_2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -283,7 +283,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>111</width> <height>20</height> @@ -292,15 +292,15 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_6</cstring> </property> @@ -308,7 +308,7 @@ <string>Fast CPU</string> </property> </widget> - <widget class="QSlider"> + <widget class="TQSlider"> <property name="name"> <cstring>cpu_usage</cstring> </property> @@ -334,7 +334,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -346,7 +346,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -357,15 +357,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>no_recheck</cstring> </property> @@ -387,7 +387,7 @@ <number>8192</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -405,7 +405,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -414,15 +414,15 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>auto_recheck</cstring> </property> @@ -441,7 +441,7 @@ <number>1</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -459,7 +459,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>41</width> <height>20</height> @@ -470,7 +470,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -481,23 +481,23 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout33</cstring> + <cstring>tqlayout33</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout32</cstring> + <cstring>tqlayout32</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_7</cstring> </property> @@ -519,7 +519,7 @@ <number>200</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -553,7 +553,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>383</width> <height>20</height> @@ -562,7 +562,7 @@ </spacer> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>do_not_use_kde_proxy</cstring> </property> @@ -570,15 +570,15 @@ <string>Do not use the KDE pro&xy settings for HTTP tracker connections</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -601,7 +601,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>81</width> <height>20</height> @@ -622,7 +622,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>30</height> @@ -639,7 +639,7 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>kcombobox.h</includehint> 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<int> 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<int> 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<int> getFilePriorities(int tornumber) = 0; + virtual TQValueList<int> 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<int> intSettings() = 0; - virtual bool isBlockedIP(QString ip) = 0; - virtual void openTorrentSilentlyDir(const QString & file, const QString & savedir) = 0; + virtual TQValueList<int> 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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>DownloadPref</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>DownloadPref</cstring> </property> @@ -16,7 +16,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -27,31 +27,31 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout49</cstring> + <cstring>tqlayout49</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout42</cstring> + <cstring>tqlayout42</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout16</cstring> + <cstring>tqlayout16</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -69,7 +69,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -78,7 +78,7 @@ </spacer> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_5</cstring> </property> @@ -86,7 +86,7 @@ <string>Maximum seeds:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_8</cstring> </property> @@ -94,7 +94,7 @@ <string>Start download on low disk space :</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_9</cstring> </property> @@ -104,9 +104,9 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout46</cstring> + <cstring>tqlayout46</cstring> </property> <vbox> <property name="name"> @@ -134,7 +134,7 @@ <number>0</number> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Don't start</string> @@ -162,15 +162,15 @@ </sizepolicy> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout45</cstring> + <cstring>tqlayout45</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>intMinDiskSpace</cstring> </property> @@ -192,7 +192,7 @@ <number>100</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -212,23 +212,23 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout48</cstring> + <cstring>tqlayout48</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -246,7 +246,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>10</width> <height>20</height> @@ -255,7 +255,7 @@ </spacer> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_3</cstring> </property> @@ -273,7 +273,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>191</width> <height>20</height> @@ -290,7 +290,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>207</width> <height>20</height> @@ -303,7 +303,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -314,15 +314,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout42</cstring> + <cstring>tqlayout42</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -330,7 +330,7 @@ <string>Maximum download rate:</string> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -338,7 +338,7 @@ <string>Port:</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_7</cstring> </property> @@ -346,7 +346,7 @@ <string>Global connection limit:</string> </property> </widget> - <widget class="QLabel" row="8" column="0"> + <widget class="TQLabel" row="8" column="0"> <property name="name"> <cstring>textLabel2_3</cstring> </property> @@ -354,15 +354,15 @@ <string>Max seed time:</string> </property> </widget> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout18</cstring> + <cstring>tqlayout18</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -380,7 +380,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -389,15 +389,15 @@ </spacer> </hbox> </widget> - <widget class="QLabel" row="6" column="0"> + <widget class="TQLabel" row="6" column="0"> <property name="name"> <cstring>textLabel1_6</cstring> </property> <property name="text"> - <string>Number of upload slots:</string> + <string>Number of upload Q_SLOTS:</string> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -405,7 +405,7 @@ <string>UDP tracker port:</string> </property> </widget> - <widget class="QLabel" row="7" column="0"> + <widget class="TQLabel" row="7" column="0"> <property name="name"> <cstring>textLabel1_6_2</cstring> </property> @@ -413,7 +413,7 @@ <string>Max share ratio:</string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -423,9 +423,9 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout41</cstring> + <cstring>tqlayout41</cstring> </property> <vbox> <property name="name"> @@ -544,15 +544,15 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout40</cstring> + <cstring>tqlayout40</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_2</cstring> </property> @@ -560,7 +560,7 @@ <string>(0 is no limit)</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_2_2</cstring> </property> @@ -568,7 +568,7 @@ <string>(0 is no limit)</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -576,7 +576,7 @@ <string>KB/sec (0 is no limit)</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4_2</cstring> </property> @@ -594,7 +594,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>208</width> <height>20</height> @@ -611,7 +611,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>208</width> <height>20</height> @@ -628,14 +628,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>208</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_2_2_2</cstring> </property> @@ -643,7 +643,7 @@ <string>(0 is no limit)</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -655,7 +655,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>keep_seeding</cstring> </property> @@ -666,7 +666,7 @@ <bool>true</bool> </property> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -697,7 +697,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -708,7 +708,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> 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 <kmimetype.h> #include <kurl.h> -#include <qlabel.h> -#include <qstring.h> -#include <qbuttongroup.h> -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qdir.h> +#include <tqlabel.h> +#include <tqstring.h> +#include <tqbuttongroup.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqdir.h> #include <interfaces/torrentfileinterface.h> #include <interfaces/torrentinterface.h> @@ -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("<font color=\"#ff0000\">" + kt::BytesToString(-1*(long long)(bytes_free - bytes_to_download)) + i18n(" short!")); + lbltqStatus->setText("<font color=\"#ff0000\">" + 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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>FileSelectDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>FileSelectDlgBase</cstring> </property> @@ -19,15 +19,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="3"> + <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="3"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -42,23 +42,23 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="3"> + <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="3"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -74,14 +74,14 @@ <string>Group:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>m_cmbGroups</cstring> </property> </widget> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>m_chkUserControlled</cstring> </property> @@ -97,7 +97,7 @@ <string>&User controlled</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>m_chkStartTorrent</cstring> </property> @@ -121,7 +121,7 @@ </widget> </hbox> </widget> - <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="3"> + <widget class="TQButtonGroup" row="2" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>pnlFiles</cstring> </property> @@ -207,7 +207,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>135</height> @@ -216,7 +216,7 @@ </spacer> </grid> </widget> - <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="3"> + <widget class="TQGroupBox" row="3" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -237,22 +237,22 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout33</cstring> + <cstring>tqlayout33</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -260,7 +260,7 @@ <string>Required disk space:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -268,7 +268,7 @@ <string>Free disk space:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6</cstring> </property> @@ -278,27 +278,27 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout34</cstring> + <cstring>tqlayout34</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>lblRequired</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>lblFree</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> - <cstring>lblStatus</cstring> + <cstring>lbltqStatus</cstring> </property> </widget> </vbox> @@ -315,7 +315,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>220</width> <height>20</height> @@ -369,7 +369,7 @@ <tabstop>m_select_none</tabstop> <tabstop>m_invert_selection</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> 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 <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> #include <kdialog.h> #include <klocale.h> @@ -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 <qwidget.h> +#include <tqwidget.h> -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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>GeneralPref</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>GeneralPref</cstring> </property> @@ -29,14 +29,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>50</height> </size> </property> </spacer> - <widget class="QGroupBox" row="4" column="0"> + <widget class="TQGroupBox" row="4" column="0"> <property name="name"> <cstring>groupBox5</cstring> </property> @@ -50,7 +50,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>use_encryption</cstring> </property> @@ -64,7 +64,7 @@ <string>Protocol encryption is used to prevent ISP's from slowing down bittorrent connections.</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>allow_unencrypted</cstring> </property> @@ -77,7 +77,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox" row="3" column="0"> + <widget class="TQGroupBox" row="3" column="0"> <property name="name"> <cstring>groupBox4</cstring> </property> @@ -91,7 +91,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>use_dht</cstring> </property> @@ -102,15 +102,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>dht_port_label</cstring> </property> @@ -142,7 +142,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -153,7 +153,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox" row="2" column="0"> + <widget class="TQGroupBox" row="2" column="0"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -164,7 +164,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>custom_ip_check</cstring> </property> @@ -172,15 +172,15 @@ <string>Se&nd the tracker a custom IP address or hostname</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>custom_ip_label</cstring> </property> @@ -197,7 +197,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupBox3_2</cstring> </property> @@ -208,7 +208,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>show_systray_icon</cstring> </property> @@ -216,7 +216,7 @@ <string>Show s&ystem tray icon</string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>show_speedbar</cstring> </property> @@ -224,7 +224,7 @@ <string>Show speed &bar in tray icon</string> </property> </widget> - <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>show_popups</cstring> </property> @@ -235,15 +235,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1"> + <widget class="TQLayoutWidget" row="0" column="1" rowspan="2" colspan="1"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_3_2_2_2_2</cstring> </property> @@ -268,7 +268,7 @@ <number>500</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_3_2_2_2</cstring> </property> @@ -297,7 +297,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -308,15 +308,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout24</cstring> + <cstring>tqlayout24</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -334,7 +334,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>checkCompletedDir</cstring> </property> @@ -345,7 +345,7 @@ <string></string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>autosave_downloads_check</cstring> </property> @@ -353,9 +353,9 @@ <string>&Automatically save downloads to:</string> </property> </widget> - <widget class="QLayoutWidget" row="1" column="1" rowspan="3" colspan="1"> + <widget class="TQLayoutWidget" row="1" column="1" rowspan="3" colspan="1"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <vbox> <property name="name"> @@ -387,7 +387,7 @@ </widget> </vbox> </widget> - <widget class="QCheckBox" row="3" column="0"> + <widget class="TQCheckBox" row="3" column="0"> <property name="name"> <cstring>checkTorrentDir</cstring> </property> @@ -453,7 +453,7 @@ <tabstop>show_systray_icon</tabstop> </tabstops> <pixmapinproject/> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>klineedit.h</includehint> 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 <qstring.h> -#include <qpixmap.h> +#include <tqstring.h> +#include <tqpixmap.h> 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 <qstring.h> +#include <tqstring.h> #include <klocale.h> #include <util/ptrmap.h> @@ -35,9 +35,9 @@ namespace kt * * Manages all user created groups and the standard groups. */ - class GroupManager : public bt::PtrMap<QString,Group> + class GroupManager : public bt::PtrMap<TQString,Group> { - bt::PtrMap<QString,Group> default_groups; + bt::PtrMap<TQString,Group> 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 <kinputdialog.h> #include <kstandarddirs.h> #include <kpopupmenu.h> -#include <qheader.h> +#include <tqheader.h> #include <util/log.h> #include <interfaces/torrentinterface.h> #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<GroupViewItem*>(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<GroupViewItem*>(after); if (!li) return; - TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.find(li)); + TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.tqfind(li)); if (g) { - QValueList<TorrentInterface*> sel; + TQValueList<TorrentInterface*> sel; view->getSelection(sel); - QValueList<TorrentInterface*>::iterator i = sel.begin(); + TQValueList<TorrentInterface*>::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<GroupViewItem*,Group> 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 <qdragobject.h> +#include <tqdragobject.h> namespace kt { @@ -29,11 +29,12 @@ namespace kt /** @author Joris Guisson <[email protected]> */ - 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<TorrentInterface*>::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<TorrentInterface*> torrents; std::set<bt::SHA1Hash> 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 <util/log.h> #include <util/constants.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qregexp.h> -#include <qvalidator.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqvalidator.h> #include <klistview.h> #include <klineedit.h> @@ -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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>BlacklistWidgetBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>BlacklistWidgetBase</cstring> </property> @@ -22,18 +22,18 @@ <property name="resizeMode"> <enum>Minimum</enum> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> <property name="text"> <string>Note: Blacklist applies to current session only. Use save/open to save your entries or use IPFilter plugin (PeerGuardian).</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -73,22 +73,22 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -109,9 +109,9 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="0" column="1" rowspan="3" colspan="1"> + <widget class="TQLayoutWidget" row="0" column="1" rowspan="3" colspan="1"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <vbox> <property name="name"> @@ -144,7 +144,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -192,7 +192,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> @@ -234,7 +234,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>30</height> @@ -344,7 +344,7 @@ <tabstop>peerIP</tabstop> <tabstop>btnAdd</tabstop> </tabstops> -<slots> +<Q_SLOTS> <slot>btnAdd_clicked()</slot> <slot>btnRemove_clicked()</slot> <slot>btnClear_clicked()</slot> @@ -352,8 +352,8 @@ <slot>btnSave_clicked()</slot> <slot>btnOk_clicked()</slot> <slot>btnApply_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> <includehint>kpushbutton.h</includehint> 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 <qdragobject.h> -#include <qsplitter.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qtooltip.h> -#include <qtoolbutton.h> +#include <tqdragobject.h> +#include <tqsplitter.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqtoolbutton.h> #include <kglobal.h> #include <klocale.h> @@ -101,7 +101,7 @@ namespace kt { - QString DataDir(); + TQString DataDir(); } #include <util/profiler.h> @@ -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 <kapplication.h> #include <newui/dmainwindow.h> -#include <qtimer.h> +#include <tqtimer.h> #include <interfaces/guiinterface.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> 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<QWidget*,kt::CloseTabListener*> m_tab_map; + TQMap<TQWidget*,kt::CloseTabListener*> 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<KTorrent*>( mainWidget() ); + KTorrent *widget = ::tqqt_cast<KTorrent*>( 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 <unistd.h> -#include <qdir.h> +#include <tqdir.h> #include <klocale.h> #include <kglobal.h> #include <kfiledialog.h> @@ -29,7 +29,7 @@ #include <kapplication.h> #include <kio/job.h> #include <kio/netaccess.h> -#include <qregexp.h> +#include <tqregexp.h> #include <util/log.h> #include <torrent/torrentcontrol.h> @@ -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<kt::TorrentInterface> succes; + TQPtrList<kt::TorrentInterface> succes; - QPtrList<kt::TorrentInterface>::iterator i = qman->begin(); + TQPtrList<kt::TorrentInterface>::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<kt::TorrentInterface> & succes) +void KTorrentCore::rollback(const TQPtrList<kt::TorrentInterface> & succes) { Out() << "Error, rolling back" << endl; update_timer.stop(); - QPtrList<kt::TorrentInterface> ::const_iterator i = succes.begin(); + TQPtrList<kt::TorrentInterface> ::const_iterator i = succes.begin(); while (i != succes.end()) { (*i)->rollback(); @@ -690,7 +690,7 @@ void KTorrentCore::update() bt::UpdateCurrentTime(); AuthenticationMonitor::instance().update(); - QPtrList<kt::TorrentInterface>::iterator i = qman->begin(); + TQPtrList<kt::TorrentInterface>::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<kt::TorrentInterface>::iterator i = qman->begin(); i != qman->end(); ++i ) + for ( TQPtrList<kt::TorrentInterface>::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<TorrentInterface>::iterator i = qman->begin(); + TQPtrList<TorrentInterface>::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<int> KTorrentCore::getTorrentNumbers(int type = 3) +TQValueList<int> KTorrentCore::getTorrentNumbers(int type = 3) { - QValueList<int> tornums; - QPtrList<TorrentInterface>::iterator i = qman->begin(); + TQValueList<int> tornums; + TQPtrList<TorrentInterface>::iterator i = qman->begin(); while(i != qman->end()) { TorrentInterface* tc = *i; @@ -918,10 +918,10 @@ QValueList<int> 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<int> KTorrentCore::getFilePriorities(int tornumber) +TQValueList<int> KTorrentCore::getFilePriorities(int tornumber) { - QValueList<int> priorities; + TQValueList<int> 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 <qmap.h> -#include <qtimer.h> -#include <qcstring.h> +#include <tqmap.h> +#include <tqtimer.h> +#include <tqcstring.h> #include <util/constants.h> #include <interfaces/coreinterface.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> 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<int> getTorrentNumbers(int type); + TQValueList<int> getTorrentNumbers(int type); unsigned int getFileCount(int tornumber); QCStringList getFileNames(int tornumber); - QValueList<int> getFilePriorities(int tornumber); + TQValueList<int> 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<kt::TorrentInterface> & success); + void rollback(const TQPtrList<kt::TorrentInterface> & 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<KIO::Job*,KURL> custom_save_locations; // map to store save locations + TQMap<KIO::Job*,KURL> 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<int> KTorrentDCOP::getTorrentNumbers(int type) +TQValueList<int> 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<int> KTorrentDCOP::getFilePriorities(int tornumber) +TQValueList<int> 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<int> KTorrentDCOP::intSettings() +TQValueList<int> KTorrentDCOP::intSettings() { - QValueList<int> intsettings; + TQValueList<int> intsettings; intsettings.append(Settings::maxDownloads()); intsettings.append(Settings::maxSeeds()); intsettings.append(Settings::maxConnections()); @@ -241,12 +241,12 @@ QValueList<int> 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<int> getTorrentNumbers(int type = 3); + virtual TQValueList<int> getTorrentNumbers(int type = 3); virtual QCStringList getTorrentInfo(int tornumber); virtual int getFileCount(int tornumber); virtual QCStringList getInfo(); virtual QCStringList getFileNames(int tornumber); - virtual QValueList<int> getFilePriorities(int tornumber); + virtual TQValueList<int> 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<int> intSettings(); - virtual bool isBlockedIP(QString ip); - virtual void openTorrentSilentlyDir(const QString & file, const QString & savedir); + virtual TQValueList<int> 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 <groups/group.h> #include <groups/torrentdrag.h> -#include <qcursor.h> -#include <qheader.h> -#include <qvaluelist.h> -#include <qlayout.h> +#include <tqcursor.h> +#include <tqheader.h> +#include <tqvaluelist.h> +#include <tqlayout.h> #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<QMouseEvent *>(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<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<TorrentInterface*,KTorrentViewItem*>::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<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<TorrentInterface*,KTorrentViewItem*>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -346,7 +346,7 @@ void KTorrentView::startAllDownloads() void KTorrentView::stopAllDownloads() { - QMap<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); while (i != items.end()) { KTorrentViewItem* tvi = i.data(); @@ -360,8 +360,8 @@ void KTorrentView::stopAllDownloads() void KTorrentView::removeDownloads() { - QPtrList<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<KTorrentViewItem*>(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<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.find(tc); + TQMap<kt::TorrentInterface*,KTorrentViewItem*>::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<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<kt::TorrentInterface*,KTorrentViewItem*>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); + TQPtrList<TQListViewItem> 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<QListViewItem> sel = view->selectedItems(); + TQPtrList<TQListViewItem> sel = view->selectedItems(); if (sel.count() == 0) return 0; return new TorrentDrag(this); } -void KTorrentView::getSelection(QValueList<kt::TorrentInterface*> & sel) +void KTorrentView::getSelection(TQValueList<kt::TorrentInterface*> & sel) { - QPtrList<QListViewItem> s = view->selectedItems(); + TQPtrList<TQListViewItem> s = view->selectedItems(); if (s.count() == 0) return; - QPtrList<QListViewItem>::iterator i = s.begin(); + TQPtrList<TQListViewItem>::iterator i = s.begin(); while (i != s.end()) { KTorrentViewItem* kvi = (KTorrentViewItem*)*i; @@ -659,11 +659,11 @@ void KTorrentView::getSelection(QValueList<kt::TorrentInterface*> & sel) void KTorrentView::removeFromGroup() { - QPtrList<QListViewItem> s = view->selectedItems(); + TQPtrList<TQListViewItem> s = view->selectedItems(); if (s.count() == 0 || !current_group || current_group->isStandardGroup()) return; - QPtrList<QListViewItem>::iterator i = s.begin(); + TQPtrList<TQListViewItem>::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<QListViewItem> s = view->selectedItems(); + TQPtrList<TQListViewItem> s = view->selectedItems(); if (s.count() == 0 || !g) return; - QPtrList<QListViewItem>::iterator i = s.begin(); + TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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<QListViewItem> sel = view->selectedItems(); + TQPtrList<TQListViewItem> 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<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.begin(); + TQMap<kt::TorrentInterface*,KTorrentViewItem*>::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 <klistview.h> -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> 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<kt::TorrentInterface*> & sel); + void getSelection(TQValueList<kt::TorrentInterface*> & sel); /** * Add the current selection to a group. @@ -128,7 +129,7 @@ public: */ void setupViewColumns(); - QPtrList<QListViewItem> selectedItems() {return view->selectedItems();} + TQPtrList<TQListViewItem> 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<kt::TorrentInterface*,KTorrentViewItem*> items; + TQMap<kt::TorrentInterface*,KTorrentViewItem*> 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 <klocale.h> #include <kglobal.h> #include <interfaces/torrentinterface.h> -#include <qdatetime.h> -#include <qpainter.h> +#include <tqdatetime.h> +#include <tqpainter.h> #include <math.h> #include <interfaces/functions.h> #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<QListViewItem> sel = view->selectedItems(); - for (QPtrList<QListViewItem>::iterator itr = sel.begin(); itr != sel.end();itr++) + TQPtrList<TQListViewItem> sel = view->selectedItems(); + for (TQPtrList<TQListViewItem>::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 <qapplication.h> +#include <tqapplication.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -46,25 +46,25 @@ #include <util/fileops.h> #include <ktversion.h> #include <functions.h> -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> 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 <qpainter.h> -#include <qtooltip.h> -#include <qstyle.h> -#include <qapplication.h> -#include <qregexp.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqstyle.h> +#include <tqapplication.h> +#include <tqregexp.h> #include <kdebug.h> #include <kiconloader.h> @@ -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 <qpushbutton.h> -#include <qiconset.h> +#include <tqpushbutton.h> +#include <tqiconset.h> #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 <qlayout.h> +#include <tqlayout.h> #include <kdebug.h> #include <kconfig.h> @@ -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<uint> texts; + TQValueList<uint> 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<uint>::iterator it = texts.begin(); it != texts.end(); ++it) + for (TQValueList<uint>::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<uint> texts; + TQValueList<uint> 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<uint>::iterator it = texts.begin(); it != texts.end(); ++it, i++) + for (TQValueList<uint>::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 <qwidget.h> -#include <qvaluelist.h> +#include <tqwidget.h> +#include <tqvaluelist.h> #include "comdefs.h" -#include <qlayout.h> +#include <tqlayout.h> 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<Button*> ButtonList; + typedef TQValueList<Button*> 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 <qtoolbutton.h> -#include <qlayout.h> -#include <qstyle.h> -#include <qwidgetstack.h> -#include <qimage.h> -#include <qapplication.h> -#include <qpopupmenu.h> +#include <tqtoolbutton.h> +#include <tqlayout.h> +#include <tqstyle.h> +#include <tqwidgetstack.h> +#include <tqimage.h> +#include <tqapplication.h> +#include <tqpopupmenu.h> #include <kdebug.h> #include <kglobal.h> @@ -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<QPixmap*>(widget->icon()); + TQPixmap *pm = const_cast<TQPixmap*>(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<TQT_BASE_OBJECT_NAME*>(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<Ideal::Button*>( const_cast<QObject*>( sender() ) ); + m_lastContextMenuButton = static_cast<Ideal::Button*>( TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(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 <qdockwindow.h> -#include <qvaluelist.h> +#include <tqdockwindow.h> +#include <tqvaluelist.h> -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<Ideal::Button*, QWidget*> m_widgets; - QMap<QWidget*, Ideal::Button*> m_buttons; + TQMap<Ideal::Button*, TQWidget*> m_widgets; + TQMap<TQWidget*, Ideal::Button*> 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 <kconfig.h> #include <kiconloader.h> -#include <qtoolbutton.h> +#include <tqtoolbutton.h> #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<QWidget*>::iterator it = m_widgets.begin(); it != m_widgets.end(); ++it) +/* for (TQValueList<TQWidget*>::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<uint, uint> idx = m_central->indexOf(tab); + TQPair<uint, uint> 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<QWidget*>(const_cast<QObject*>(sender())); + TQWidget *w = TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(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<QWidget*, DDockWindow::Position> m_docks; + TQMap<TQWidget*, DDockWindow::Position> m_docks; Ideal::DockSplitter *m_central; DTabWidget *m_activeTabWidget; - QValueList<DTabWidget*> m_tabs; + TQValueList<DTabWidget*> m_tabs; bool m_openTabAfterCurrent; bool m_showIconsOnTabs; bool m_firstRemoved; - QValueList<QWidget*> m_widgets; - QMap<QWidget*, DTabWidget*> m_widgetTabs; - QWidget *m_currentWidget; + TQValueList<TQWidget*> m_widgets; + TQMap<TQWidget*, DTabWidget*> 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<QWidget*>()); + m_docks.append(TQValueList<TQWidget*>()); 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<uint, uint> DockSplitter::indexOf(QWidget *dock) +TQPair<uint, uint> 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 <qsplitter.h> -#include <qvaluelist.h> +#include <tqsplitter.h> +#include <tqvaluelist.h> 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<uint, uint> indexOf(QWidget *dock); + TQPair<uint, uint> 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<QSplitter*> m_splitters; - QValueList<QValueList<QWidget*> > m_docks; + Qt::Orientation m_orientation; + TQValueList<TQSplitter*> m_splitters; + TQValueList<TQValueList<TQWidget*> > 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 <qtoolbutton.h> -#include <qtabbar.h> +#include <tqtoolbutton.h> +#include <tqtabbar.h> #include <kconfig.h> #include <kiconloader.h> #include <kapplication.h> -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 <ktabwidget.h> -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<QWidget*> *m_history; + TQToolButton *m_closeButton; +// TQValueStack<TQWidget*> *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 <kpushbutton.h> #include <kstdguiitem.h> -#include <qclipboard.h> -#include <qapplication.h> +#include <tqclipboard.h> +#include <tqapplication.h> #include <kurl.h> #include <klineedit.h> #include <kmessagebox.h> #include <klocale.h> -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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>PasteDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>PasteDlgBase</cstring> </property> @@ -20,7 +20,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>0</height> @@ -36,15 +36,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -64,7 +64,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>400</width> <height>0</height> @@ -73,9 +73,9 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> @@ -91,7 +91,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>297</width> <height>20</height> @@ -132,10 +132,10 @@ <slot>reject()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnOK_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> </includehints> 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 <kactivelabel.h> #include <kglobal.h> #include <kcombobox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcheckbox.h> #include <knuminput.h> #include <kurlrequester.h> #include <kurl.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <klineedit.h> -#include <qlistview.h> +#include <tqlistview.h> #include <torrent/globals.h> #include <util/functions.h> #include <kglobal.h> #include <kiconloader.h> -#include <qdir.h> -#include <qslider.h> +#include <tqdir.h> +#include <tqslider.h> #include <kresolver.h> #include "downloadpref.h" @@ -86,7 +86,7 @@ void KTorrentPreferences::slotOk() void KTorrentPreferences::slotApply() { validation_err = false; - QMap<kt::PrefPageInterface*, QFrame*>::iterator i = pages.begin(); + TQMap<kt::PrefPageInterface*, TQFrame*>::iterator i = pages.begin(); while (i != pages.end()) { @@ -108,7 +108,7 @@ void KTorrentPreferences::slotApply() void KTorrentPreferences::updateData() { - QMap<kt::PrefPageInterface*, QFrame*>::iterator i = pages.begin(); + TQMap<kt::PrefPageInterface*, TQFrame*>::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 <kdialogbase.h> -#include <qframe.h> -#include <qmap.h> +#include <tqframe.h> +#include <tqmap.h> #include <interfaces/prefpageinterface.h> @@ -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<kt::PrefPageInterface*,QFrame*> pages; + TQMap<kt::PrefPageInterface*,TQFrame*> 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 <interfaces/functions.h> #include <torrent/queuemanager.h> -#include <qlistview.h> -#include <qstring.h> -#include <qmessagebox.h> -#include <qptrlist.h> -#include <qlabel.h> -#include <qtabwidget.h> -#include <qgroupbox.h> -#include <qpushbutton.h> -#include <qlayout.h> +#include <tqlistview.h> +#include <tqstring.h> +#include <tqmessagebox.h> +#include <tqptrlist.h> +#include <tqlabel.h> +#include <tqtabwidget.h> +#include <tqgroupbox.h> +#include <tqpushbutton.h> +#include <tqlayout.h> #include <klocale.h> #include <kglobal.h> @@ -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<kt::TorrentInterface>::iterator it = qman->begin(); + TQPtrList<kt::TorrentInterface>::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 <interfaces/torrentinterface.h> #include <torrent/queuemanager.h> -#include <qlistview.h> -#include <qstring.h> +#include <tqlistview.h> +#include <tqstring.h> -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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>QueueDlg</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>QueueDlg</cstring> </property> @@ -19,11 +19,11 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTabWidget" row="0" column="0"> + <widget class="TQTabWidget" row="0" column="0"> <property name="name"> <cstring>m_tabs</cstring> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -34,7 +34,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>InfoDownload</cstring> </property> @@ -45,15 +45,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout25</cstring> + <cstring>tqlayout25</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -66,10 +66,10 @@ </sizepolicy> </property> <property name="text"> - <string>Status:</string> + <string>tqStatus:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -85,7 +85,7 @@ <string>Tracker:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -93,7 +93,7 @@ <string>DHT:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -109,7 +109,7 @@ <string>Share ratio:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -119,17 +119,17 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout26</cstring> + <cstring>tqlayout26</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> - <cstring>dlStatus</cstring> + <cstring>dltqStatus</cstring> </property> <property name="text"> <string></string> @@ -143,7 +143,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>dlDHT</cstring> </property> @@ -151,7 +151,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>dlRatio</cstring> </property> @@ -159,7 +159,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>dlBytes</cstring> </property> @@ -171,7 +171,7 @@ </widget> </grid> </widget> - <widget class="QListView" row="0" column="0"> + <widget class="TQListView" row="0" column="0"> <column> <property name="text"> <string>Torrent</string> @@ -206,7 +206,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -217,7 +217,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QListView" row="0" column="0"> + <widget class="TQListView" row="0" column="0"> <column> <property name="text"> <string>Torrent</string> @@ -250,7 +250,7 @@ <enum>AllColumns</enum> </property> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>InfoSeed</cstring> </property> @@ -261,15 +261,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout15</cstring> + <cstring>tqlayout15</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -282,10 +282,10 @@ </sizepolicy> </property> <property name="text"> - <string>Status:</string> + <string>tqStatus:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -301,7 +301,7 @@ <string>Tracker:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4_2</cstring> </property> @@ -309,7 +309,7 @@ <string>DHT:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4_2</cstring> </property> @@ -325,7 +325,7 @@ <string>Share ratio:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -335,17 +335,17 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout27</cstring> + <cstring>tqlayout27</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> - <cstring>ulStatus</cstring> + <cstring>ultqStatus</cstring> </property> <property name="text"> <string></string> @@ -359,7 +359,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ulDHT</cstring> </property> @@ -367,7 +367,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ulRatio</cstring> </property> @@ -375,7 +375,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ulBytes</cstring> </property> @@ -390,17 +390,17 @@ </grid> </widget> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout49</cstring> + <cstring>tqlayout49</cstring> </property> <hbox> <property name="name"> @@ -416,14 +416,14 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>logo</cstring> </property> @@ -452,7 +452,7 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -471,14 +471,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>30</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnMoveUp</cstring> </property> @@ -486,7 +486,7 @@ <string>M&ove up</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnMoveDown</cstring> </property> @@ -504,14 +504,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnMoveTop</cstring> </property> @@ -522,7 +522,7 @@ <string></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnMoveBottom</cstring> </property> @@ -540,14 +540,14 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnEnqueue</cstring> </property> @@ -555,7 +555,7 @@ <string>&QM Controlled</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnDequeue</cstring> </property> @@ -573,7 +573,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -649,15 +649,15 @@ </connection> <connection> <sender>downloadList</sender> - <signal>currentChanged(QListViewItem*)</signal> + <signal>currentChanged(TQListViewItem*)</signal> <receiver>QueueDlg</receiver> - <slot>downloadList_currentChanged(QListViewItem*)</slot> + <slot>downloadList_currentChanged(TQListViewItem*)</slot> </connection> <connection> <sender>seedList</sender> - <signal>currentChanged(QListViewItem*)</signal> + <signal>currentChanged(TQListViewItem*)</signal> <receiver>QueueDlg</receiver> - <slot>seedList_currentChanged(QListViewItem*)</slot> + <slot>seedList_currentChanged(TQListViewItem*)</slot> </connection> <connection> <sender>btnOk</sender> @@ -702,20 +702,20 @@ <tabstop>btnDequeue</tabstop> <tabstop>seedList</tabstop> </tabstops> -<slots> +<Q_SLOTS> <slot>btnMoveUp_clicked()</slot> <slot>btnMoveDown_clicked()</slot> <slot>btnEnqueue_clicked()</slot> <slot>btnDequeue_clicked()</slot> - <slot>downloadList_currentChanged(QListViewItem*)</slot> - <slot>seedList_currentChanged(QListViewItem*)</slot> + <slot>downloadList_currentChanged(TQListViewItem*)</slot> + <slot>seedList_currentChanged(TQListViewItem*)</slot> <slot>btnOk_clicked()</slot> <slot>btnApply_clicked()</slot> <slot>btnClose_clicked()</slot> <slot>btnMoveTop_clicked()</slot> <slot>btnMoveBottom_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>ksqueezedtextlabel.h</includehint> <includehint>ksqueezedtextlabel.h</includehint> 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 <qlabel.h> +#include <tqlabel.h> #include <klocale.h> #include <kprogress.h> #include <kpushbutton.h> @@ -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 <b>%1</b> :").arg(tc->getStats().torrent_name)); + m_torrent_label->setText(i18n("Scanning data of <b>%1</b> :").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 <qmutex.h> -#include <qtimer.h> +#include <tqmutex.h> +#include <tqtimer.h> #include <datachecker/datacheckerlistener.h> #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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ScanDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>ScanDlgBase</cstring> </property> @@ -30,7 +30,7 @@ <property name="resizeMode"> <enum>Minimum</enum> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_torrent_label</cstring> </property> @@ -38,23 +38,23 @@ <string>Scanning data of torrent :</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -62,7 +62,7 @@ <string>Number of chunks found :</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -72,19 +72,19 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_found</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -96,15 +96,15 @@ <property name="text"> <string>0</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_failed</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -119,7 +119,7 @@ <property name="text"> <string>0</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -146,9 +146,9 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> @@ -164,7 +164,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>181</width> <height>20</height> @@ -185,7 +185,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kprogress.h</includehint> <includehint>kpushbutton.h</includehint> 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 <qlabel.h> +#include <tqlabel.h> #include <klocale.h> #include <knuminput.h> #include <kpushbutton.h> @@ -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 <b>%1</b>:").arg(tor->getStats().torrent_name)); + m_main_caption->setText(i18n("Speed limits for <b>%1</b>:").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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SpeedLimitsDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>SpeedLimitsDlgBase</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_main_caption</cstring> </property> @@ -27,23 +27,23 @@ <string>Set the speed limits for torrent</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -51,7 +51,7 @@ <string>Max upload rate:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -61,9 +61,9 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <vbox> <property name="name"> @@ -81,15 +81,15 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -97,7 +97,7 @@ <string>KB/s (0 is no limit)</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4_2</cstring> </property> @@ -123,9 +123,9 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -141,7 +141,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>121</width> <height>20</height> @@ -184,7 +184,7 @@ <slot>accept()</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> 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 <qcheckbox.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqcheckbox.h> +#include <tqstringlist.h> +#include <tqmap.h> #include <klocale.h> #include <kmessagebox.h> #include <kcombobox.h> @@ -28,8 +28,8 @@ #include <torrent/globals.h> #include <kademlia/dhtbase.h> -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<QString, int> n = bt::Globals::instance().getDHT().getClosestGoodNodes(10); + TQMap<TQString, int> n = bt::Globals::instance().getDHT().getClosestGoodNodes(10); - for(QMap<QString, int>::iterator it = n.begin(); it!=n.end(); ++it) - new QListViewItem(m_nodeList, it.key(), QString("%1").arg(it.data())); + for(TQMap<TQString, int>::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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>TorrentCreatorDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>TorrentCreatorDlgBase</cstring> </property> @@ -22,15 +22,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -45,7 +45,7 @@ </widget> </vbox> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>m_label1</cstring> </property> @@ -53,7 +53,7 @@ <string>You must add at least one tracker or node.</string> </property> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -64,15 +64,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -130,7 +130,7 @@ <cstring>m_chunk_size</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -148,7 +148,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>20</height> @@ -157,7 +157,7 @@ </spacer> </hbox> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>m_start_seeding</cstring> </property> @@ -168,7 +168,7 @@ <bool>true</bool> </property> </widget> - <widget class="QCheckBox" row="3" column="0"> + <widget class="TQCheckBox" row="3" column="0"> <property name="name"> <cstring>m_decentralized</cstring> </property> @@ -176,7 +176,7 @@ <string>Decentrali&zed (DHT only)</string> </property> </widget> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>m_private</cstring> </property> @@ -186,15 +186,15 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="5" column="0"> + <widget class="TQLayoutWidget" row="5" column="0"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -209,7 +209,7 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="6" column="0"> + <widget class="TQLayoutWidget" row="6" column="0"> <property name="name"> <cstring>Layout1</cstring> </property> @@ -233,14 +233,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>m_create_btn</cstring> </property> @@ -254,7 +254,7 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>m_cancel_btn</cstring> </property> @@ -275,7 +275,7 @@ <string>Trackers</string> </property> </widget> - <widget class="QGroupBox" row="4" column="0"> + <widget class="TQGroupBox" row="4" column="0"> <property name="name"> <cstring>m_nodes</cstring> </property> @@ -317,15 +317,15 @@ <number>27</number> </property> </widget> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -338,7 +338,7 @@ <cstring>m_node</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2_2</cstring> </property> @@ -372,7 +372,7 @@ <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -422,21 +422,21 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> </size> </property> </spacer> - <widget class="QLabel" row="4" column="0" rowspan="1" colspan="3"> + <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>textLabel1_3</cstring> </property> <property name="text"> <string>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.</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> @@ -489,9 +489,9 @@ </connection> <connection> <sender>m_nodeList</sender> - <signal>selectionChanged(QListViewItem*)</signal> + <signal>selectionChanged(TQListViewItem*)</signal> <receiver>TorrentCreatorDlgBase</receiver> - <slot>m_nodeList_selectionChanged(QListViewItem*)</slot> + <slot>m_nodeList_selectionChanged(TQListViewItem*)</slot> </connection> </connections> <tabstops> @@ -508,13 +508,13 @@ <tabstop>m_create_btn</tabstop> <tabstop>m_cancel_btn</tabstop> </tabstops> -<slots> +<Q_SLOTS> <slot>btnRemoveNode_clicked()</slot> <slot>btnAddNode_clicked()</slot> <slot>m_node_textChanged(const QString&)</slot> - <slot>m_nodeList_selectionChanged(QListViewItem*)</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> + <slot>m_nodeList_selectionChanged(TQListViewItem*)</slot> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> 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 <qvbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qtooltip.h> -#include <qpixmap.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqpixmap.h> #include <kdialog.h> #include <util/log.h> #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 <qtimer.h> +#include <tqtimer.h> #include <kpassivepopup.h> -class QLabel; -class QPixmap; +class TQLabel; +class TQPixmap; /** @author Joris Guisson <[email protected]> @@ -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 <kapplication.h> #include "ktorrent.h" #include "trayicon.h" -#include <qtooltip.h> +#include <tqtooltip.h> #include <kpassivepopup.h> #include <interfaces/torrentinterface.h> #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("<table cellpadding='2' cellspacing='2' align='center'><tr><td><b>Speed:</b></td><td></td></tr><tr><td>Download: <font color='#1c9a1c'>%1</font></td><td>Upload: <font color='#990000'>%2</font></td></tr><tr><td><b>Transfer:</b></td><td></td></tr><tr><td>Download: <font color='#1c9a1c'>%3</font></td><td>Upload: <font color='#990000'>%4</font></td></tr></table>") - .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("<table cellpadding='2' cellspacing='2' align='center'><tr><td><b>Speed:</b></td><td></td></tr><tr><td>Download: <font color='#1c9a1c'>%1</font></td><td>Upload: <font color='#990000'>%2</font></td></tr><tr><td><b>Transfer:</b></td><td></td></tr><tr><td>Download: <font color='#1c9a1c'>%3</font></td><td>Upload: <font color='#990000'>%4</font></td></tr></table>") + .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("<b>%1</b> has completed downloading." + TQString msg = i18n("<b>%1</b> has completed downloading." "<br>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("<b>%1</b> has reached its maximum share ratio of %2 and has been stopped." + TQString msg = i18n("<b>%1</b> has reached its maximum share ratio of %2 and has been stopped." "<br>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("<b>%1</b> has reached its maximum seed time of %2 hours and has been stopped." + TQString msg = i18n("<b>%1</b> has reached its maximum seed time of %2 hours and has been stopped." "<br>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("<b>%1</b> has been stopped with the following error: <br>%2") - .arg(s.torrent_name).arg(msg); + TQString err_msg = i18n("<b>%1</b> has been stopped with the following error: <br>%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 <b>%1</b>" + TQString err_msg = i18n("Corrupted data has been found in the torrent <b>%1</b>" "<br>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("<b>%1</b> 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("<b>%1</b> 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 <b>%1</b> : <br>").arg(tc->getStats().torrent_name); + TQString msg = i18n("Cannot start <b>%1</b> : <br>").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.<br /><b>%1</b> is being downloaded to '%2'.").arg(s.torrent_name).arg(tc->getDataDir()); + TQString msg = i18n("Your disk is running out of space.<br /><b>%1</b> is being downloaded to '%2'.").tqarg(s.torrent_name).tqarg(tc->getDataDir()); if(stopped) msg.prepend(i18n("Torrent has been stopped.<br />")); @@ -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<int> valuePair; + TQValueList<int> 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 <ksystemtray.h> #include <kpopupmenu.h> -#include <qpainter.h> +#include <tqpainter.h> #include "ktorrentcore.h" #include "settings.h" @@ -32,7 +32,7 @@ #include <util/constants.h> 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<KTorrentView*>::iterator ViewItr; +typedef TQValueList<KTorrentView*>::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<kt::TorrentInterface*> & sel) +void ViewManager::getSelection(TQValueList<kt::TorrentInterface*> & 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 <qobject.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqvaluelist.h> #include <interfaces/guiinterface.h> class KConfig; @@ -32,11 +32,12 @@ class KTorrent; /** @author Joris Guisson <[email protected]> */ -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<kt::TorrentInterface*> & sel); + void getSelection(TQValueList<kt::TorrentInterface*> & 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<KTorrentView*> views; + TQValueList<KTorrentView*> 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 <stdlib.h> -#include <qstring.h> +#include <tqstring.h> #include <util/log.h> #include <util/error.h> #include <torrent/globals.h> @@ -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 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>MainWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>MainWidget</cstring> </property> @@ -16,14 +16,14 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTextBrowser"> + <widget class="TQTextBrowser"> <property name="name"> <cstring>output</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> @@ -39,7 +39,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>61</width> <height>20</height> @@ -68,7 +68,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint> 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 <klocale.h> #include <kapplication.h> #include <kmessagebox.h> -#include <qtextbrowser.h> +#include <tqtextbrowser.h> #include <util/error.h> #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: diff --git a/estimation-scripts/enable-logging.diff b/estimation-scripts/enable-logging.diff index 57dc703..b199bca 100644 --- a/estimation-scripts/enable-logging.diff +++ b/estimation-scripts/enable-logging.diff @@ -16,8 +16,8 @@ Index: estimation-scripts/enable-logging.diff - using namespace bt; - -@@ -77,6 +78,9 @@ -- KTorrentViewItem::KTorrentViewItem(QListView* parent,bt::TorrentControl* tc) -- : KListViewItem(parent),tc(tc) +- KTorrentViewItem::KTorrentViewItem(QListView* tqparent,bt::TorrentControl* tc) +- : KListViewItem(tqparent),tc(tc) - { -+ toLog = true; -+ counter = 1; @@ -32,7 +32,7 @@ Index: estimation-scripts/enable-logging.diff -+ bool tmpLog = true; - /* - addColumn(i18n("File")); -- addColumn(i18n("Status")); +- addColumn(i18n("tqStatus")); -@@ -114,8 +119,43 @@ - setText(6,KBytesPerSecToString(tc->getUploadRate() / 1024.0)); - @@ -45,7 +45,7 @@ Index: estimation-scripts/enable-logging.diff -+ { -+ if(!started) -+ { --+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",ACTIVATED" << endl; +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",ACTIVATED" << endl; -+ tmpLog = false; -+ started = true; -+ toLog = true; @@ -56,7 +56,7 @@ Index: estimation-scripts/enable-logging.diff -+ { -+ if(started) -+ { --+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",DEACTIVATED" <<endl; +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",DEACTIVATED" <<endl; -+ tmpLog = false; -+ started = false; -+ } @@ -71,7 +71,7 @@ Index: estimation-scripts/enable-logging.diff - if (tc->getBytesLeft() == 0) - { -+ if(toLog && tmpLog) --+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << 0 << "," << tc->getNumPeers() << ",FINISHED" << endl; +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << 0 << "," << tc->getNumPeers() << ",FINISHED" << endl; -+ toLog = false; -+ - setText(7,i18n("finished")); @@ -83,13 +83,13 @@ Index: estimation-scripts/enable-logging.diff - if (tc->getDownloadRate() == 0) -+ { -+ if(toLog && tmpLog) --+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << 0 << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << 0 << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; - setText(7,i18n("infinity")); -+ } - else - { -+ if(toLog && tmpLog) --+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; -+ - Uint32 secs = (int)floor( (float)tc->getBytesLeft() / (float)tc->getDownloadRate() ); - QTime t; @@ -125,8 +125,8 @@ Index: apps/ktorrent/ktorrentviewitem.cpp using namespace kt; @@ -78,6 +81,9 @@ - KTorrentViewItem::KTorrentViewItem(QListView* parent,TorrentInterface* tc) - : KListViewItem(parent),tc(tc) + KTorrentViewItem::KTorrentViewItem(QListView* tqparent,TorrentInterface* tc) + : KListViewItem(tqparent),tc(tc) { + toLog = true; + counter = 1; @@ -141,7 +141,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp + bool tmpLog = true; /* addColumn(i18n("File")); - addColumn(i18n("Status")); + addColumn(i18n("tqStatus")); @@ -114,8 +121,46 @@ setText(6,KBytesPerSecToString(s.upload_rate / 1024.0)); @@ -155,7 +155,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp + { + if(!started) + { -+ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",ACTIVATED" << endl; ++ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",ACTIVATED" << endl; + tmpLog = false; + started = true; + toLog = true; @@ -166,7 +166,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp + { + if(started) + { -+ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",DEACTIVATED" <<endl; ++ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",DEACTIVATED" <<endl; + tmpLog = false; + started = false; + } @@ -182,7 +182,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp if (s.bytes_left == 0) { + if(toLog && tmpLog) -+ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << 0 << "," << s.num_peers << ",FINISHED" << endl; ++ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << 0 << "," << s.num_peers << ",FINISHED" << endl; + toLog = false; + + @@ -195,14 +195,14 @@ Index: apps/ktorrent/ktorrentviewitem.cpp if (s.download_rate == 0) + { + if(toLog && tmpLog) -+ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << 0 << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; ++ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << 0 << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; + setText(7,i18n("infinity")); + } else { + if(toLog && tmpLog) -+ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; ++ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; + Uint32 secs = (int)floor( (float)s.bytes_left / (float)s.download_rate); setText(7,DurationToString(secs)); diff --git a/libktorrent/datachecker/datachecker.h b/libktorrent/datachecker/datachecker.h index e181925..e038152 100644 --- a/libktorrent/datachecker/datachecker.h +++ b/libktorrent/datachecker/datachecker.h @@ -23,7 +23,7 @@ #include <util/bitset.h> #include "datacheckerlistener.h" -class QString; +class TQString; namespace bt @@ -54,7 +54,7 @@ namespace bt * @param tor The torrent * @param dnddir DND dir, optional argument if we know this */ - virtual void check(const QString & path,const Torrent & tor,const QString & dnddir) = 0; + virtual void check(const TQString & path,const Torrent & tor,const TQString & dnddir) = 0; /** * Get the BitSet representing all the downloaded chunks. diff --git a/libktorrent/datachecker/datacheckerthread.cpp b/libktorrent/datachecker/datacheckerthread.cpp index 12a58d7..fcbdf3d 100644 --- a/libktorrent/datachecker/datacheckerthread.cpp +++ b/libktorrent/datachecker/datacheckerthread.cpp @@ -27,9 +27,9 @@ namespace bt { DataCheckerThread::DataCheckerThread(DataChecker* dc, - const QString & path, + const TQString & path, const Torrent & tor, - const QString & dnddir) + const TQString & dnddir) : dc(dc),path(path),tor(tor),dnddir(dnddir) { running = true; diff --git a/libktorrent/datachecker/datacheckerthread.h b/libktorrent/datachecker/datacheckerthread.h index 749e3e8..207b245 100644 --- a/libktorrent/datachecker/datacheckerthread.h +++ b/libktorrent/datachecker/datacheckerthread.h @@ -20,7 +20,7 @@ #ifndef BTDATACHECKERTHREAD_H #define BTDATACHECKERTHREAD_H -#include <qthread.h> +#include <tqthread.h> namespace bt { @@ -32,16 +32,16 @@ namespace bt Thread which runs the data check. */ - class DataCheckerThread : public QThread + class DataCheckerThread : public TQThread { DataChecker* dc; - QString path; + TQString path; const Torrent & tor; - QString dnddir; + TQString dnddir; bool running; - QString error; + TQString error; public: - DataCheckerThread(DataChecker* dc,const QString & path,const Torrent & tor,const QString & dnddir); + DataCheckerThread(DataChecker* dc,const TQString & path,const Torrent & tor,const TQString & dnddir); virtual ~DataCheckerThread(); virtual void run(); @@ -53,7 +53,7 @@ namespace bt bool isRunning() const {return running;} /// Get the error (if any occured) - QString getError() const {return error;} + TQString getError() const {return error;} }; } diff --git a/libktorrent/datachecker/multidatachecker.cpp b/libktorrent/datachecker/multidatachecker.cpp index 3c26721..526fd08 100644 --- a/libktorrent/datachecker/multidatachecker.cpp +++ b/libktorrent/datachecker/multidatachecker.cpp @@ -45,7 +45,7 @@ namespace bt delete [] buf; } - void MultiDataChecker::check(const QString& path, const Torrent& tor,const QString & dnddir) + void MultiDataChecker::check(const TQString& path, const Torrent& tor,const TQString & dnddir) { Uint32 num_chunks = tor.getNumChunks(); // initialize the bitsets @@ -104,13 +104,13 @@ namespace bt const TorrentFile & tf, const Torrent & tor, Uint8* buf, - const QString & cache) + const TQString & cache) { File fptr; if (!fptr.open(cache + tf.getPath(), "rb")) { - Out() << QString("Warning : Cannot open %1 : %2").arg(cache + - tf.getPath()).arg(fptr.errorString()) << endl; + Out() << TQString("Warning : Cannot open %1 : %2").tqarg(cache + + tf.getPath()).tqarg(fptr.errorString()) << endl; return 0; } @@ -121,7 +121,7 @@ namespace bt bool MultiDataChecker::loadChunk(Uint32 ci,Uint32 cs,const Torrent & tor) { - QValueList<Uint32> tflist; + TQValueList<Uint32> tflist; tor.calcChunkPos(ci,tflist); // one file is simple @@ -183,8 +183,8 @@ namespace bt File fptr; if (!fptr.open(cache + f.getPath(), "rb")) { - Out() << QString("Warning : Cannot open %1 : %2").arg(cache + - f.getPath()).arg(fptr.errorString()) << endl; + Out() << TQString("Warning : Cannot open %1 : %2").tqarg(cache + + f.getPath()).tqarg(fptr.errorString()) << endl; return false; } else diff --git a/libktorrent/datachecker/multidatachecker.h b/libktorrent/datachecker/multidatachecker.h index d095e99..bb68a06 100644 --- a/libktorrent/datachecker/multidatachecker.h +++ b/libktorrent/datachecker/multidatachecker.h @@ -34,13 +34,13 @@ namespace bt MultiDataChecker(); virtual ~MultiDataChecker(); - virtual void check(const QString& path, const Torrent& tor,const QString & dnddir); + virtual void check(const TQString& path, const Torrent& tor,const TQString & dnddir); private: bool loadChunk(Uint32 ci,Uint32 cs,const Torrent & to); private: - QString cache; - QString dnd_dir; + TQString cache; + TQString dnd_dir; Uint8* buf; }; diff --git a/libktorrent/datachecker/singledatachecker.cpp b/libktorrent/datachecker/singledatachecker.cpp index 0579338..e086e90 100644 --- a/libktorrent/datachecker/singledatachecker.cpp +++ b/libktorrent/datachecker/singledatachecker.cpp @@ -39,7 +39,7 @@ namespace bt {} - void SingleDataChecker::check(const QString& path, const Torrent& tor,const QString &) + void SingleDataChecker::check(const TQString& path, const Torrent& tor,const TQString &) { // open the file Uint32 num_chunks = tor.getNumChunks(); @@ -48,7 +48,7 @@ namespace bt if (!fptr.open(path,"rb")) { throw Error(i18n("Cannot open file : %1 : %2") - .arg(path).arg( fptr.errorString())); + .tqarg(path).tqarg( fptr.errorString())); } // initialize the bitsets diff --git a/libktorrent/datachecker/singledatachecker.h b/libktorrent/datachecker/singledatachecker.h index 20107b3..3b86829 100644 --- a/libktorrent/datachecker/singledatachecker.h +++ b/libktorrent/datachecker/singledatachecker.h @@ -36,7 +36,7 @@ namespace bt SingleDataChecker(); virtual ~SingleDataChecker(); - virtual void check(const QString& path, const Torrent& tor,const QString & dnddir); + virtual void check(const TQString& path, const Torrent& tor,const TQString & dnddir); }; } diff --git a/libktorrent/expandablewidget.cpp b/libktorrent/expandablewidget.cpp index cdac376..8c06357 100644 --- a/libktorrent/expandablewidget.cpp +++ b/libktorrent/expandablewidget.cpp @@ -17,18 +17,18 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qlayout.h> -#include <qsplitter.h> +#include <tqlayout.h> +#include <tqsplitter.h> #include "expandablewidget.h" namespace kt { - ExpandableWidget::ExpandableWidget(QWidget* child,QWidget *parent, const char *name) - : QWidget(parent, name) + ExpandableWidget::ExpandableWidget(TQWidget* child,TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { - top_layout = new QHBoxLayout(this); - child->reparent(this,QPoint(),true); + top_layout = new TQHBoxLayout(this); + child->reparent(this,TQPoint(),true); // make top of stack begin = new StackElement; begin->w = child; @@ -45,7 +45,7 @@ namespace kt } } - void ExpandableWidget::expand(QWidget* w,Position pos) + void ExpandableWidget::expand(TQWidget* w,Position pos) { // create new element StackElement* se = new StackElement; @@ -53,45 +53,45 @@ namespace kt se->pos = pos; se->next = begin; - // remove old top from layout + // remove old top from tqlayout top_layout->remove(begin->w); // create new toplevel splitter Qt::Orientation orientation = (pos == RIGHT || pos == LEFT) ? Qt::Horizontal : Qt::Vertical; - QSplitter* s = new QSplitter(orientation,this);; + TQSplitter* s = new TQSplitter(orientation,this);; se->s = s; // reparent w and the bottom widget to s - w->reparent(s,QPoint(),false); + w->reparent(s,TQPoint(),false); if (begin->s) - begin->s->reparent(s,QPoint(),false); + begin->s->reparent(s,TQPoint(),false); else - begin->w->reparent(s,QPoint(),false); + begin->w->reparent(s,TQPoint(),false); // add w and the bottom widget to s if (pos == RIGHT || pos == ABOVE) { s->moveToFirst(w); - s->setResizeMode(w,QSplitter::KeepSize); + s->setResizeMode(w,TQSplitter::KeepSize); s->moveToLast(begin->s ? begin->s : begin->w); } else { s->moveToFirst(begin->s ? begin->s : begin->w); s->moveToLast(w); - s->setResizeMode(w,QSplitter::KeepSize); + s->setResizeMode(w,TQSplitter::KeepSize); } // make se new top of stack begin = se; - // add toplevel splitter to layout + // add toplevel splitter to tqlayout top_layout->add(s); // show s s->show(); } - void ExpandableWidget::remove(QWidget* w) + void ExpandableWidget::remove(TQWidget* w) { // find the correct stackelement StackElement* se = begin; @@ -111,21 +111,21 @@ namespace kt // we need to remove the first top_layout->remove(se->s); // reparent current top to 0 - se->w->reparent(0,QPoint(),false); - se->s->reparent(0,QPoint(),false); + se->w->reparent(0,TQPoint(),false); + se->s->reparent(0,TQPoint(),false); // set new top begin = se->next; if (begin->s) { - begin->s->reparent(this,QPoint(),false); + begin->s->reparent(this,TQPoint(),false); top_layout->add(begin->s); begin->s->show(); } else { - begin->w->reparent(this,QPoint(),false); + begin->w->reparent(this,TQPoint(),false); top_layout->add(begin->w); begin->w->show(); } @@ -143,29 +143,29 @@ namespace kt prev->next = next; // reparent se to 0 - se->s->reparent(0,QPoint(),false); - se->w->reparent(0,QPoint(),false); + se->s->reparent(0,TQPoint(),false); + se->w->reparent(0,TQPoint(),false); // reparent se->next to prev if (next->s) - next->s->reparent(prev->s,QPoint(),false); + next->s->reparent(prev->s,TQPoint(),false); else - next->w->reparent(prev->s,QPoint(),false); + next->w->reparent(prev->s,TQPoint(),false); // update prev's splitter if (prev->pos == RIGHT || prev->pos == ABOVE) { prev->s->moveToFirst(prev->w); - prev->s->setResizeMode(prev->w,QSplitter::KeepSize); + prev->s->setResizeMode(prev->w,TQSplitter::KeepSize); prev->s->moveToLast(next->s ? next->s : next->w); - prev->s->setResizeMode(next->s ? next->s : next->w,QSplitter::KeepSize); + prev->s->setResizeMode(next->s ? next->s : next->w,TQSplitter::KeepSize); } else { prev->s->moveToFirst(next->s ? next->s : next->w); - prev->s->setResizeMode(next->s ? next->s : next->w,QSplitter::KeepSize); + prev->s->setResizeMode(next->s ? next->s : next->w,TQSplitter::KeepSize); prev->s->moveToLast(prev->w); - prev->s->setResizeMode(prev->w,QSplitter::KeepSize); + prev->s->setResizeMode(prev->w,TQSplitter::KeepSize); } // delete se and splitter diff --git a/libktorrent/expandablewidget.h b/libktorrent/expandablewidget.h index 823ce5f..070f24f 100644 --- a/libktorrent/expandablewidget.h +++ b/libktorrent/expandablewidget.h @@ -20,12 +20,12 @@ #ifndef KTEXPANDABLEWIDGET_H #define KTEXPANDABLEWIDGET_H -#include <qwidget.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqptrlist.h> #include <interfaces/guiinterface.h> -class QSplitter; -class QHBoxLayout; +class TQSplitter; +class TQHBoxLayout; namespace kt { @@ -40,39 +40,40 @@ namespace kt * one child widget. It allows to add more widgets separating the new widget * and everything which was previously in the container by a separator. */ - class ExpandableWidget : public QWidget + class ExpandableWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** * Constructor, the first child must be provided. * @param child The first child - * @param parent The parent + * @param tqparent The tqparent * @param name The name */ - ExpandableWidget(QWidget* child,QWidget *parent = 0, const char *name = 0); + ExpandableWidget(TQWidget* child,TQWidget *tqparent = 0, const char *name = 0); virtual ~ExpandableWidget(); /** - * Expand the widget. This will ensure the proper parent child relations. + * Expand the widget. This will ensure the proper tqparent child relations. * @param w The widget * @param pos It's position relative to the current widget */ - void expand(QWidget* w,Position pos); + void expand(TQWidget* w,Position pos); /** - * Remove a widget. This will ensure the proper parent child relations. - * The widget w will become parentless. Note the first child will never be removed. + * Remove a widget. This will ensure the proper tqparent child relations. + * The widget w will become tqparentless. Note the first child will never be removed. * @param w The widget */ - void remove(QWidget* w); + void remove(TQWidget* w); private: struct StackElement { - QWidget* w; - QSplitter* s; + TQWidget* w; + TQSplitter* s; Position pos; StackElement* next; @@ -81,7 +82,7 @@ namespace kt }; StackElement* begin; - QHBoxLayout* top_layout; + TQHBoxLayout* top_layout; }; } diff --git a/libktorrent/functions.cpp b/libktorrent/functions.cpp index 3bc4f88..2bc76eb 100644 --- a/libktorrent/functions.cpp +++ b/libktorrent/functions.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdatetime.h> +#include <tqdatetime.h> #include <klocale.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -28,9 +28,9 @@ using namespace bt; namespace kt { - QString DataDir() + TQString DataDir() { - QString str = KGlobal::dirs()->saveLocation("data","ktorrent"); + TQString str = KGlobal::dirs()->saveLocation("data","ktorrent"); if (!str.endsWith(bt::DirSeparator())) return str + bt::DirSeparator(); else diff --git a/libktorrent/functions.h b/libktorrent/functions.h index 02f7870..f6bd8dd 100644 --- a/libktorrent/functions.h +++ b/libktorrent/functions.h @@ -20,7 +20,7 @@ #ifndef FUNCTIONS_H #define FUNCTIONS_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace kt @@ -29,7 +29,7 @@ namespace kt * Will return the data directory * @return ~/.kde/share/apps/ktorrent/ */ - QString DataDir(); + TQString DataDir(); } #endif diff --git a/libktorrent/interfaces/chunkdownloadinterface.h b/libktorrent/interfaces/chunkdownloadinterface.h index 161a534..0945006 100644 --- a/libktorrent/interfaces/chunkdownloadinterface.h +++ b/libktorrent/interfaces/chunkdownloadinterface.h @@ -20,7 +20,7 @@ #ifndef KTCHUNKDOWNLOADINTERFACE_H #define KTCHUNKDOWNLOADINTERFACE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace kt @@ -41,7 +41,7 @@ namespace kt struct Stats { /// The PeerID of the current downloader - QString current_peer_id; + TQString current_peer_id; /// The current download speed bt::Uint32 download_speed; /// The index of the chunk diff --git a/libktorrent/interfaces/coreinterface.h b/libktorrent/interfaces/coreinterface.h index 613ba8e..9ca2ae1 100644 --- a/libktorrent/interfaces/coreinterface.h +++ b/libktorrent/interfaces/coreinterface.h @@ -21,7 +21,7 @@ #define KTCOREINTERFACE_H #include <kurl.h> -#include <qobject.h> +#include <tqobject.h> #include <util/constants.h> #include <torrent/queuemanager.h> @@ -50,9 +50,10 @@ namespace kt * the applications core, the core is responsible for managing all * TorrentControl objects. */ - class CoreInterface : public QObject + class CoreInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: CoreInterface(); virtual ~CoreInterface(); @@ -83,7 +84,7 @@ namespace kt * and leaves everything where it supposed to be. * @param new_dir The new directory */ - virtual bool changeDataDir(const QString & new_dir) = 0; + virtual bool changeDataDir(const TQString & new_dir) = 0; /** * Start all, takes into account the maximum number of downloads. @@ -141,7 +142,7 @@ namespace kt * @param savedir Dir to save the data * @param silently Wether or not to do this silently */ - virtual bool load(const QString & file,const QString & savedir,bool silently) = 0; + virtual bool load(const TQString & file,const TQString & savedir,bool silently) = 0; /** * Load a torrent file. Pops up an error dialog @@ -171,31 +172,31 @@ namespace kt /** * Inserts IP range to be blocked into IPBlocklist - * @param ip QString reference to single IP or IP range. For example: + * @param ip TQString reference to single IP or IP range. For example: * single - 127.0.0.5 * range - 127.0.*.* **/ - virtual void addBlockedIP(QString& ip) = 0; + virtual void addBlockedIP(TQString& ip) = 0; /** * Removes IP range from IPBlocklist - * @param ip QString reference to single IP or IP range. For example: + * @param ip TQString reference to single IP or IP range. For example: * single - 127.0.0.5 * range - 127.0.*.* **/ - virtual void removeBlockedIP(QString& ip) = 0; + virtual void removeBlockedIP(TQString& ip) = 0; /** * Find the next free torX dir. * @return Path to the dir (including the torX part) */ - virtual QString findNewTorrentDir() const = 0; + virtual TQString findNewTorrentDir() const = 0; /** * Load an existing torrent, which has already a properly set up torX dir. * @param tor_dir The torX dir */ - virtual void loadExistingTorrent(const QString & tor_dir) = 0; + virtual void loadExistingTorrent(const TQString & tor_dir) = 0; /** * Returns maximum allowed download speed. @@ -250,7 +251,7 @@ namespace kt * @param tc TorrentInterface * @param msg Error message */ - void torrentStoppedByError(kt::TorrentInterface* tc, QString msg); + void torrentStoppedByError(kt::TorrentInterface* tc, TQString msg); }; } diff --git a/libktorrent/interfaces/exitoperation.cpp b/libktorrent/interfaces/exitoperation.cpp index 8eedb7a..08a39df 100644 --- a/libktorrent/interfaces/exitoperation.cpp +++ b/libktorrent/interfaces/exitoperation.cpp @@ -31,7 +31,7 @@ namespace kt ExitJobOperation::ExitJobOperation(KIO::Job* j) { - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(onResult( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onResult( KIO::Job* ))); } ExitJobOperation::~ExitJobOperation() diff --git a/libktorrent/interfaces/exitoperation.h b/libktorrent/interfaces/exitoperation.h index edaa2fa..4cad283 100644 --- a/libktorrent/interfaces/exitoperation.h +++ b/libktorrent/interfaces/exitoperation.h @@ -20,7 +20,7 @@ #ifndef KTEXITOPERATION_H #define KTEXITOPERATION_H -#include <qobject.h> +#include <tqobject.h> #include <kio/job.h> namespace kt @@ -35,9 +35,10 @@ namespace kt * ExitOperation's can be used in combination with a WaitJob, to wait for a certain amount of time * to give serveral ExitOperation's the time time to finish up. */ - class ExitOperation : public QObject + class ExitOperation : public TQObject { Q_OBJECT + TQ_OBJECT public: ExitOperation(); virtual ~ExitOperation(); @@ -54,6 +55,7 @@ namespace kt class ExitJobOperation : public ExitOperation { Q_OBJECT + TQ_OBJECT public: ExitJobOperation(KIO::Job* j); virtual ~ExitJobOperation(); diff --git a/libktorrent/interfaces/filetreediritem.cpp b/libktorrent/interfaces/filetreediritem.cpp index b294015..54c1953 100644 --- a/libktorrent/interfaces/filetreediritem.cpp +++ b/libktorrent/interfaces/filetreediritem.cpp @@ -34,10 +34,10 @@ using namespace bt; namespace kt { - FileTreeDirItem::FileTreeDirItem(KListView* klv,const QString & name,FileTreeRootListener* rl) - : QCheckListItem(klv,QString::null,QCheckListItem::CheckBox),name(name),root_listener(rl) + FileTreeDirItem::FileTreeDirItem(KListView* klv,const TQString & name,FileTreeRootListener* rl) + : TQCheckListItem(klv,TQString(),TQCheckListItem::CheckBox),name(name),root_listener(rl) { - parent = 0; + tqparent = 0; size = 0; setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small)); setText(0,name); @@ -48,9 +48,9 @@ namespace kt manual_change = false; } - FileTreeDirItem::FileTreeDirItem(FileTreeDirItem* parent,const QString & name) - : QCheckListItem(parent,QString::null,QCheckListItem::CheckBox), - name(name),parent(parent) + FileTreeDirItem::FileTreeDirItem(FileTreeDirItem* tqparent,const TQString & name) + : TQCheckListItem(tqparent,TQString(),TQCheckListItem::CheckBox), + name(name),tqparent(tqparent) { size = 0; setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small)); @@ -66,19 +66,19 @@ namespace kt { } - void FileTreeDirItem::insert(const QString & path,kt::TorrentFileInterface & file) + void FileTreeDirItem::insert(const TQString & path,kt::TorrentFileInterface & file) { size += file.getSize(); setText(1,BytesToString(size)); - int p = path.find(bt::DirSeparator()); + int p = path.tqfind(bt::DirSeparator()); if (p == -1) { - children.insert(path,newFileTreeItem(path,file)); + tqchildren.insert(path,newFileTreeItem(path,file)); } else { - QString subdir = path.left(p); - FileTreeDirItem* sd = subdirs.find(subdir); + TQString subdir = path.left(p); + FileTreeDirItem* sd = subdirs.tqfind(subdir); if (!sd) { sd = newFileTreeDirItem(subdir); @@ -98,15 +98,15 @@ namespace kt manual_change = false; } // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { i->second->setChecked(on,keep_data); i++; } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { j->second->setAllChecked(on,keep_data); @@ -118,8 +118,8 @@ namespace kt void FileTreeDirItem::invertChecked() { // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { FileTreeItem* item = i->second; item->setChecked(!item->isOn()); @@ -127,7 +127,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { j->second->invertChecked(); @@ -161,8 +161,8 @@ namespace kt return; } } - if (parent) - parent->childStateChange(); + if (tqparent) + tqparent->childStateChange(); } setText(2,on ? i18n("Yes") : i18n("No")); } @@ -171,8 +171,8 @@ namespace kt { Uint64 tot = 0; // first check all the child items - bt::PtrMap<QString,FileTreeItem>::const_iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::const_iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { const FileTreeItem* item = i->second; tot += item->bytesToDownload(); @@ -180,7 +180,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::const_iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::const_iterator j = subdirs.begin(); while (j != subdirs.end()) { tot += j->second->bytesToDownload(); @@ -192,8 +192,8 @@ namespace kt bool FileTreeDirItem::allChildrenOn() { // first check all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { FileTreeItem* item = i->second; if (!item->isOn()) @@ -202,7 +202,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { if (!j->second->allChildrenOn()) @@ -214,19 +214,19 @@ namespace kt void FileTreeDirItem::childStateChange() { - // only set this dir on if all children are on + // only set this dir on if all tqchildren are on manual_change = true; setOn(allChildrenOn()); manual_change = false; - if (parent) - parent->childStateChange(); + if (tqparent) + tqparent->childStateChange(); else if (root_listener) root_listener->treeItemChanged(); } - int FileTreeDirItem::compare(QListViewItem* i, int col, bool ascending) const + int FileTreeDirItem::compare(TQListViewItem* i, int col, bool ascending) const { if (col == 1) { @@ -238,18 +238,18 @@ namespace kt } else { - //return QCheckListItem::compare(i, col, ascending); + //return TQCheckListItem::compare(i, col, ascending); // case insensitive comparison - return QString::compare(text(col).lower(),i->text(col).lower()); + return TQString::compare(text(col).lower(),i->text(col).lower()); } } - TorrentFileInterface & FileTreeDirItem::findTorrentFile(QListViewItem* item) + TorrentFileInterface & FileTreeDirItem::findTorrentFile(TQListViewItem* item) { // first check all the child items TorrentFileInterface & nullfile = (TorrentFileInterface &)TorrentFile::null; - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { FileTreeItem* file = i->second; if (file == (FileTreeItem*)item) @@ -258,7 +258,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { TorrentFileInterface & thefile = j->second->findTorrentFile(item); @@ -269,12 +269,12 @@ namespace kt return nullfile; } - FileTreeItem* FileTreeDirItem::newFileTreeItem(const QString & name,TorrentFileInterface & file) + FileTreeItem* FileTreeDirItem::newFileTreeItem(const TQString & name,TorrentFileInterface & file) { return new FileTreeItem(this,name,file); } - FileTreeDirItem* FileTreeDirItem::newFileTreeDirItem(const QString & subdir) + FileTreeDirItem* FileTreeDirItem::newFileTreeDirItem(const TQString & subdir) { return new FileTreeDirItem(this,subdir); } @@ -284,12 +284,12 @@ namespace kt return bt::THROW_AWAY_DATA; } - QString FileTreeDirItem::getPath() const + TQString FileTreeDirItem::getPath() const { - if (!parent) + if (!tqparent) return bt::DirSeparator(); else - return parent->getPath() + name + bt::DirSeparator(); + return tqparent->getPath() + name + bt::DirSeparator(); } } diff --git a/libktorrent/interfaces/filetreediritem.h b/libktorrent/interfaces/filetreediritem.h index 00650f2..9afdbd1 100644 --- a/libktorrent/interfaces/filetreediritem.h +++ b/libktorrent/interfaces/filetreediritem.h @@ -44,41 +44,41 @@ namespace kt * * Directory item the file tree showing the files in a multifile torrent */ - class FileTreeDirItem : public QCheckListItem + class FileTreeDirItem : public TQCheckListItem { protected: - QString name; + TQString name; Uint64 size; - bt::PtrMap<QString,FileTreeItem> children; - bt::PtrMap<QString,FileTreeDirItem> subdirs; - FileTreeDirItem* parent; + bt::PtrMap<TQString,FileTreeItem> tqchildren; + bt::PtrMap<TQString,FileTreeDirItem> subdirs; + FileTreeDirItem* tqparent; bool manual_change; FileTreeRootListener* root_listener; public: - FileTreeDirItem(KListView* klv,const QString & name,FileTreeRootListener* rl = 0); - FileTreeDirItem(FileTreeDirItem* parent,const QString & name); + FileTreeDirItem(KListView* klv,const TQString & name,FileTreeRootListener* rl = 0); + FileTreeDirItem(FileTreeDirItem* tqparent,const TQString & name); virtual ~FileTreeDirItem(); /// Get the path of the directory (if this is the root directory / will be returned) - QString getPath() const; + TQString getPath() const; /** * Recursively insert a TorrentFileInterface. * @param path Path of file * @param file File itself */ - void insert(const QString & path,kt::TorrentFileInterface & file); + void insert(const TQString & path,kt::TorrentFileInterface & file); /** * Recursivly walk the tree to find the TorrentFile which - * is shown by a QListViewItem (which should be an FileTreeItem). + * is shown by a TQListViewItem (which should be an FileTreeItem). * If item can't be found or item is an FileTreeDirItem, a reference to * TorrentFile::null will be returned. In which case the isNull() function * of TorrentFile will return true - * @param item Pointer to the QListViewItem + * @param item Pointer to the TQListViewItem * @return A reference to the TorrentFile */ - kt::TorrentFileInterface & findTorrentFile(QListViewItem* item); + kt::TorrentFileInterface & findTorrentFile(TQListViewItem* item); /** * Set all items checked or not. @@ -93,11 +93,11 @@ namespace kt void invertChecked(); /** - * Called by the child to notify the parent it's state has changed. + * Called by the child to notify the tqparent it's state has changed. */ void childStateChange(); - FileTreeDirItem* getParent() {return parent;} + FileTreeDirItem* getParent() {return tqparent;} /// Recusively get the total number of bytes to download Uint64 bytesToDownload() const; @@ -110,7 +110,7 @@ namespace kt * @param file The TorrentFileInterface * @return A newly created FileTreeItem */ - virtual FileTreeItem* newFileTreeItem(const QString & name, + virtual FileTreeItem* newFileTreeItem(const TQString & name, TorrentFileInterface & file); @@ -120,7 +120,7 @@ namespace kt * @param subdir The name of the subdir * @return A newly created FileTreeDirItem */ - virtual FileTreeDirItem* newFileTreeDirItem(const QString & subdir); + virtual FileTreeDirItem* newFileTreeDirItem(const TQString & subdir); /** @@ -131,7 +131,7 @@ namespace kt private: virtual void stateChange(bool on); - virtual int compare(QListViewItem* i, int col, bool ascending) const; + virtual int compare(TQListViewItem* i, int col, bool ascending) const; bool allChildrenOn(); }; diff --git a/libktorrent/interfaces/filetreeitem.cpp b/libktorrent/interfaces/filetreeitem.cpp index 32f265c..666c1a0 100644 --- a/libktorrent/interfaces/filetreeitem.cpp +++ b/libktorrent/interfaces/filetreeitem.cpp @@ -32,10 +32,10 @@ using namespace bt; namespace kt { - FileTreeItem::FileTreeItem(FileTreeDirItem* item,const QString & name,kt::TorrentFileInterface & file) - : QCheckListItem(item,QString::null,QCheckListItem::CheckBox),name(name),file(file) + FileTreeItem::FileTreeItem(FileTreeDirItem* item,const TQString & name,kt::TorrentFileInterface & file) + : TQCheckListItem(item,TQString(),TQCheckListItem::CheckBox),name(name),file(file) { - parent = item; + tqparent = item; manual_change = false; init(); } @@ -66,7 +66,7 @@ namespace kt } updatePriorityText(); - parent->childStateChange(); + tqparent->childStateChange(); } void FileTreeItem::updatePriorityText() @@ -141,10 +141,10 @@ namespace kt } updatePriorityText(); - parent->childStateChange(); + tqparent->childStateChange(); } - int FileTreeItem::compare(QListViewItem* i, int col, bool ascending) const + int FileTreeItem::compare(TQListViewItem* i, int col, bool ascending) const { if (col == 1) { @@ -157,8 +157,8 @@ namespace kt else { // lets sort case insensitive - return QString::compare(text(col).lower(),i->text(col).lower()); - // QCheckListItem::compare(i, col, ascending); + return TQString::compare(text(col).lower(),i->text(col).lower()); + // TQCheckListItem::compare(i, col, ascending); } } diff --git a/libktorrent/interfaces/filetreeitem.h b/libktorrent/interfaces/filetreeitem.h index 6f9f1b1..6d6ed79 100644 --- a/libktorrent/interfaces/filetreeitem.h +++ b/libktorrent/interfaces/filetreeitem.h @@ -37,25 +37,25 @@ namespace kt * @author Joris Guisson * * File item part of a tree which shows the files in a multifile torrent. - * This is derived from QCheckListItem, if the user checks or unchecks the box, + * This is derived from TQCheckListItem, if the user checks or unchecks the box, * wether or not to download a file will be changed. */ - class FileTreeItem : public QCheckListItem + class FileTreeItem : public TQCheckListItem { protected: - QString name; + TQString name; TorrentFileInterface & file; - FileTreeDirItem* parent; + FileTreeDirItem* tqparent; bool manual_change; public: /** - * Constructor, set the parent, name and file + * Constructor, set the tqparent, name and file * @param item Parent item * @param name Name of file * @param file THe TorrentFileInterface * @return */ - FileTreeItem(FileTreeDirItem* item,const QString & name,TorrentFileInterface & file); + FileTreeItem(FileTreeDirItem* item,const TQString & name,TorrentFileInterface & file); virtual ~FileTreeItem(); /// Get a reference to the TorrentFileInterface @@ -78,7 +78,7 @@ namespace kt void updatePriorityText(); protected: - virtual int compare(QListViewItem* i, int col, bool ascending) const; + virtual int compare(TQListViewItem* i, int col, bool ascending) const; /** * Subclasses should override this if they want to show a confirmation dialog. diff --git a/libktorrent/interfaces/functions.cpp b/libktorrent/interfaces/functions.cpp index 2c6286f..cade53a 100644 --- a/libktorrent/interfaces/functions.cpp +++ b/libktorrent/interfaces/functions.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdatetime.h> +#include <tqdatetime.h> #include <klocale.h> #include <kglobal.h> #include "functions.h" @@ -28,32 +28,32 @@ namespace kt { - QString BytesToString(Uint64 bytes,int precision) + TQString BytesToString(Uint64 bytes,int precision) { KLocale* loc = KGlobal::locale(); if (bytes >= 1024 * 1024 * 1024) - return i18n("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision)); + return i18n("%1 GB").tqarg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision)); else if (bytes >= 1024*1024) - return i18n("%1 MB").arg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision)); + return i18n("%1 MB").tqarg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision)); else if (bytes >= 1024) - return i18n("%1 KB").arg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision)); + return i18n("%1 KB").tqarg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision)); else - return i18n("%1 B").arg(bytes); + return i18n("%1 B").tqarg(bytes); } - QString KBytesPerSecToString(double speed,int precision) + TQString KBytesPerSecToString(double speed,int precision) { KLocale* loc = KGlobal::locale(); - return i18n("%1 KB/s").arg(loc->formatNumber(speed,precision)); + return i18n("%1 KB/s").tqarg(loc->formatNumber(speed,precision)); } - QString DurationToString(Uint32 nsecs) + TQString DurationToString(Uint32 nsecs) { KLocale* loc = KGlobal::locale(); - QTime t; + TQTime t; int ndays = nsecs / 86400; t = t.addSecs(nsecs % 86400); - QString s = loc->formatTime(t,true,true); + TQString s = loc->formatTime(t,true,true); if (ndays > 0) s = i18n("1 day ","%n days ",ndays) + s; diff --git a/libktorrent/interfaces/functions.h b/libktorrent/interfaces/functions.h index 1bf7178..4ffe9a9 100644 --- a/libktorrent/interfaces/functions.h +++ b/libktorrent/interfaces/functions.h @@ -20,7 +20,7 @@ #ifndef FUNCTIONS_H #define FUNCTIONS_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace kt @@ -29,9 +29,9 @@ namespace kt const double TO_MEG = (1024.0 * 1024.0); const double TO_GIG = (1024.0 * 1024.0 * 1024.0); - QString BytesToString(bt::Uint64 bytes,int precision = -1); - QString KBytesPerSecToString(double speed,int precision = 1); - QString DurationToString(bt::Uint32 nsecs); + TQString BytesToString(bt::Uint64 bytes,int precision = -1); + TQString KBytesPerSecToString(double speed,int precision = 1); + TQString DurationToString(bt::Uint32 nsecs); template<class T> int CompareVal(T a,T b) { diff --git a/libktorrent/interfaces/guiinterface.cpp b/libktorrent/interfaces/guiinterface.cpp index 8a87d90..635415e 100644 --- a/libktorrent/interfaces/guiinterface.cpp +++ b/libktorrent/interfaces/guiinterface.cpp @@ -33,7 +33,7 @@ namespace kt void GUIInterface::notifyViewListeners(TorrentInterface* tc) { - QPtrList<ViewListener>::iterator i = listeners.begin(); + TQPtrList<ViewListener>::iterator i = listeners.begin(); while (i != listeners.end()) { ViewListener* vl = *i; diff --git a/libktorrent/interfaces/guiinterface.h b/libktorrent/interfaces/guiinterface.h index a263bb6..6fbab7e 100644 --- a/libktorrent/interfaces/guiinterface.h +++ b/libktorrent/interfaces/guiinterface.h @@ -20,11 +20,11 @@ #ifndef KTGUIINTERFACE_H #define KTGUIINTERFACE_H -#include <qptrlist.h> +#include <tqptrlist.h> -class QWidget; -class QIconSet; -class QString; +class TQWidget; +class TQIconSet; +class TQString; class KToolBar; class KProgress; @@ -65,10 +65,10 @@ namespace kt { public: /// By default all tabs can be closed, but this can be overridden - virtual bool closeAllowed(QWidget* ) {return true;} + virtual bool closeAllowed(TQWidget* ) {return true;} /// THe close button was pressed for this tab, please remove it from the GUI - virtual void tabCloseRequest(kt::GUIInterface* gui,QWidget* tab) = 0; + virtual void tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab) = 0; }; /** @@ -79,7 +79,7 @@ namespace kt */ class GUIInterface { - QPtrList<ViewListener> listeners; + TQPtrList<ViewListener> listeners; public: GUIInterface(); virtual ~GUIInterface(); @@ -104,15 +104,15 @@ namespace kt * @param caption Text on the tab * @param ctl For closeable tabs this pointer should be set */ - virtual void addTabPage(QWidget* page,const QIconSet & icon, - const QString & caption,CloseTabListener* ctl = 0) = 0; + virtual void addTabPage(TQWidget* page,const TQIconSet & icon, + const TQString & caption,CloseTabListener* ctl = 0) = 0; /** * Remove a tab page, does nothing if the page * isn't added. Does not delete the widget. * @param page The page */ - virtual void removeTabPage(QWidget* page) = 0; + virtual void removeTabPage(TQWidget* page) = 0; /** * Add a page to the preference dialog. @@ -131,7 +131,7 @@ namespace kt * Change the statusbar message. * @param msg The new message */ - virtual void changeStatusbar(const QString& msg) = 0; + virtual void changeStatusbar(const TQString& msg) = 0; /** * Merge the GUI of a plugin. @@ -151,14 +151,14 @@ namespace kt * @param w The widget * @param pos How the widget will be positioned against the already present widgets */ - virtual void addWidgetInView(QWidget* w,Position pos) = 0; + virtual void addWidgetInView(TQWidget* w,Position pos) = 0; /** * Remove a widget added with addWidgetInView. * The widget will be reparented to 0. * @param w The widget */ - virtual void removeWidgetFromView(QWidget* w) = 0; + virtual void removeWidgetFromView(TQWidget* w) = 0; /** * Add a widget below the view. @@ -166,13 +166,13 @@ namespace kt * @param icon Name of icon to use * @param caption The caption to use */ - virtual void addWidgetBelowView(QWidget* w,const QString & icon,const QString & caption) = 0; + virtual void addWidgetBelowView(TQWidget* w,const TQString & icon,const TQString & caption) = 0; /** * Remove a widget, which was added below the view. * @param w The widget */ - virtual void removeWidgetBelowView(QWidget* w) = 0; + virtual void removeWidgetBelowView(TQWidget* w) = 0; enum ToolDock { @@ -188,13 +188,13 @@ namespace kt * @param caption The caption to use * @param dock Where to dock the widget */ - virtual void addToolWidget(QWidget* w,const QString & icon,const QString & caption,ToolDock dock) = 0; + virtual void addToolWidget(TQWidget* w,const TQString & icon,const TQString & caption,ToolDock dock) = 0; /** * Remove a tool widget. * @param w The widget */ - virtual void removeToolWidget(QWidget* w) = 0; + virtual void removeToolWidget(TQWidget* w) = 0; /// Get the current torrent. virtual const TorrentInterface* getCurrentTorrent() const = 0; diff --git a/libktorrent/interfaces/ipblockinginterface.h b/libktorrent/interfaces/ipblockinginterface.h index 4054af9..236a549 100644 --- a/libktorrent/interfaces/ipblockinginterface.h +++ b/libktorrent/interfaces/ipblockinginterface.h @@ -22,7 +22,7 @@ #ifndef IPBLOCKINGINTERFACE_H #define IPBLOCKINGINTERFACE_H -class QString; +class TQString; namespace kt { @@ -41,7 +41,7 @@ namespace kt * @return TRUE if IP should be blocked. FALSE otherwise * @arg ip String representation of IP address. */ - virtual bool isBlockedIP(const QString& ip) = 0; + virtual bool isBlockedIP(const TQString& ip) = 0; }; } diff --git a/libktorrent/interfaces/logmonitorinterface.h b/libktorrent/interfaces/logmonitorinterface.h index 4fccb0e..54e1a21 100644 --- a/libktorrent/interfaces/logmonitorinterface.h +++ b/libktorrent/interfaces/logmonitorinterface.h @@ -20,7 +20,7 @@ #ifndef KTLOGMONITORINTERFACE_H #define KTLOGMONITORINTERFACE_H -class QString; +class TQString; namespace kt { @@ -42,7 +42,7 @@ namespace kt * A line was written to the log file. * @param line The line */ - virtual void message(const QString & line, unsigned int arg) = 0; + virtual void message(const TQString & line, unsigned int arg) = 0; }; } diff --git a/libktorrent/interfaces/peerinterface.h b/libktorrent/interfaces/peerinterface.h index f77d0f8..d5424ac 100644 --- a/libktorrent/interfaces/peerinterface.h +++ b/libktorrent/interfaces/peerinterface.h @@ -20,7 +20,7 @@ #ifndef KTPEERINTERFACE_H #define KTPEERINTERFACE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace kt { @@ -41,9 +41,9 @@ namespace kt struct Stats { /// IP address of peer (dotted notation) - QString ip_address; + TQString ip_address; /// The client (Azureus, BitComet, ...) - QString client; + TQString client; /// Download rate (bytes/s) bt::Uint32 download_rate; /// Upload rate (bytes/s) diff --git a/libktorrent/interfaces/peersource.cpp b/libktorrent/interfaces/peersource.cpp index 18368b1..6a1eb87 100644 --- a/libktorrent/interfaces/peersource.cpp +++ b/libktorrent/interfaces/peersource.cpp @@ -38,7 +38,7 @@ namespace kt void PeerSource::aboutToBeDestroyed() {} - void PeerSource::addPeer(const QString & ip,bt::Uint16 port,bool local) + void PeerSource::addPeer(const TQString & ip,bt::Uint16 port,bool local) { PotentialPeer pp; pp.ip = ip; diff --git a/libktorrent/interfaces/peersource.h b/libktorrent/interfaces/peersource.h index 9c2b589..c7aa73d 100644 --- a/libktorrent/interfaces/peersource.h +++ b/libktorrent/interfaces/peersource.h @@ -20,8 +20,8 @@ #ifndef KTPEERSOURCE_H #define KTPEERSOURCE_H -#include <qobject.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqvaluelist.h> #include <util/constants.h> namespace bt @@ -33,7 +33,7 @@ namespace kt { struct PotentialPeer { - QString ip; + TQString ip; bt::Uint16 port; bool local; @@ -47,9 +47,10 @@ namespace kt * for torrents. PeerSources should work independently and should emit a signal when they * have peers ready. */ - class PeerSource : public QObject + class PeerSource : public TQObject { Q_OBJECT + TQ_OBJECT public: PeerSource(); virtual ~PeerSource(); @@ -70,7 +71,7 @@ namespace kt * @param port The port * @param local Wether or not the peer is on the local network */ - void addPeer(const QString & ip,bt::Uint16 port,bool local = false); + void addPeer(const TQString & ip,bt::Uint16 port,bool local = false); public slots: /** @@ -110,7 +111,7 @@ namespace kt private: /// List to keep the potential peers in. - QValueList<PotentialPeer> peers; + TQValueList<PotentialPeer> peers; }; } diff --git a/libktorrent/interfaces/plugin.cpp b/libktorrent/interfaces/plugin.cpp index 6354985..50903d7 100644 --- a/libktorrent/interfaces/plugin.cpp +++ b/libktorrent/interfaces/plugin.cpp @@ -22,11 +22,11 @@ namespace kt { - Plugin::Plugin(QObject *parent, const char* qt_name,const QStringList & /*args*/, - const QString & name,const QString & gui_name,const QString & author, - const QString & email,const QString & description, - const QString & icon) - : KParts::Plugin(parent,qt_name), + Plugin::Plugin(TQObject *tqparent, const char* qt_name,const TQStringList & /*args*/, + const TQString & name,const TQString & gui_name,const TQString & author, + const TQString & email,const TQString & description, + const TQString & icon) + : KParts::Plugin(tqparent,qt_name), name(name),author(author),email(email),description(description),icon(icon),gui_name(gui_name) { core = 0; diff --git a/libktorrent/interfaces/plugin.h b/libktorrent/interfaces/plugin.h index ac43fbc..d147d46 100644 --- a/libktorrent/interfaces/plugin.h +++ b/libktorrent/interfaces/plugin.h @@ -48,6 +48,7 @@ namespace kt class Plugin : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the name of the plugin, the name and e-mail of the author and @@ -59,10 +60,10 @@ namespace kt * @param description What does the plugin do * @param icon Name of the plugin's icon */ - Plugin(QObject *parent,const char* qt_name,const QStringList & args, - const QString & name,const QString & gui_name,const QString & author, - const QString & email,const QString & description, - const QString & icon); + Plugin(TQObject *tqparent,const char* qt_name,const TQStringList & args, + const TQString & name,const TQString & gui_name,const TQString & author, + const TQString & email,const TQString & description, + const TQString & icon); virtual ~Plugin(); /** @@ -94,12 +95,12 @@ namespace kt */ virtual void shutdown(bt::WaitJob* job); - const QString & getName() const {return name;} - const QString & getAuthor() const {return author;} - const QString & getEMailAddress() const {return email;} - const QString & getDescription() const {return description;} - const QString & getIcon() const {return icon;} - const QString & getGuiName() const {return gui_name;} + const TQString & getName() const {return name;} + const TQString & getAuthor() const {return author;} + const TQString & getEMailAddress() const {return email;} + const TQString & getDescription() const {return description;} + const TQString & getIcon() const {return icon;} + const TQString & getGuiName() const {return gui_name;} /// Get a pointer to the CoreInterface CoreInterface* getCore() {return core;} @@ -131,15 +132,15 @@ namespace kt bool isLoaded() const {return loaded;} /// Check wether the plugin matches the version of KT - virtual bool versionCheck(const QString & version) const = 0; + virtual bool versionCheck(const TQString & version) const = 0; private: - QString name; - QString author; - QString email; - QString description; - QString icon; - QString gui_name; + TQString name; + TQString author; + TQString email; + TQString description; + TQString icon; + TQString gui_name; CoreInterface* core; GUIInterface* gui; bool loaded; diff --git a/libktorrent/interfaces/prefpageinterface.cpp b/libktorrent/interfaces/prefpageinterface.cpp index b905f07..ae6414f 100644 --- a/libktorrent/interfaces/prefpageinterface.cpp +++ b/libktorrent/interfaces/prefpageinterface.cpp @@ -20,8 +20,8 @@ #include "prefpageinterface.h" namespace kt { - PrefPageInterface::PrefPageInterface(const QString & name,const QString & header, - const QPixmap & pix) + PrefPageInterface::PrefPageInterface(const TQString & name,const TQString & header, + const TQPixmap & pix) : pixmap(pix),itemName(name),header(header) {} diff --git a/libktorrent/interfaces/prefpageinterface.h b/libktorrent/interfaces/prefpageinterface.h index 7d4d6dc..b27390e 100644 --- a/libktorrent/interfaces/prefpageinterface.h +++ b/libktorrent/interfaces/prefpageinterface.h @@ -20,9 +20,9 @@ #ifndef PREFPAGEINTERFACE_H #define PREFPAGEINTERFACE_H -#include <qpixmap.h> +#include <tqpixmap.h> -class QWidget; +class TQWidget; namespace kt { @@ -41,12 +41,12 @@ namespace kt * @param header * @param pix */ - PrefPageInterface(const QString & name,const QString & header,const QPixmap & pix); + PrefPageInterface(const TQString & name,const TQString & header,const TQPixmap & pix); virtual ~PrefPageInterface(); - const QString& getItemName() { return itemName; } - const QString& getHeader() { return header; } - const QPixmap& getPixmap() { return pixmap; } + const TQString& getItemName() { return itemName; } + const TQString& getHeader() { return header; } + const TQPixmap& getPixmap() { return pixmap; } /** * Apply the changes that have been made in the @@ -58,9 +58,9 @@ namespace kt /** * Create the actual widget. - * @param parent The parent of the widget + * @param tqparent The tqparent of the widget */ - virtual void createWidget(QWidget* parent)=0; + virtual void createWidget(TQWidget* tqparent)=0; /** * Update all data on the widget, gets called before @@ -73,11 +73,11 @@ namespace kt private: ///Used in IconList mode. You should prefer a pixmap with size 32x32 pixels - QPixmap pixmap; + TQPixmap pixmap; ///String used in the list or as tab item name. - QString itemName; + TQString itemName; ///Header text use in the list modes. Ignored in Tabbed mode. If empty, the item text is used instead. - QString header; + TQString header; }; } #endif diff --git a/libktorrent/interfaces/torrentfileinterface.cpp b/libktorrent/interfaces/torrentfileinterface.cpp index 4cca138..d49414e 100644 --- a/libktorrent/interfaces/torrentfileinterface.cpp +++ b/libktorrent/interfaces/torrentfileinterface.cpp @@ -22,7 +22,7 @@ namespace kt { - TorrentFileInterface::TorrentFileInterface(const QString & path,Uint64 size) + TorrentFileInterface::TorrentFileInterface(const TQString & path,Uint64 size) : path(path),size(size),first_chunk(0),last_chunk(0),num_chunks_downloaded(0), priority(NORMAL_PRIORITY),m_emitDlStatusChanged(true),preview(false) { diff --git a/libktorrent/interfaces/torrentfileinterface.h b/libktorrent/interfaces/torrentfileinterface.h index 430534c..bf30f1e 100644 --- a/libktorrent/interfaces/torrentfileinterface.h +++ b/libktorrent/interfaces/torrentfileinterface.h @@ -20,8 +20,8 @@ #ifndef KTTORRENTFILEINTERFACE_H #define KTTORRENTFILEINTERFACE_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <util/constants.h> namespace kt @@ -41,20 +41,21 @@ namespace kt * * This class is the interface for a file in a multifile torrent. */ - class TorrentFileInterface : public QObject + class TorrentFileInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the path and size. * @param path The path * @param size The size */ - TorrentFileInterface(const QString & path,Uint64 size); + TorrentFileInterface(const TQString & path,Uint64 size); virtual ~TorrentFileInterface(); /// Get the path of the file - QString getPath() const {return path;} + TQString getPath() const {return path;} /// Get the size of the file Uint64 getSize() const {return size;} @@ -115,7 +116,7 @@ namespace kt void previewAvailable(bool available); protected: - QString path; + TQString path; Uint64 size; Uint32 first_chunk; Uint32 last_chunk; diff --git a/libktorrent/interfaces/torrentinterface.h b/libktorrent/interfaces/torrentinterface.h index 95d5766..14ad532 100644 --- a/libktorrent/interfaces/torrentinterface.h +++ b/libktorrent/interfaces/torrentinterface.h @@ -20,7 +20,7 @@ #ifndef KTTORRENTINTERFACE_H #define KTTORRENTINTERFACE_H -#include <qobject.h> +#include <tqobject.h> #include <util/constants.h> #include <interfaces/trackerslist.h> @@ -44,7 +44,7 @@ namespace kt class TorrentFileInterface; class PeerSource; - enum TorrentStatus + enum TorrenttqStatus { NOT_STARTED, SEEDING_COMPLETE, @@ -55,7 +55,7 @@ namespace kt STOPPED, ALLOCATING_DISKSPACE, ERROR, - QUEUED, + TQUEUED, CHECKING_DATA, NO_SPACE_LEFT }; @@ -67,7 +67,7 @@ namespace kt NOT_ENOUGH_DISKSPACE, MAX_SHARE_RATIO_REACHED, BUSY_WITH_DATA_CHECK, - QM_LIMITS_REACHED // Max seeds or downloads reached + TQM_LIMITS_REACHED // Max seeds or downloads reached }; enum AutoStopReason @@ -118,10 +118,10 @@ namespace kt Uint32 leechers_total; /// Num leechers connected to Uint32 leechers_connected_to; - /// Status of the download - TorrentStatus status; + /// tqStatus of the download + TorrenttqStatus status; /// The status of the tracker - QString trackerstatus; + TQString trackerstatus; /// The number of bytes downloaded in this session Uint64 session_bytes_downloaded; /// The number of bytes uploaded in this session @@ -131,9 +131,9 @@ namespace kt /// The number of bytes upload since the last started event, this gets sent to the tracker Uint64 trk_bytes_uploaded; /// Name of the torrent - QString torrent_name; + TQString torrent_name; /// Path of the dir or file where the data will get saved - QString output_path; + TQString output_path; /// See if we are running bool running; /// See if the torrent has been started @@ -161,7 +161,7 @@ namespace kt struct DHTNode { - QString ip; + TQString ip; bt::Uint16 port; }; @@ -179,9 +179,10 @@ namespace kt * This class is the interface for an object which controls the * up- and download of one torrent. */ - class TorrentInterface : public QObject + class TorrentInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: TorrentInterface(); virtual ~TorrentInterface(); @@ -226,13 +227,13 @@ namespace kt * Get the torX directory of this torrent. Temporary stuff like the index * file get stored there. */ - virtual QString getTorDir() const = 0; + virtual TQString getTorDir() const = 0; /// Get the data directory of this torrent - virtual QString getDataDir() const = 0; + virtual TQString getDataDir() const = 0; /// Get a short error message - virtual QString getShortErrorMessage() const = 0; + virtual TQString getShortErrorMessage() const = 0; /** * Get the download running time of this torrent in seconds @@ -252,7 +253,7 @@ namespace kt * @param new_dir The new directory * @return true upon succes */ - virtual bool changeDataDir(const QString & new_dir) = 0; + virtual bool changeDataDir(const TQString & new_dir) = 0; /** * Change torrents output directory. If this fails we will fall back on the old directory. @@ -260,7 +261,7 @@ namespace kt * @param moveFiles Wheather to actually move the files or just change the directory without moving them. * @return true upon success. */ - virtual bool changeOutputDir(const QString& new_dir, bool moveFiles = true) = 0; + virtual bool changeOutputDir(const TQString& new_dir, bool moveFiles = true) = 0; /** * Roll back the previous changeDataDir call. @@ -329,7 +330,7 @@ namespace kt virtual float getMaxSeedTime() const = 0; /// Make a string of the current status - virtual QString statusToString() const = 0; + virtual TQString statusToString() const = 0; ///Is manual announce allowed? virtual bool announceAllowed() = 0; @@ -363,7 +364,7 @@ namespace kt * Test all files and see if they are not missing. * If so put them in a list */ - virtual bool hasMissingFiles(QStringList & sl) = 0; + virtual bool hasMissingFiles(TQStringList & sl) = 0; /** * Recreate missing files. @@ -394,7 +395,7 @@ namespace kt virtual bool overMaxSeedTime() = 0; /// Handle an error - virtual void handleError(const QString & err) = 0; + virtual void handleError(const TQString & err) = 0; /// Get the info_hash. virtual const bt::SHA1Hash & getInfoHash() const = 0; @@ -443,7 +444,7 @@ namespace kt * @param me The object who emitted the signal * @param msg Error message */ - void stoppedByError(kt::TorrentInterface* me, QString msg); + void stoppedByError(kt::TorrentInterface* me, TQString msg); /** * Emited when maximum share ratio for this torrent is changed diff --git a/libktorrent/kademlia/announcetask.cpp b/libktorrent/kademlia/announcetask.cpp index b7350a2..5e5b925 100644 --- a/libktorrent/kademlia/announcetask.cpp +++ b/libktorrent/kademlia/announcetask.cpp @@ -52,13 +52,13 @@ namespace dht if (gpr->containsNodes()) { - const QByteArray & n = gpr->getData(); + const TQByteArray & n = gpr->getData(); Uint32 nval = n.size() / 26; for (Uint32 i = 0;i < nval;i++) { // add node to todo list KBucketEntry e = UnpackBucketEntry(n,i*26); - if (!todo.contains(e) && !visited.contains(e) && + if (!todo.tqcontains(e) && !visited.tqcontains(e) && todo.count() < 100) { todo.append(e); @@ -78,7 +78,7 @@ namespace dht // add the peer who responded to the answered list, so we can do an announce KBucketEntry e(rsp->getOrigin(),rsp->getID()); - if (!answered.contains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.contains(e)) + if (!answered.tqcontains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.tqcontains(e)) { answered.append(KBucketEntryAndToken(e,gpr->getToken())); } @@ -101,7 +101,7 @@ namespace dht while (!answered.empty() && canDoRequest()) { KBucketEntryAndToken & e = answered.first(); - if (!answered_visited.contains(e)) + if (!answered_visited.tqcontains(e)) { AnnounceReq* anr = new AnnounceReq(node->getOurID(),info_hash,port,e.getToken()); anr->setOrigin(e.getAddress()); @@ -117,7 +117,7 @@ namespace dht { KBucketEntry e = todo.first(); // onLy send a findNode if we haven't allrready visited the node - if (!visited.contains(e)) + if (!visited.tqcontains(e)) { // send a findNode to the node GetPeersReq* gpr = new GetPeersReq(node->getOurID(),info_hash); diff --git a/libktorrent/kademlia/announcetask.h b/libktorrent/kademlia/announcetask.h index d6bfa7c..02dec19 100644 --- a/libktorrent/kademlia/announcetask.h +++ b/libktorrent/kademlia/announcetask.h @@ -62,8 +62,8 @@ namespace dht private: dht::Key info_hash; bt::Uint16 port; - QValueList<KBucketEntryAndToken> answered; // nodes which have answered with values - QValueList<KBucketEntry> answered_visited; // nodes which have answered with values which have been visited + TQValueList<KBucketEntryAndToken> answered; // nodes which have answered with values + TQValueList<KBucketEntry> answered_visited; // nodes which have answered with values which have been visited Database* db; DBItemList returned_items; diff --git a/libktorrent/kademlia/database.cpp b/libktorrent/kademlia/database.cpp index 447975f..c4b34fd 100644 --- a/libktorrent/kademlia/database.cpp +++ b/libktorrent/kademlia/database.cpp @@ -72,7 +72,7 @@ namespace dht void Database::store(const dht::Key & key,const DBItem & dbi) { - DBItemList* dbl = items.find(key); + DBItemList* dbl = items.tqfind(key); if (!dbl) { dbl = new DBItemList(); @@ -83,7 +83,7 @@ namespace dht void Database::sample(const dht::Key & key,DBItemList & tdbl,bt::Uint32 max_entries) { - DBItemList* dbl = items.find(key); + DBItemList* dbl = items.tqfind(key); if (!dbl) return; @@ -144,7 +144,7 @@ namespace dht bool Database::checkToken(const dht::Key & token,Uint32 ip,Uint16 port) { // the token must be in the map - if (!tokens.contains(token)) + if (!tokens.tqcontains(token)) { Out(SYS_DHT|LOG_DEBUG) << "Unknown token" << endl; return false; @@ -169,14 +169,14 @@ namespace dht return true; } - bool Database::contains(const dht::Key & key) const + bool Database::tqcontains(const dht::Key & key) const { - return items.find(key) != 0; + return items.tqfind(key) != 0; } void Database::insert(const dht::Key & key) { - DBItemList* dbl = items.find(key); + DBItemList* dbl = items.tqfind(key); if (!dbl) { dbl = new DBItemList(); diff --git a/libktorrent/kademlia/database.h b/libktorrent/kademlia/database.h index 94e6b3f..12e8373 100644 --- a/libktorrent/kademlia/database.h +++ b/libktorrent/kademlia/database.h @@ -20,8 +20,8 @@ #ifndef DHTDATABASE_H #define DHTDATABASE_H -#include <qmap.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqvaluelist.h> #include <util/ptrmap.h> #include <util/constants.h> #include <util/array.h> @@ -58,7 +58,7 @@ namespace dht DBItem & operator = (const DBItem & item); }; - typedef QValueList<DBItem> DBItemList; + typedef TQValueList<DBItem> DBItemList; /** * @author Joris Guisson @@ -68,7 +68,7 @@ namespace dht class Database { bt::PtrMap<dht::Key,DBItemList> items; - QMap<dht::Key,bt::TimeStamp> tokens; + TQMap<dht::Key,bt::TimeStamp> tokens; public: Database(); virtual ~Database(); @@ -118,7 +118,7 @@ namespace dht bool checkToken(const dht::Key & token,bt::Uint32 ip,bt::Uint16 port); /// Test wether or not the DB contains a key - bool contains(const dht::Key & key) const; + bool tqcontains(const dht::Key & key) const; /// Insert an empty item (only if it isn't already in the DB) void insert(const dht::Key & key); diff --git a/libktorrent/kademlia/dht.cpp b/libktorrent/kademlia/dht.cpp index 1d00ab8..3eecd7c 100644 --- a/libktorrent/kademlia/dht.cpp +++ b/libktorrent/kademlia/dht.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qmap.h> +#include <tqmap.h> #include <kresolver.h> #include <util/log.h> #include <util/array.h> @@ -46,7 +46,7 @@ namespace dht DHT::DHT() : node(0),srv(0),db(0),tman(0) { - connect(&update_timer,SIGNAL(timeout()),this,SLOT(update())); + connect(&update_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(update())); } @@ -56,7 +56,7 @@ namespace dht stop(); } - void DHT::start(const QString & table,const QString & key_file,bt::Uint16 port) + void DHT::start(const TQString & table,const TQString & key_file,bt::Uint16 port) { if (running) return; @@ -133,7 +133,7 @@ namespace dht Uint32 rs = kns.requiredSpace(); // create the data - QByteArray nodes(rs); + TQByteArray nodes(rs); // pack the found nodes in a byte array if (rs > 0) kns.pack(nodes); @@ -198,7 +198,7 @@ namespace dht node->findKClosestNodes(kns); Uint32 rs = kns.requiredSpace(); // create the data - QByteArray nodes(rs); + TQByteArray nodes(rs); // pack the found nodes in a byte array if (rs > 0) kns.pack(nodes); @@ -228,7 +228,7 @@ namespace dht {} - void DHT::portRecieved(const QString & ip,bt::Uint16 port) + void DHT::portRecieved(const TQString & ip,bt::Uint16 port) { if (!running) return; @@ -264,7 +264,7 @@ namespace dht AnnounceTask* at = new AnnounceTask(db,srv,node,info_hash,port); at->start(kns,!canStartTask()); tman->addTask(at); - if (!db->contains(info_hash)) + if (!db->tqcontains(info_hash)) db->insert(info_hash); return at; } @@ -333,21 +333,21 @@ namespace dht node->onTimeout(r); } - void DHT::addDHTNode(const QString & host,Uint16 hport) + void DHT::addDHTNode(const TQString & host,Uint16 hport) { if (!running) return; - KResolverResults res = KResolver::resolve(host,QString::number(hport)); + KResolverResults res = KResolver::resolve(host,TQString::number(hport)); if (res.count() > 0) { srv->ping(node->getOurID(),res.front().address()); } } - QMap<QString, int> DHT::getClosestGoodNodes(int maxNodes) + TQMap<TQString, int> DHT::getClosestGoodNodes(int maxNodes) { - QMap<QString, int> map; + TQMap<TQString, int> map; if(!node) return map; diff --git a/libktorrent/kademlia/dht.h b/libktorrent/kademlia/dht.h index 8642836..11daf82 100644 --- a/libktorrent/kademlia/dht.h +++ b/libktorrent/kademlia/dht.h @@ -20,9 +20,9 @@ #ifndef DHTDHT_H #define DHTDHT_H -#include <qtimer.h> -#include <qstring.h> -#include <qmap.h> +#include <tqtimer.h> +#include <tqstring.h> +#include <tqmap.h> #include <util/constants.h> #include <util/timer.h> #include "key.h" @@ -64,6 +64,7 @@ namespace dht class DHT : public DHTBase { Q_OBJECT + TQ_OBJECT public: DHT(); virtual ~DHT(); @@ -81,7 +82,7 @@ namespace dht * @param ip The IP of the peer * @param port The port in the PORT message */ - void portRecieved(const QString & ip,bt::Uint16 port); + void portRecieved(const TQString & ip,bt::Uint16 port); /** * Do an announce on the DHT network @@ -107,16 +108,16 @@ namespace dht /// See if it is possible to start a task bool canStartTask() const; - void start(const QString & table,const QString & key_file,bt::Uint16 port); + void start(const TQString & table,const TQString & key_file,bt::Uint16 port); void stop(); - void addDHTNode(const QString & host,bt::Uint16 hport); + void addDHTNode(const TQString & host,bt::Uint16 hport); /** * Returns maxNodes number of <IP address, port> nodes * that are closest to ourselves and are good. - * @param maxNodes maximum nr of nodes in QMap to return. + * @param maxNodes maximum nr of nodes in TQMap to return. */ - QMap<QString, int> getClosestGoodNodes(int maxNodes); + TQMap<TQString, int> getClosestGoodNodes(int maxNodes); private slots: void update(); @@ -127,8 +128,8 @@ namespace dht Database* db; TaskManager* tman; bt::Timer expire_timer; - QString table_file; - QTimer update_timer; + TQString table_file; + TQTimer update_timer; }; } diff --git a/libktorrent/kademlia/dhtbase.h b/libktorrent/kademlia/dhtbase.h index dfa880a..05699c8 100644 --- a/libktorrent/kademlia/dhtbase.h +++ b/libktorrent/kademlia/dhtbase.h @@ -20,10 +20,10 @@ #ifndef DHTDHTBASE_H #define DHTDHTBASE_H -#include <qobject.h> +#include <tqobject.h> #include <util/constants.h> -class QString; +class TQString; namespace bt { @@ -48,9 +48,10 @@ namespace dht * Interface for DHT class, this is to keep other things separate from the inner workings * of the DHT. */ - class DHTBase : public QObject + class DHTBase : public TQObject { Q_OBJECT + TQ_OBJECT public: DHTBase(); virtual ~DHTBase(); @@ -62,7 +63,7 @@ namespace dht * @param key_file The file where the key is stored * @param port The port to use */ - virtual void start(const QString & table,const QString & key_file,bt::Uint16 port) = 0; + virtual void start(const TQString & table,const TQString & key_file,bt::Uint16 port) = 0; /** * Stop the DHT @@ -79,7 +80,7 @@ namespace dht * @param ip The IP of the peer * @param port The port in the PORT message */ - virtual void portRecieved(const QString & ip,bt::Uint16 port) = 0; + virtual void portRecieved(const TQString & ip,bt::Uint16 port) = 0; /** * Do an announce on the DHT network @@ -105,14 +106,14 @@ namespace dht * @param host The hostname or ip * @param hport The port of the host */ - virtual void addDHTNode(const QString & host,bt::Uint16 hport) = 0; + virtual void addDHTNode(const TQString & host,bt::Uint16 hport) = 0; /** * Returns maxNodes number of <IP address, port> nodes * that are closest to ourselves and are good. - * @param maxNodes maximum nr of nodes in QMap to return. + * @param maxNodes maximum nr of nodes in TQMap to return. */ - virtual QMap<QString, int> getClosestGoodNodes(int maxNodes) = 0; + virtual TQMap<TQString, int> getClosestGoodNodes(int maxNodes) = 0; signals: void started(); diff --git a/libktorrent/kademlia/dhttrackerbackend.cpp b/libktorrent/kademlia/dhttrackerbackend.cpp index c90e6f7..96277a3 100644 --- a/libktorrent/kademlia/dhttrackerbackend.cpp +++ b/libktorrent/kademlia/dhttrackerbackend.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <kurl.h> -#include <qhostaddress.h> +#include <tqhostaddress.h> #include <util/log.h> #include <util/functions.h> #include <torrent/globals.h> @@ -37,9 +37,9 @@ namespace dht DHTTrackerBackend::DHTTrackerBackend(DHTBase & dh_table,kt::TorrentInterface* tor) : dh_table(dh_table),curr_task(0),tor(tor) { - connect(&timer,SIGNAL(timeout()),this,SLOT(onTimeout())); - connect(&dh_table,SIGNAL(started()),this,SLOT(manualUpdate())); - connect(&dh_table,SIGNAL(stopped()),this,SLOT(dhtStopped())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onTimeout())); + connect(&dh_table,TQT_SIGNAL(started()),this,TQT_SLOT(manualUpdate())); + connect(&dh_table,TQT_SIGNAL(stopped()),this,TQT_SLOT(dhtStopped())); started = false; } @@ -98,8 +98,8 @@ namespace dht const kt::DHTNode & n = tor->getDHTNode(i); curr_task->addDHTNode(n.ip,n.port); } - connect(curr_task,SIGNAL(dataReady( Task* )),this,SLOT(onDataReady( Task* ))); - connect(curr_task,SIGNAL(finished( Task* )),this,SLOT(onFinished( Task* ))); + connect(curr_task,TQT_SIGNAL(dataReady( Task* )),this,TQT_SLOT(onDataReady( Task* ))); + connect(curr_task,TQT_SIGNAL(finished( Task* )),this,TQT_SLOT(onFinished( Task* ))); return true; } @@ -127,7 +127,7 @@ namespace dht while (curr_task->takeItem(item)) { Uint16 port = bt::ReadUint16(item.getData(),4); - QString ip = QHostAddress(ReadUint32(item.getData(),0)).toString(); + TQString ip = TQHostAddress(ReadUint32(item.getData(),0)).toString(); addPeer(ip,port); cnt++; @@ -136,8 +136,8 @@ namespace dht if (cnt) { Out(SYS_DHT|LOG_NOTICE) << - QString("DHT: Got %1 potential peers for torrent %2") - .arg(cnt).arg(tor->getStats().torrent_name) << endl; + TQString("DHT: Got %1 potential peers for torrent %2") + .tqarg(cnt).tqarg(tor->getStats().torrent_name) << endl; peersReady(this); } } diff --git a/libktorrent/kademlia/dhttrackerbackend.h b/libktorrent/kademlia/dhttrackerbackend.h index 355aab9..91141c8 100644 --- a/libktorrent/kademlia/dhttrackerbackend.h +++ b/libktorrent/kademlia/dhttrackerbackend.h @@ -20,7 +20,7 @@ #ifndef DHTDHTTRACKERBACKEND_H #define DHTDHTTRACKERBACKEND_H -#include <qtimer.h> +#include <tqtimer.h> #include <interfaces/peersource.h> #include "task.h" @@ -47,6 +47,7 @@ namespace dht class DHTTrackerBackend : public kt::PeerSource { Q_OBJECT + TQ_OBJECT public: DHTTrackerBackend(DHTBase & dh_table,kt::TorrentInterface* tor); virtual ~DHTTrackerBackend(); @@ -66,7 +67,7 @@ namespace dht DHTBase & dh_table; AnnounceTask* curr_task; kt::TorrentInterface* tor; - QTimer timer; + TQTimer timer; bool started; }; diff --git a/libktorrent/kademlia/kbucket.cpp b/libktorrent/kademlia/kbucket.cpp index fb60d1b..76986b9 100644 --- a/libktorrent/kademlia/kbucket.cpp +++ b/libktorrent/kademlia/kbucket.cpp @@ -119,7 +119,7 @@ namespace dht void KBucket::insert(const KBucketEntry & entry) { - QValueList<KBucketEntry>::iterator i = entries.find(entry); + TQValueList<KBucketEntry>::iterator i = entries.tqfind(entry); // If in the list, move it to the end if (i != entries.end()) @@ -149,7 +149,7 @@ namespace dht { last_modified = bt::GetCurrentTime(); - if (!pending_entries_busy_pinging.contains(c)) + if (!pending_entries_busy_pinging.tqcontains(c)) return; KBucketEntry entry = pending_entries_busy_pinging[c]; @@ -166,13 +166,13 @@ namespace dht void KBucket::onTimeout(RPCCall* c) { - if (!pending_entries_busy_pinging.contains(c)) + if (!pending_entries_busy_pinging.tqcontains(c)) return; KBucketEntry entry = pending_entries_busy_pinging[c]; // replace the entry which timed out - QValueList<KBucketEntry>::iterator i; + TQValueList<KBucketEntry>::iterator i; for (i = entries.begin();i != entries.end();i++) { KBucketEntry & e = *i; @@ -203,7 +203,7 @@ namespace dht return; } - QValueList<KBucketEntry>::iterator i; + TQValueList<KBucketEntry>::iterator i; // we haven't found any bad ones so try the questionable ones for (i = entries.begin();i != entries.end();i++) { @@ -228,7 +228,7 @@ namespace dht bool KBucket::replaceBadEntry(const KBucketEntry & entry) { - QValueList<KBucketEntry>::iterator i; + TQValueList<KBucketEntry>::iterator i; for (i = entries.begin();i != entries.end();i++) { KBucketEntry & e = *i; @@ -244,14 +244,14 @@ namespace dht return false; } - bool KBucket::contains(const KBucketEntry & entry) const + bool KBucket::tqcontains(const KBucketEntry & entry) const { - return entries.contains(entry); + return entries.tqcontains(entry); } void KBucket::findKClosestNodes(KClosestNodesSearch & kns) { - QValueList<KBucketEntry>::iterator i = entries.begin(); + TQValueList<KBucketEntry>::iterator i = entries.begin(); while (i != entries.end()) { kns.tryInsert(*i); @@ -261,7 +261,7 @@ namespace dht bool KBucket::onTimeout(const KInetSocketAddress & addr) { - QValueList<KBucketEntry>::iterator i; + TQValueList<KBucketEntry>::iterator i; for (i = entries.begin();i != entries.end();i++) { @@ -302,7 +302,7 @@ namespace dht hdr.num_entries = entries.count(); fptr.write(&hdr,sizeof(BucketHeader)); - QValueList<KBucketEntry>::iterator i; + TQValueList<KBucketEntry>::iterator i; for (i = entries.begin();i != entries.end();i++) { KBucketEntry & e = *i; @@ -345,8 +345,8 @@ namespace dht refresh_task = t; if (refresh_task) { - connect(refresh_task,SIGNAL(finished( Task* )), - this,SLOT(onFinished( Task* ))); + connect(refresh_task,TQT_SIGNAL(finished( Task* )), + this,TQT_SLOT(onFinished( Task* ))); } } diff --git a/libktorrent/kademlia/kbucket.h b/libktorrent/kademlia/kbucket.h index 139ce10..cfd932d 100644 --- a/libktorrent/kademlia/kbucket.h +++ b/libktorrent/kademlia/kbucket.h @@ -20,7 +20,7 @@ #ifndef DHTKBUCKET_H #define DHTKBUCKET_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/constants.h> #include <ksocketaddress.h> #include "key.h" @@ -143,12 +143,13 @@ namespace dht class KBucket : public RPCCallListener { Q_OBJECT + TQ_OBJECT Uint32 idx; - QValueList<KBucketEntry> entries,pending_entries; + TQValueList<KBucketEntry> entries,pending_entries; RPCServer* srv; Node* node; - QMap<RPCCall*,KBucketEntry> pending_entries_busy_pinging; + TQMap<RPCCall*,KBucketEntry> pending_entries_busy_pinging; mutable bt::TimeStamp last_modified; Task* refresh_task; public: @@ -168,7 +169,7 @@ namespace dht Uint32 getNumEntries() const {return entries.count();} /// See if this bucket contains an entry - bool contains(const KBucketEntry & entry) const; + bool tqcontains(const KBucketEntry & entry) const; /** * Find the K closest entries to a key and store them in the KClosestNodesSearch diff --git a/libktorrent/kademlia/kclosestnodessearch.cpp b/libktorrent/kademlia/kclosestnodessearch.cpp index 4a97c7f..5421b6c 100644 --- a/libktorrent/kademlia/kclosestnodessearch.cpp +++ b/libktorrent/kademlia/kclosestnodessearch.cpp @@ -65,7 +65,7 @@ namespace dht } - void KClosestNodesSearch::pack(QByteArray & ba) + void KClosestNodesSearch::pack(TQByteArray & ba) { // make sure we do not writ to much Uint32 max_items = ba.size() / 26; diff --git a/libktorrent/kademlia/kclosestnodessearch.h b/libktorrent/kademlia/kclosestnodessearch.h index e006a25..f4b460d 100644 --- a/libktorrent/kademlia/kclosestnodessearch.h +++ b/libktorrent/kademlia/kclosestnodessearch.h @@ -31,7 +31,7 @@ namespace dht * @author Joris Guisson <[email protected]> * * Class used to store the search results during a K closests nodes search - * Note: we use a std::map because of lack of functionality in QMap + * Note: we use a std::map because of lack of functionality in TQMap */ class KClosestNodesSearch { @@ -82,7 +82,7 @@ namespace dht * enough space to store requiredSpace() bytes. * @param ba The buffer */ - void pack(QByteArray & ba); + void pack(TQByteArray & ba); }; } diff --git a/libktorrent/kademlia/key.cpp b/libktorrent/kademlia/key.cpp index 6e62ff6..35ecfff 100644 --- a/libktorrent/kademlia/key.cpp +++ b/libktorrent/kademlia/key.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include <time.h> #include <stdlib.h> -#include <qcstring.h> +#include <tqcstring.h> #include <util/constants.h> #include "key.h" @@ -39,7 +39,7 @@ namespace dht { } - Key::Key(const QByteArray & ba) + Key::Key(const TQByteArray & ba) { for (Uint32 i = 0;i < 20 && i < ba.size();i++) hash[i] = ba[i]; diff --git a/libktorrent/kademlia/key.h b/libktorrent/kademlia/key.h index e818dc1..e383a5e 100644 --- a/libktorrent/kademlia/key.h +++ b/libktorrent/kademlia/key.h @@ -20,7 +20,7 @@ #ifndef DHTKEY_H #define DHTKEY_H -#include <qcstring.h> +#include <tqcstring.h> #include <util/sha1hash.h> @@ -52,9 +52,9 @@ namespace dht /** * Make a key out of a bytearray - * @param ba The QByteArray + * @param ba The TQByteArray */ - Key(const QByteArray & ba); + Key(const TQByteArray & ba); /** * Make a key out of a 20 byte array. diff --git a/libktorrent/kademlia/node.cpp b/libktorrent/kademlia/node.cpp index 96c39a4..bd450e4 100644 --- a/libktorrent/kademlia/node.cpp +++ b/libktorrent/kademlia/node.cpp @@ -37,7 +37,7 @@ using namespace KNetwork; namespace dht { - static void SaveKey(const dht::Key & key,const QString & key_file) + static void SaveKey(const dht::Key & key,const TQString & key_file) { bt::File fptr; if (!fptr.open(key_file,"wb")) @@ -50,7 +50,7 @@ namespace dht fptr.close(); } - static dht::Key LoadKey(const QString & key_file,bool & new_key) + static dht::Key LoadKey(const TQString & key_file,bool & new_key) { bt::File fptr; if (!fptr.open(key_file,"rb")) @@ -75,7 +75,7 @@ namespace dht return dht::Key(data); } - Node::Node(RPCServer* srv,const QString & key_file) : srv(srv) + Node::Node(RPCServer* srv,const TQString & key_file) : srv(srv) { num_receives = 0; num_entries = 0; @@ -224,7 +224,7 @@ namespace dht } - void Node::saveTable(const QString & file) + void Node::saveTable(const TQString & file) { bt::File fptr; if (!fptr.open(file,"wb")) @@ -243,7 +243,7 @@ namespace dht } } - void Node::loadTable(const QString & file) + void Node::loadTable(const TQString & file) { if (delete_table) { diff --git a/libktorrent/kademlia/node.h b/libktorrent/kademlia/node.h index 56f41f1..7d871e0 100644 --- a/libktorrent/kademlia/node.h +++ b/libktorrent/kademlia/node.h @@ -20,7 +20,7 @@ #ifndef DHTNODE_H #define DHTNODE_H -#include <qobject.h> +#include <tqobject.h> #include "key.h" #include "kbucket.h" @@ -37,16 +37,17 @@ namespace dht /** * @author Joris Guisson * - * A Node represents us in the kademlia network. It contains + * A Node represents us in the kademlia network. It tqcontains * our id and 160 KBucket's. * A KBucketEntry is in node i, when the difference between our id and * the KBucketEntry's id is between 2 to the power i and 2 to the power i+1. */ - class Node : public QObject + class Node : public TQObject { Q_OBJECT + TQ_OBJECT public: - Node(RPCServer* srv,const QString & key_file); + Node(RPCServer* srv,const TQString & key_file); virtual ~Node(); /** @@ -77,10 +78,10 @@ namespace dht void refreshBuckets(DHT* dh_table); /// Save the routing table to a file - void saveTable(const QString & file); + void saveTable(const TQString & file); /// Load the routing table from a file - void loadTable(const QString & file); + void loadTable(const TQString & file); /// Get the number of entries in the routing table Uint32 getNumEntriesInRoutingTable() const {return num_entries;} diff --git a/libktorrent/kademlia/nodelookup.cpp b/libktorrent/kademlia/nodelookup.cpp index 9fa616c..9175f7d 100644 --- a/libktorrent/kademlia/nodelookup.cpp +++ b/libktorrent/kademlia/nodelookup.cpp @@ -49,14 +49,14 @@ namespace dht if (rsp->getMethod() == dht::FIND_NODE && rsp->getType() == dht::RSP_MSG) { FindNodeRsp* fnr = (FindNodeRsp*)rsp; - const QByteArray & nodes = fnr->getNodes(); + const TQByteArray & nodes = fnr->getNodes(); Uint32 nnodes = nodes.size() / 26; for (Uint32 j = 0;j < nnodes;j++) { // unpack an entry and add it to the todo list KBucketEntry e = UnpackBucketEntry(nodes,j*26); // lets not talk to ourself - if (e.getID() != node->getOurID() && !todo.contains(e) && !visited.contains(e)) + if (e.getID() != node->getOurID() && !todo.tqcontains(e) && !visited.tqcontains(e)) todo.append(e); } num_nodes_rsp++; @@ -78,7 +78,7 @@ namespace dht { KBucketEntry e = todo.first(); // only send a findNode if we haven't allrready visited the node - if (!visited.contains(e)) + if (!visited.tqcontains(e)) { // send a findNode to the node FindNodeReq* fnr = new FindNodeReq(node->getOurID(),node_id); diff --git a/libktorrent/kademlia/pack.cpp b/libktorrent/kademlia/pack.cpp index a5acafb..200c686 100644 --- a/libktorrent/kademlia/pack.cpp +++ b/libktorrent/kademlia/pack.cpp @@ -27,7 +27,7 @@ using namespace KNetwork; namespace dht { - void PackBucketEntry(const KBucketEntry & e,QByteArray & ba,Uint32 off) + void PackBucketEntry(const KBucketEntry & e,TQByteArray & ba,Uint32 off) { // first check size if (off + 26 > ba.size()) @@ -43,7 +43,7 @@ namespace dht bt::WriteUint16(ptr,24,addr.port()); } - KBucketEntry UnpackBucketEntry(const QByteArray & ba,Uint32 off) + KBucketEntry UnpackBucketEntry(const TQByteArray & ba,Uint32 off) { if (off + 26 > ba.size()) throw bt::Error("Not enough room in buffer"); diff --git a/libktorrent/kademlia/pack.h b/libktorrent/kademlia/pack.h index dab1523..46c2405 100644 --- a/libktorrent/kademlia/pack.h +++ b/libktorrent/kademlia/pack.h @@ -32,7 +32,7 @@ namespace dht * @param ba The byte array * @param off The offset into the array */ - void PackBucketEntry(const KBucketEntry & e,QByteArray & ba,Uint32 off); + void PackBucketEntry(const KBucketEntry & e,TQByteArray & ba,Uint32 off); /** * Unpack a KBucketEntry from a byte array. @@ -41,7 +41,7 @@ namespace dht * @param off The offset * @return The entry */ - KBucketEntry UnpackBucketEntry(const QByteArray & ba,Uint32 off); + KBucketEntry UnpackBucketEntry(const TQByteArray & ba,Uint32 off); } diff --git a/libktorrent/kademlia/rpccall.cpp b/libktorrent/kademlia/rpccall.cpp index b86e8f7..9ed926a 100644 --- a/libktorrent/kademlia/rpccall.cpp +++ b/libktorrent/kademlia/rpccall.cpp @@ -33,7 +33,7 @@ namespace dht RPCCall::RPCCall(RPCServer* rpc,MsgBase* msg,bool queued) : msg(msg),rpc(rpc),queued(queued) { - connect(&timer,SIGNAL(timeout()),this,SLOT(onTimeout())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onTimeout())); if (!queued) timer.start(30*1000,true); } @@ -71,8 +71,8 @@ namespace dht void RPCCall::addListener(RPCCallListener* cl) { - connect(this,SIGNAL(onCallResponse( RPCCall*, MsgBase* )),cl,SLOT(onResponse( RPCCall*, MsgBase* ))); - connect(this,SIGNAL(onCallTimeout( RPCCall* )),cl,SLOT(onTimeout( RPCCall* ))); + connect(this,TQT_SIGNAL(onCallResponse( RPCCall*, MsgBase* )),cl,TQT_SLOT(onResponse( RPCCall*, MsgBase* ))); + connect(this,TQT_SIGNAL(onCallTimeout( RPCCall* )),cl,TQT_SLOT(onTimeout( RPCCall* ))); } } diff --git a/libktorrent/kademlia/rpccall.h b/libktorrent/kademlia/rpccall.h index 6e54933..2a9682e 100644 --- a/libktorrent/kademlia/rpccall.h +++ b/libktorrent/kademlia/rpccall.h @@ -20,7 +20,7 @@ #ifndef DHTRPCCALL_H #define DHTRPCCALL_H -#include <qtimer.h> +#include <tqtimer.h> #include "key.h" #include "rpcmsg.h" @@ -32,9 +32,10 @@ namespace dht /** * Class which objects should derive from, if they want to know the result of a call. */ - class RPCCallListener : public QObject + class RPCCallListener : public TQObject { Q_OBJECT + TQ_OBJECT public: RPCCallListener(); virtual ~RPCCallListener(); @@ -58,9 +59,10 @@ namespace dht /** * @author Joris Guisson */ - class RPCCall : public QObject + class RPCCall : public TQObject { Q_OBJECT + TQ_OBJECT public: RPCCall(RPCServer* rpc,MsgBase* msg,bool queued); virtual ~RPCCall(); @@ -100,7 +102,7 @@ namespace dht private: MsgBase* msg; - QTimer timer; + TQTimer timer; RPCServer* rpc; bool queued; }; diff --git a/libktorrent/kademlia/rpcmsg.cpp b/libktorrent/kademlia/rpcmsg.cpp index 97364e1..53cb4f1 100644 --- a/libktorrent/kademlia/rpcmsg.cpp +++ b/libktorrent/kademlia/rpcmsg.cpp @@ -30,14 +30,14 @@ using namespace bt; namespace dht { - const QString TID = "t"; - const QString REQ = "q"; - const QString RSP = "r"; - const QString TYP = "y"; - const QString ARG = "a"; - // ERR apparently is defined as a macro on solaris in some header file, + const TQString TID = "t"; + const TQString REQ = "q"; + const TQString RSP = "r"; + const TQString TYP = "y"; + const TQString ARG = "a"; + // ERR aptqparently is defined as a macro on solaris in some header file, // which causes things not to compile on it, so we have changed it to ERR_DHT - const QString ERR_DHT = "e"; + const TQString ERR_DHT = "e"; MsgBase* MakeMsg(bt::BDictNode* dict); @@ -57,13 +57,13 @@ namespace dht return 0; Key id = Key(args->getValue("id")->data().toByteArray()); - QByteArray mtid_d = dict->getValue(TID)->data().toByteArray(); + TQByteArray mtid_d = dict->getValue(TID)->data().toByteArray(); if (mtid_d.size() == 0) return 0; Uint8 mtid = (Uint8)mtid_d.at(0); MsgBase* msg = 0; - QString str = vn->data().toString(); + TQString str = vn->data().toString(); if (str == "ping") { msg = new PingReq(id); @@ -116,7 +116,7 @@ namespace dht if (args->getValue("token")) { Key token = args->getValue("token")->data().toByteArray(); - QByteArray data; + TQByteArray data; BListNode* vals = args->getList("values"); DBItemList dbl; if (vals) @@ -163,7 +163,7 @@ namespace dht } - QByteArray ba = dict->getValue(TID)->data().toByteArray(); + TQByteArray ba = dict->getValue(TID)->data().toByteArray(); // check for empty byte arrays should prevent 144416 if (ba.size() == 0) return 0; @@ -188,12 +188,12 @@ namespace dht return 0; Key id = Key(args->getValue("id")->data().toByteArray()); - QString mt_id = dict->getValue(TID)->data().toString(); + TQString mt_id = dict->getValue(TID)->data().toString(); if (mt_id.length() == 0) return 0; - Uint8 mtid = (char)mt_id.at(0).latin1(); - QString str = vn->data().toString(); + Uint8 mtid = (char)mt_id.tqat(0).latin1(); + TQString str = vn->data().toString(); return new ErrMsg(mtid,id,str); } @@ -252,7 +252,7 @@ namespace dht //////////////////////////////// - PingReq::PingReq(const Key & id) : MsgBase(0xFF,PING,REQ_MSG,id) + PingReq::PingReq(const Key & id) : MsgBase(0xFF,PING,RETQ_MSG,id) { } @@ -266,20 +266,20 @@ namespace dht void PingReq::print() { - Out(SYS_DHT|LOG_DEBUG) << QString("REQ: %1 %2 : ping").arg(mtid).arg(id.toString()) << endl; + Out(SYS_DHT|LOG_DEBUG) << TQString("REQ: %1 %2 : ping").tqarg(mtid).tqarg(id.toString()) << endl; } - void PingReq::encode(QByteArray & arr) + void PingReq::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(ARG); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); } enc.end(); - enc.write(REQ); enc.write("ping"); + enc.write(REQ); enc.write(TQString("ping")); enc.write(TID); enc.write(&mtid,1); enc.write(TYP); enc.write(REQ); } @@ -289,7 +289,7 @@ namespace dht //////////////////////////////// FindNodeReq::FindNodeReq(const Key & id,const Key & target) - : MsgBase(0xFF,FIND_NODE,REQ_MSG,id),target(target) + : MsgBase(0xFF,FIND_NODE,RETQ_MSG,id),target(target) {} FindNodeReq::~FindNodeReq() @@ -302,22 +302,22 @@ namespace dht void FindNodeReq::print() { - Out(SYS_DHT|LOG_NOTICE) << QString("REQ: %1 %2 : find_node %3") - .arg(mtid).arg(id.toString()).arg(target.toString()) << endl; + Out(SYS_DHT|LOG_NOTICE) << TQString("REQ: %1 %2 : find_node %3") + .tqarg(mtid).tqarg(id.toString()).tqarg(target.toString()) << endl; } - void FindNodeReq::encode(QByteArray & arr) + void FindNodeReq::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(ARG); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); - enc.write("target"); enc.write(target.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); + enc.write(TQString("target")); enc.write(target.getData(),20); } enc.end(); - enc.write(REQ); enc.write("find_node"); + enc.write(REQ); enc.write(TQString("find_node")); enc.write(TID); enc.write(&mtid,1); enc.write(TYP); enc.write(REQ); } @@ -328,7 +328,7 @@ namespace dht //////////////////////////////// GetPeersReq::GetPeersReq(const Key & id,const Key & info_hash) - : MsgBase(0xFF,GET_PEERS,REQ_MSG,id),info_hash(info_hash) + : MsgBase(0xFF,GET_PEERS,RETQ_MSG,id),info_hash(info_hash) {} GetPeersReq::~GetPeersReq() @@ -341,22 +341,22 @@ namespace dht void GetPeersReq::print() { - Out(SYS_DHT|LOG_DEBUG) << QString("REQ: %1 %2 : get_peers %3") - .arg(mtid).arg(id.toString()).arg(info_hash.toString()) << endl; + Out(SYS_DHT|LOG_DEBUG) << TQString("REQ: %1 %2 : get_peers %3") + .tqarg(mtid).tqarg(id.toString()).tqarg(info_hash.toString()) << endl; } - void GetPeersReq::encode(QByteArray & arr) + void GetPeersReq::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(ARG); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); - enc.write("info_hash"); enc.write(info_hash.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); + enc.write(TQString("info_hash")); enc.write(info_hash.getData(),20); } enc.end(); - enc.write(REQ); enc.write("get_peers"); + enc.write(REQ); enc.write(TQString("get_peers")); enc.write(TID); enc.write(&mtid,1); enc.write(TYP); enc.write(REQ); } @@ -380,25 +380,25 @@ namespace dht void AnnounceReq::print() { - Out(SYS_DHT|LOG_DEBUG) << QString("REQ: %1 %2 : announce_peer %3 %4 %5") - .arg(mtid).arg(id.toString()).arg(info_hash.toString()) - .arg(port).arg(token.toString()) << endl; + Out(SYS_DHT|LOG_DEBUG) << TQString("REQ: %1 %2 : announce_peer %3 %4 %5") + .tqarg(mtid).tqarg(id.toString()).tqarg(info_hash.toString()) + .tqarg(port).tqarg(token.toString()) << endl; } - void AnnounceReq::encode(QByteArray & arr) + void AnnounceReq::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(ARG); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); - enc.write("info_hash"); enc.write(info_hash.getData(),20); - enc.write("port"); enc.write((Uint32)port); - enc.write("token"); enc.write(token.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); + enc.write(TQString("info_hash")); enc.write(info_hash.getData(),20); + enc.write(TQString("port")); enc.write((Uint32)port); + enc.write(TQString("token")); enc.write(token.getData(),20); } enc.end(); - enc.write(REQ); enc.write("announce_peer"); + enc.write(REQ); enc.write(TQString("announce_peer")); enc.write(TID); enc.write(&mtid,1); enc.write(TYP); enc.write(REQ); } @@ -420,18 +420,18 @@ namespace dht void PingRsp::print() { - Out(SYS_DHT|LOG_DEBUG) << QString("RSP: %1 %2 : ping") - .arg(mtid).arg(id.toString()) << endl; + Out(SYS_DHT|LOG_DEBUG) << TQString("RSP: %1 %2 : ping") + .tqarg(mtid).tqarg(id.toString()) << endl; } - void PingRsp::encode(QByteArray & arr) + void PingRsp::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(RSP); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); } enc.end(); enc.write(TID); enc.write(&mtid,1); @@ -442,7 +442,7 @@ namespace dht //////////////////////////////// - FindNodeRsp::FindNodeRsp(Uint8 mtid,const Key & id,const QByteArray & nodes) + FindNodeRsp::FindNodeRsp(Uint8 mtid,const Key & id,const TQByteArray & nodes) : MsgBase(mtid,FIND_NODE,RSP_MSG,id),nodes(nodes) {} @@ -455,19 +455,19 @@ namespace dht void FindNodeRsp::print() { - Out(SYS_DHT|LOG_DEBUG) << QString("RSP: %1 %2 : find_node") - .arg(mtid).arg(id.toString()) << endl; + Out(SYS_DHT|LOG_DEBUG) << TQString("RSP: %1 %2 : find_node") + .tqarg(mtid).tqarg(id.toString()) << endl; } - void FindNodeRsp::encode(QByteArray & arr) + void FindNodeRsp::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(RSP); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); - enc.write("nodes"); enc.write(nodes); + enc.write(TQString("id")); enc.write(id.getData(),20); + enc.write(TQString("nodes")); enc.write(nodes); } enc.end(); enc.write(TID); enc.write(&mtid,1); @@ -478,7 +478,7 @@ namespace dht //////////////////////////////// - GetPeersRsp::GetPeersRsp(Uint8 mtid,const Key & id,const QByteArray & data,const Key & token) + GetPeersRsp::GetPeersRsp(Uint8 mtid,const Key & id,const TQByteArray & data,const Key & token) : MsgBase(mtid,dht::GET_PEERS,dht::RSP_MSG,id),token(token),data(data) { this->data.detach(); @@ -497,27 +497,27 @@ namespace dht } void GetPeersRsp::print() { - Out() << QString("RSP: %1 %2 : get_peers(%3)") - .arg(mtid).arg(id.toString()).arg(data.size() > 0 ? "nodes" : "values") << endl; + Out() << TQString("RSP: %1 %2 : get_peers(%3)") + .tqarg(mtid).tqarg(id.toString()).tqarg(data.size() > 0 ? "nodes" : "values") << endl; } - void GetPeersRsp::encode(QByteArray & arr) + void GetPeersRsp::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(RSP); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); if (data.size() > 0) { - enc.write("nodes"); enc.write(data); - enc.write("token"); enc.write(token.getData(),20); + enc.write(TQString("nodes")); enc.write(data); + enc.write(TQString("token")); enc.write(token.getData(),20); } else { - enc.write("token"); enc.write(token.getData(),20); - enc.write("values"); enc.beginList(); + enc.write(TQString("token")); enc.write(token.getData(),20); + enc.write(TQString("values")); enc.beginList(); DBItemList::iterator i = items.begin(); while (i != items.end()) { @@ -551,18 +551,18 @@ namespace dht void AnnounceRsp::print() { - Out() << QString("RSP: %1 %2 : announce_peer") - .arg(mtid).arg(id.toString()) << endl; + Out() << TQString("RSP: %1 %2 : announce_peer") + .tqarg(mtid).tqarg(id.toString()) << endl; } - void AnnounceRsp::encode(QByteArray & arr) + void AnnounceRsp::encode(TQByteArray & arr) { BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); { enc.write(RSP); enc.beginDict(); { - enc.write("id"); enc.write(id.getData(),20); + enc.write(TQString("id")); enc.write(id.getData(),20); } enc.end(); enc.write(TID); enc.write(&mtid,1); @@ -574,7 +574,7 @@ namespace dht //////////////////////////////// - ErrMsg::ErrMsg(Uint8 mtid,const Key & id,const QString & msg) + ErrMsg::ErrMsg(Uint8 mtid,const Key & id,const TQString & msg) : MsgBase(mtid,NONE,ERR_MSG,id),msg(msg) {} @@ -591,6 +591,6 @@ namespace dht Out(SYS_DHT|LOG_NOTICE) << "ERR: " << mtid << " " << msg << endl; } - void ErrMsg::encode(QByteArray & ) + void ErrMsg::encode(TQByteArray & ) {} } diff --git a/libktorrent/kademlia/rpcmsg.h b/libktorrent/kademlia/rpcmsg.h index 4863ae2..7e04d7a 100644 --- a/libktorrent/kademlia/rpcmsg.h +++ b/libktorrent/kademlia/rpcmsg.h @@ -40,7 +40,7 @@ namespace dht enum Type { - REQ_MSG, + RETQ_MSG, RSP_MSG, ERR_MSG, INVALID @@ -83,7 +83,7 @@ namespace dht * BEncode the message. * @param arr Data array */ - virtual void encode(QByteArray & arr) = 0; + virtual void encode(TQByteArray & arr) = 0; /// Set the origin (i.e. where the message came from) void setOrigin(const KNetwork::KSocketAddress & o) {origin = o;} @@ -133,14 +133,14 @@ namespace dht class ErrMsg : public MsgBase { public: - ErrMsg(Uint8 mtid,const Key & id,const QString & msg); + ErrMsg(Uint8 mtid,const Key & id,const TQString & msg); virtual ~ErrMsg(); virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); private: - QString msg; + TQString msg; }; class PingReq : public MsgBase @@ -151,7 +151,7 @@ namespace dht virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); }; class FindNodeReq : public MsgBase @@ -162,7 +162,7 @@ namespace dht virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); const Key & getTarget() const {return target;} @@ -179,7 +179,7 @@ namespace dht const Key & getInfoHash() const {return info_hash;} virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); protected: Key info_hash; }; @@ -192,7 +192,7 @@ namespace dht virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); const Key & getToken() const {return token;} bt::Uint16 getPort() const {return port;} @@ -209,7 +209,7 @@ namespace dht virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); }; @@ -217,37 +217,37 @@ namespace dht class FindNodeRsp : public MsgBase { public: - FindNodeRsp(Uint8 mtid,const Key & id,const QByteArray & nodes); + FindNodeRsp(Uint8 mtid,const Key & id,const TQByteArray & nodes); virtual ~FindNodeRsp(); virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); - const QByteArray & getNodes() const {return nodes;} + const TQByteArray & getNodes() const {return nodes;} protected: - QByteArray nodes; + TQByteArray nodes; }; class GetPeersRsp : public MsgBase { public: - GetPeersRsp(Uint8 mtid,const Key & id,const QByteArray & data,const Key & token); + GetPeersRsp(Uint8 mtid,const Key & id,const TQByteArray & data,const Key & token); GetPeersRsp(Uint8 mtid,const Key & id,const DBItemList & values,const Key & token); virtual ~GetPeersRsp(); virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); - const QByteArray & getData() const {return data;} + const TQByteArray & getData() const {return data;} const DBItemList & getItemList() const {return items;} const Key & getToken() const {return token;} bool containsNodes() const {return data.size() > 0;} bool containsValues() const {return data.size() == 0;} private: Key token; - QByteArray data; + TQByteArray data; DBItemList items; }; @@ -260,7 +260,7 @@ namespace dht virtual void apply(DHT* dh_table); virtual void print(); - virtual void encode(QByteArray & arr); + virtual void encode(TQByteArray & arr); }; diff --git a/libktorrent/kademlia/rpcserver.cpp b/libktorrent/kademlia/rpcserver.cpp index 1242dae..9f65b95 100644 --- a/libktorrent/kademlia/rpcserver.cpp +++ b/libktorrent/kademlia/rpcserver.cpp @@ -42,7 +42,7 @@ namespace dht - RPCServer::RPCServer(DHT* dh_table,Uint16 port,QObject *parent) : QObject(parent),dh_table(dh_table),next_mtid(0),port(port) + RPCServer::RPCServer(DHT* dh_table,Uint16 port,TQObject *tqparent) : TQObject(tqparent),dh_table(dh_table),next_mtid(0),port(port) { sock = new KDatagramSocket(this); sock->setBlocking(false); @@ -63,7 +63,7 @@ namespace dht void RPCServer::start() { sock->setBlocking(true); - if (!sock->bind(QString::null,QString::number(port))) + if (!sock->bind(TQString(),TQString::number(port))) { Out(SYS_DHT|LOG_IMPORTANT) << "DHT: Failed to bind to UDP port " << port << " for DHT" << endl; } @@ -72,7 +72,7 @@ namespace dht bt::Globals::instance().getPortList().addNewPort(port,net::UDP,true); } sock->setBlocking(false); - connect(sock,SIGNAL(readyRead()),this,SLOT(readPacket())); + connect(sock,TQT_SIGNAL(readyRead()),this,TQT_SLOT(readPacket())); } void RPCServer::stop() @@ -81,13 +81,13 @@ namespace dht sock->close(); } - static void PrintRawData(const QByteArray & data) + static void PrintRawData(const TQByteArray & data) { - QString tmp; + TQString tmp; for (Uint32 i = 0;i < data.size();i++) { - char c = QChar(data[i]).latin1(); - if (!QChar(data[i]).isPrint() || c == 0) + char c = TQChar(data[i]).latin1(); + if (!TQChar(data[i]).isPrint() || c == 0) tmp += '#'; else tmp += c; @@ -134,10 +134,10 @@ namespace dht msg->setOrigin(pck.address()); msg->apply(dh_table); // erase an existing call - if (msg->getType() == RSP_MSG && calls.contains(msg->getMTID())) + if (msg->getType() == RSP_MSG && calls.tqcontains(msg->getMTID())) { // delete the call, but first notify it off the response - RPCCall* c = calls.find(msg->getMTID()); + RPCCall* c = calls.tqfind(msg->getMTID()); c->response(msg); calls.erase(msg->getMTID()); c->deleteLater(); @@ -157,7 +157,7 @@ namespace dht } - void RPCServer::send(const KNetwork::KSocketAddress & addr,const QByteArray & msg) + void RPCServer::send(const KNetwork::KSocketAddress & addr,const TQByteArray & msg) { sock->send(KNetwork::KDatagramPacket(msg,addr)); } @@ -165,7 +165,7 @@ namespace dht RPCCall* RPCServer::doCall(MsgBase* msg) { Uint8 start = next_mtid; - while (calls.contains(next_mtid)) + while (calls.tqcontains(next_mtid)) { next_mtid++; if (next_mtid == start) // if this happens we cannot do any calls @@ -187,7 +187,7 @@ namespace dht void RPCServer::sendMsg(MsgBase* msg) { - QByteArray data; + TQByteArray data; msg->encode(data); send(msg->getDestination(),data); @@ -197,7 +197,7 @@ namespace dht void RPCServer::timedOut(Uint8 mtid) { // delete the call - RPCCall* c = calls.find(mtid); + RPCCall* c = calls.tqfind(mtid); if (c) { dh_table->timeout(c->getRequest()); @@ -214,7 +214,7 @@ namespace dht RPCCall* c = call_queue.first(); call_queue.removeFirst(); - while (calls.contains(next_mtid)) + while (calls.tqcontains(next_mtid)) next_mtid++; MsgBase* msg = c->getRequest(); @@ -227,7 +227,7 @@ namespace dht const RPCCall* RPCServer::findCall(Uint8 mtid) const { - return calls.find(mtid); + return calls.tqfind(mtid); } void RPCServer::ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr) diff --git a/libktorrent/kademlia/rpcserver.h b/libktorrent/kademlia/rpcserver.h index 4e54076..393db7a 100644 --- a/libktorrent/kademlia/rpcserver.h +++ b/libktorrent/kademlia/rpcserver.h @@ -20,7 +20,7 @@ #ifndef DHTRPCSERVER_H #define DHTRPCSERVER_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <kdatagramsocket.h> #include <util/constants.h> #include <util/array.h> @@ -52,11 +52,12 @@ namespace dht * * Class to handle incoming and outgoing RPC messages. */ - class RPCServer : public QObject + class RPCServer : public TQObject { Q_OBJECT + TQ_OBJECT public: - RPCServer(DHT* dh_table,Uint16 port,QObject *parent = 0); + RPCServer(DHT* dh_table,Uint16 port,TQObject *tqparent = 0); virtual ~RPCServer(); /// Start the server @@ -105,14 +106,14 @@ namespace dht void readPacket(); private: - void send(const KNetwork::KSocketAddress & addr,const QByteArray & msg); + void send(const KNetwork::KSocketAddress & addr,const TQByteArray & msg); void doQueuedCalls(); private: KDatagramSocket* sock; DHT* dh_table; bt::PtrMap<bt::Uint8,RPCCall> calls; - QPtrList<RPCCall> call_queue; + TQPtrList<RPCCall> call_queue; bt::Uint8 next_mtid; bt::Uint16 port; }; diff --git a/libktorrent/kademlia/task.cpp b/libktorrent/kademlia/task.cpp index 877a698..96e37b4 100644 --- a/libktorrent/kademlia/task.cpp +++ b/libktorrent/kademlia/task.cpp @@ -115,10 +115,10 @@ namespace dht finished(this); } - void Task::addDHTNode(const QString & ip,bt::Uint16 port) + void Task::addDHTNode(const TQString & ip,bt::Uint16 port) { - KResolver::resolveAsync(this,SLOT(onResolverResults(KResolverResults )), - ip,QString::number(port)); + KResolver::resolveAsync(this,TQT_SLOT(onResolverResults(KResolverResults )), + ip,TQString::number(port)); } void Task::onResolverResults(KResolverResults res) diff --git a/libktorrent/kademlia/task.h b/libktorrent/kademlia/task.h index 5a33ac0..3d7189f 100644 --- a/libktorrent/kademlia/task.h +++ b/libktorrent/kademlia/task.h @@ -20,7 +20,7 @@ #ifndef DHTTASK_H #define DHTTASK_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "rpccall.h" //#include "kbucket.h" @@ -49,6 +49,7 @@ namespace dht class Task : public RPCCallListener { Q_OBJECT + TQ_OBJECT public: /** * Create a task. @@ -134,7 +135,7 @@ namespace dht * @param ip The ip or hostname of the node * @param port The port */ - void addDHTNode(const QString & ip,bt::Uint16 port); + void addDHTNode(const TQString & ip,bt::Uint16 port); signals: /** @@ -157,8 +158,8 @@ namespace dht void onResolverResults(KResolverResults res); protected: - QValueList<KBucketEntry> visited; // nodes visited - QValueList<KBucketEntry> todo; // nodes todo + TQValueList<KBucketEntry> visited; // nodes visited + TQValueList<KBucketEntry> todo; // nodes todo Node* node; private: diff --git a/libktorrent/kademlia/taskmanager.cpp b/libktorrent/kademlia/taskmanager.cpp index f71fc0d..4e1e21a 100644 --- a/libktorrent/kademlia/taskmanager.cpp +++ b/libktorrent/kademlia/taskmanager.cpp @@ -54,14 +54,14 @@ namespace dht void TaskManager::removeFinishedTasks(const DHT* dh_table) { - QValueList<Uint32> rm; + TQValueList<Uint32> rm; for (TaskItr i = tasks.begin();i != tasks.end();i++) { if (i->second->isFinished()) rm.append(i->first); } - for (QValueList<Uint32>::iterator i = rm.begin();i != rm.end();i++) + for (TQValueList<Uint32>::iterator i = rm.begin();i != rm.end();i++) { tasks.erase(*i); } diff --git a/libktorrent/kademlia/taskmanager.h b/libktorrent/kademlia/taskmanager.h index 3df52b6..5349d8c 100644 --- a/libktorrent/kademlia/taskmanager.h +++ b/libktorrent/kademlia/taskmanager.h @@ -20,7 +20,7 @@ #ifndef DHTTASKMANAGER_H #define DHTTASKMANAGER_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <util/ptrmap.h> #include <util/constants.h> #include "task.h" @@ -60,7 +60,7 @@ namespace dht private: bt::PtrMap<Uint32,Task> tasks; - QPtrList<Task> queued; + TQPtrList<Task> queued; bt::Uint32 next_id; }; diff --git a/libktorrent/ktorrent.kcfg b/libktorrent/ktorrent.kcfg index 7d451b3..2d1e9b2 100644 --- a/libktorrent/ktorrent.kcfg +++ b/libktorrent/ktorrent.kcfg @@ -92,7 +92,7 @@ </entry> <entry name="tempDir" type="String"> <label>Folder to store temporary files</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="useSaveDir" type="Bool"> <label>Whether to automatically save downloads to saveDir</label> @@ -100,7 +100,7 @@ </entry> <entry name="saveDir" type="String"> <label>Folder to store downloaded files</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="useCompletedDir" type="Bool"> <label>Whether to automatically move completed downloads to completedDir</label> @@ -108,7 +108,7 @@ </entry> <entry name="completedDir" type="String"> <label>Folder to move completed downloaded files to</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="useTorrentCopyDir" type="Bool"> <label>Whether to automatically copy .torrent files to torrentCopyDir</label> @@ -116,7 +116,7 @@ </entry> <entry name="torrentCopyDir" type="String"> <label>Folder to copy .torrent files to</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="useExternalIP" type="Bool"> <label>Whether to use a custom IP to pass to the tracker</label> @@ -124,11 +124,11 @@ </entry> <entry name="lastSaveDir" type="String"> <label>Directory which was used as the last save directory</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="externalIP" type="String"> <label>IP to pass to the tracker</label> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="memoryUsage" type="Int"> <label>Memory usage</label> @@ -199,7 +199,7 @@ <default>false</default> </entry> <entry name="httpTrackerProxy" type="String"> - <default code="true">QString::null</default> + <default code="true">TQString::null</default> </entry> <entry name="eta" type="Int"> <label>ET algorithm</label> diff --git a/libktorrent/labelview.cpp b/libktorrent/labelview.cpp index 10c46d5..e33d448 100644 --- a/libktorrent/labelview.cpp +++ b/libktorrent/labelview.cpp @@ -18,8 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <algorithm> -#include <qlayout.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <kiconloader.h> #include <kglobalsettings.h> #include <util/log.h> @@ -29,7 +29,7 @@ using namespace bt; namespace kt { - LabelViewItem::LabelViewItem(const QString & icon,const QString & title,const QString & description,LabelView* view) + LabelViewItem::LabelViewItem(const TQString & icon,const TQString & title,const TQString & description,LabelView* view) : LabelViewItemBase(view),odd(false),selected(false) { icon_lbl->setPixmap(DesktopIcon(icon)); @@ -42,17 +42,17 @@ namespace kt { } - void LabelViewItem::setTitle(const QString & title) + void LabelViewItem::setTitle(const TQString & title) { title_lbl->setText(title); } - void LabelViewItem::setDescription(const QString & d) + void LabelViewItem::setDescription(const TQString & d) { description_lbl->setText(d); } - void LabelViewItem::setIcon(const QString & icon) + void LabelViewItem::setIcon(const TQString & icon) { icon_lbl->setPixmap(DesktopIcon(icon)); } @@ -89,29 +89,29 @@ namespace kt return title_lbl->text() < item.title_lbl->text(); } - void LabelViewItem::mousePressEvent(QMouseEvent *e) + void LabelViewItem::mousePressEvent(TQMouseEvent *e) { - if (e->button() == QMouseEvent::LeftButton) + if (e->button() == Qt::LeftButton) { clicked(this); } setFocus(); - QWidget::mousePressEvent(e); + TQWidget::mousePressEvent(e); } typedef std::list<LabelViewItem*>::iterator LabelViewItr; typedef std::list<LabelViewItem*>::const_iterator LabelViewCItr; - class LabelViewBox : public QWidget + class LabelViewBox : public TQWidget { - QVBoxLayout* layout; + TQVBoxLayout* tqlayout; public: - LabelViewBox(QWidget* parent) : QWidget(parent) + LabelViewBox(TQWidget* tqparent) : TQWidget(tqparent) { setPaletteBackgroundColor(KGlobalSettings::baseColor()); - layout = new QVBoxLayout(this); - layout->setMargin(0); + tqlayout = new TQVBoxLayout(this); + tqlayout->setMargin(0); } virtual ~LabelViewBox() @@ -119,25 +119,25 @@ namespace kt void add(LabelViewItem* item) { - item->reparent(this,QPoint(0,0)); - layout->add(item); + item->reparent(this,TQPoint(0,0)); + tqlayout->add(item); item->show(); } void remove(LabelViewItem* item) { item->hide(); - layout->remove(item); - item->reparent(0,QPoint(0,0)); + tqlayout->remove(item); + item->reparent(0,TQPoint(0,0)); } void sorted(const std::list<LabelViewItem*> items) { for (LabelViewCItr i = items.begin();i != items.end();i++) - layout->remove(*i); + tqlayout->remove(*i); for (LabelViewCItr i = items.begin();i != items.end();i++) - layout->add(*i); + tqlayout->add(*i); } }; @@ -145,11 +145,11 @@ namespace kt /////////////////////////////////////// - LabelView::LabelView ( QWidget *parent, const char *name ) - : QScrollView ( parent, name ),selected(0) + LabelView::LabelView ( TQWidget *tqparent, const char *name ) + : TQScrollView ( tqparent, name ),selected(0) { item_box = new LabelViewBox(this->viewport()); - setResizePolicy(QScrollView::AutoOneFit); + setResizePolicy(TQScrollView::AutoOneFit); addChild(item_box, 0, 0); item_box->show(); @@ -165,8 +165,8 @@ namespace kt items.push_back(item); item->setOdd(items.size() % 2 == 1); - connect(item, SIGNAL(clicked(LabelViewItem*)), - this, SLOT(onItemClicked(LabelViewItem*))); + connect(item, TQT_SIGNAL(clicked(LabelViewItem*)), + this, TQT_SLOT(onItemClicked(LabelViewItem*))); } void LabelView::removeItem(LabelViewItem* item) @@ -176,19 +176,19 @@ namespace kt { item_box->remove(item); items.erase(i); - disconnect(item, SIGNAL(clicked(LabelViewItem*)), - this, SLOT(onItemClicked(LabelViewItem*))); + disconnect(item, TQT_SIGNAL(clicked(LabelViewItem*)), + this, TQT_SLOT(onItemClicked(LabelViewItem*))); // check for selected being equal to item if (item == selected) selected = 0; // update odd status of each item - updateOddStatus(); + updateOddtqStatus(); } } - void LabelView::updateOddStatus() + void LabelView::updateOddtqStatus() { bool odd = true; LabelViewItr i = items.begin(); @@ -250,7 +250,7 @@ namespace kt { items.sort(LabelViewItemCmp()); item_box->sorted(items); - updateOddStatus(); + updateOddtqStatus(); } } diff --git a/libktorrent/labelview.h b/libktorrent/labelview.h index 5e83213..04ddf92 100644 --- a/libktorrent/labelview.h +++ b/libktorrent/labelview.h @@ -21,12 +21,12 @@ #define KTLABELVIEW_H #include <list> -#include <qscrollview.h> +#include <tqscrollview.h> #include "labelviewitembase.h" -class QLabel; -class QHBoxLayout; -class QVBoxLayout; +class TQLabel; +class TQHBoxLayout; +class TQVBoxLayout; namespace kt { @@ -38,18 +38,19 @@ namespace kt class LabelViewItem : public LabelViewItemBase { Q_OBJECT + TQ_OBJECT public: - LabelViewItem(const QString & icon,const QString & title,const QString & description,LabelView* view); + LabelViewItem(const TQString & icon,const TQString & title,const TQString & description,LabelView* view); virtual ~LabelViewItem(); /// Set the title of the item - void setTitle(const QString & title); + void setTitle(const TQString & title); /// Set the description - void setDescription(const QString & d); + void setDescription(const TQString & d); /// Set the name of the icon - void setIcon(const QString & icon); + void setIcon(const TQString & icon); /// Set if this is an odd item (they have a different background color) void setOdd(bool odd); @@ -64,7 +65,7 @@ namespace kt virtual bool operator < (const LabelViewItem & item); private: - virtual void mousePressEvent(QMouseEvent *e); + virtual void mousePressEvent(TQMouseEvent *e); signals: void clicked(LabelViewItem* item); @@ -79,11 +80,12 @@ namespace kt /** @author Joris Guisson <[email protected]> */ - class LabelView : public QScrollView + class LabelView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: - LabelView(QWidget *parent = 0, const char *name = 0); + LabelView(TQWidget *tqparent = 0, const char *name = 0); virtual ~LabelView(); /// Add an item to the label view @@ -108,7 +110,7 @@ namespace kt void onItemClicked(LabelViewItem* it); private: - void updateOddStatus(); + void updateOddtqStatus(); signals: /// The current item has changed diff --git a/libktorrent/labelviewitembase.ui b/libktorrent/labelviewitembase.ui index 174803f..5937dc8 100644 --- a/libktorrent/labelviewitembase.ui +++ b/libktorrent/labelviewitembase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>LabelViewItemBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>LabelViewItemBase</cstring> </property> @@ -19,11 +19,11 @@ <property name="margin"> <number>2</number> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>icon_lbl</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>64</width> <height>64</height> @@ -33,15 +33,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>title_lbl</cstring> </property> @@ -49,7 +49,7 @@ <string>textLabel2</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>description_lbl</cstring> </property> @@ -69,5 +69,5 @@ </widget> </hbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/libktorrent/migrate/cachemigrate.cpp b/libktorrent/migrate/cachemigrate.cpp index f9b203c..9006e2a 100644 --- a/libktorrent/migrate/cachemigrate.cpp +++ b/libktorrent/migrate/cachemigrate.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qstringlist.h> -#include <qfileinfo.h> +#include <tqstringlist.h> +#include <tqfileinfo.h> #include <util/log.h> #include <util/fileops.h> #include <util/functions.h> @@ -30,21 +30,21 @@ namespace bt { - bool IsCacheMigrateNeeded(const Torrent & tor,const QString & cache) + bool IsCacheMigrateNeeded(const Torrent & tor,const TQString & cache) { // mutli files always need to be migrated if (tor.isMultiFile()) return true; // a single file and a symlink do not need to be migrated - QFileInfo finfo(cache); + TQFileInfo finfo(cache); if (finfo.isSymLink()) return false; return true; } - static void MigrateSingleCache(const Torrent & tor,const QString & cache,const QString & output_dir) + static void MigrateSingleCache(const Torrent & tor,const TQString & cache,const TQString & output_dir) { Out() << "Migrating single cache " << cache << " to " << output_dir << endl; @@ -52,12 +52,12 @@ namespace bt bt::SymLink(output_dir + tor.getNameSuggestion(),cache); } - static void MakePath(const QString & startdir,const QString & path) + static void MakePath(const TQString & startdir,const TQString & path) { - QStringList sl = QStringList::split(bt::DirSeparator(),path); + TQStringList sl = TQStringList::split(bt::DirSeparator(),path); // create all necessary subdirs - QString ctmp = startdir; + TQString ctmp = startdir; for (Uint32 i = 0;i < sl.count() - 1;i++) { @@ -71,22 +71,22 @@ namespace bt } } - static void MigrateMultiCache(const Torrent & tor,const QString & cache,const QString & output_dir) + static void MigrateMultiCache(const Torrent & tor,const TQString & cache,const TQString & output_dir) { Out() << "Migrating multi cache " << cache << " to " << output_dir << endl; // if the cache dir is a symlink, everything is OK - if (QFileInfo(cache).isSymLink()) + if (TQFileInfo(cache).isSymLink()) return; - QString cache_dir = cache; + TQString cache_dir = cache; // make the output dir if it does not exists if (!bt::Exists(output_dir + tor.getNameSuggestion())) bt::MakeDir(output_dir + tor.getNameSuggestion()); - QString odir = output_dir + tor.getNameSuggestion() + bt::DirSeparator(); - QString cdir = cache; + TQString odir = output_dir + tor.getNameSuggestion() + bt::DirSeparator(); + TQString cdir = cache; if (!cdir.endsWith(bt::DirSeparator())) cdir += bt::DirSeparator(); @@ -94,7 +94,7 @@ namespace bt for (Uint32 i = 0;i < tor.getNumFiles();i++) { const TorrentFile & tf = tor.getFile(i); - QFileInfo fi(cdir + tf.getPath()); + TQFileInfo fi(cdir + tf.getPath()); // symlinks are OK if (fi.isSymLink()) continue; @@ -106,9 +106,9 @@ namespace bt } } - void MigrateCache(const Torrent & tor,const QString & cache,const QString & output_dir) + void MigrateCache(const Torrent & tor,const TQString & cache,const TQString & output_dir) { - QString odir = output_dir; + TQString odir = output_dir; if (!odir.endsWith(bt::DirSeparator())) odir += bt::DirSeparator(); diff --git a/libktorrent/migrate/cachemigrate.h b/libktorrent/migrate/cachemigrate.h index 3eea231..fc618f1 100644 --- a/libktorrent/migrate/cachemigrate.h +++ b/libktorrent/migrate/cachemigrate.h @@ -25,10 +25,10 @@ namespace bt class Torrent; /// See if a cache migrate is needed - bool IsCacheMigrateNeeded(const Torrent & tor,const QString & cache); + bool IsCacheMigrateNeeded(const Torrent & tor,const TQString & cache); /// Migrate the cache - void MigrateCache(const Torrent & tor,const QString & cache,const QString & output_dir); + void MigrateCache(const Torrent & tor,const TQString & cache,const TQString & output_dir); } #endif diff --git a/libktorrent/migrate/ccmigrate.cpp b/libktorrent/migrate/ccmigrate.cpp index 80153bf..3975de4 100644 --- a/libktorrent/migrate/ccmigrate.cpp +++ b/libktorrent/migrate/ccmigrate.cpp @@ -33,7 +33,7 @@ namespace bt { - bool IsPreMMap(const QString & current_chunks) + bool IsPreMMap(const TQString & current_chunks) { File fptr; if (!fptr.open(current_chunks,"rb")) @@ -110,19 +110,19 @@ namespace bt return true; } - static void MigrateCC(const Torrent & tor,const QString & current_chunks) + static void MigrateCC(const Torrent & tor,const TQString & current_chunks) { Out() << "Migrating current_chunks file " << current_chunks << endl; // open the old current_chunks file File old_cc; if (!old_cc.open(current_chunks,"rb")) - throw Error(i18n("Cannot open file %1 : %2").arg(current_chunks).arg(old_cc.errorString())); + throw Error(i18n("Cannot open file %1 : %2").tqarg(current_chunks).tqarg(old_cc.errorString())); // open a new file in the /tmp dir File new_cc; - QString tmp = current_chunks + ".tmp"; + TQString tmp = current_chunks + ".tmp"; if (!new_cc.open(tmp,"wb")) - throw Error(i18n("Cannot open file %1 : %2").arg(tmp).arg(old_cc.errorString())); + throw Error(i18n("Cannot open file %1 : %2").tqarg(tmp).tqarg(old_cc.errorString())); // read the number of chunks Uint32 num = 0; @@ -150,7 +150,7 @@ namespace bt bt::Move(tmp,current_chunks); } - void MigrateCurrentChunks(const Torrent & tor,const QString & current_chunks) + void MigrateCurrentChunks(const Torrent & tor,const TQString & current_chunks) { try { diff --git a/libktorrent/migrate/ccmigrate.h b/libktorrent/migrate/ccmigrate.h index 890bdfa..5272bf5 100644 --- a/libktorrent/migrate/ccmigrate.h +++ b/libktorrent/migrate/ccmigrate.h @@ -25,11 +25,11 @@ namespace bt class Torrent; /// Migrates the current_chunks file to the post-mmap era. - void MigrateCurrentChunks(const Torrent & tor,const QString & current_chunks); + void MigrateCurrentChunks(const Torrent & tor,const TQString & current_chunks); /// Test if a current_chunks file is from the pre-mmap period - bool IsPreMMap(const QString & current_chunks); + bool IsPreMMap(const TQString & current_chunks); } diff --git a/libktorrent/migrate/migrate.cpp b/libktorrent/migrate/migrate.cpp index eddde83..a59f83c 100644 --- a/libktorrent/migrate/migrate.cpp +++ b/libktorrent/migrate/migrate.cpp @@ -38,14 +38,14 @@ namespace bt Migrate::~Migrate() {} - void Migrate::migrate(const Torrent & tor,const QString & tor_dir,const QString & sdir) + void Migrate::migrate(const Torrent & tor,const TQString & tor_dir,const TQString & sdir) { // check if directory exists if (!bt::Exists(tor_dir)) - throw Error(i18n("The directory %1 does not exist").arg(tor_dir)); + throw Error(i18n("The directory %1 does not exist").tqarg(tor_dir)); // make sure it ends with a / - QString tdir = tor_dir; + TQString tdir = tor_dir; if (!tdir.endsWith(bt::DirSeparator())) tdir += bt::DirSeparator(); diff --git a/libktorrent/migrate/migrate.h b/libktorrent/migrate/migrate.h index ef862ec..8a943b4 100644 --- a/libktorrent/migrate/migrate.h +++ b/libktorrent/migrate/migrate.h @@ -42,10 +42,10 @@ namespace bt * @param sdir The save directory * @throw Error if something goes wrong */ - void migrate(const Torrent & tor,const QString & tor_dir,const QString & sdir); + void migrate(const Torrent & tor,const TQString & tor_dir,const TQString & sdir); private: - bool preMMap(const QString & current_chunks); - void migrateCurrentChunks(const QString & current_chunks); + bool preMMap(const TQString & current_chunks); + void migrateCurrentChunks(const TQString & current_chunks); }; } diff --git a/libktorrent/mse/bigint.cpp b/libktorrent/mse/bigint.cpp index 90c6d9e..e2746f6 100644 --- a/libktorrent/mse/bigint.cpp +++ b/libktorrent/mse/bigint.cpp @@ -36,7 +36,7 @@ namespace mse mpz_init2(val,num_bits); } - BigInt::BigInt(const QString & value) + BigInt::BigInt(const TQString & value) { mpz_init2(val,(value.length() - 2)*4); mpz_set_str(val,value.ascii(),0); diff --git a/libktorrent/mse/bigint.h b/libktorrent/mse/bigint.h index ad94d20..39bb865 100644 --- a/libktorrent/mse/bigint.h +++ b/libktorrent/mse/bigint.h @@ -20,7 +20,7 @@ #ifndef MSEBIGINT_H #define MSEBIGINT_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> #include <stdio.h> #include <gmp.h> @@ -57,7 +57,7 @@ namespace mse * Letters can be upper or lower case. Invalid chars will create an invalid number. * @param value The hexadecimal representation of the number */ - BigInt(const QString & value); + BigInt(const TQString & value); /** * Copy constructor. diff --git a/libktorrent/mse/encryptedauthenticate.cpp b/libktorrent/mse/encryptedauthenticate.cpp index 644ba7b..e60aa22 100644 --- a/libktorrent/mse/encryptedauthenticate.cpp +++ b/libktorrent/mse/encryptedauthenticate.cpp @@ -36,7 +36,7 @@ namespace mse EncryptedAuthenticate::EncryptedAuthenticate( - const QString& ip, + const TQString& ip, Uint16 port, const SHA1Hash& info_hash, const PeerID& peer_id, diff --git a/libktorrent/mse/encryptedauthenticate.h b/libktorrent/mse/encryptedauthenticate.h index 74ccc1b..1ab8192 100644 --- a/libktorrent/mse/encryptedauthenticate.h +++ b/libktorrent/mse/encryptedauthenticate.h @@ -39,8 +39,9 @@ namespace mse class EncryptedAuthenticate : public bt::Authenticate { Q_OBJECT + TQ_OBJECT public: - EncryptedAuthenticate(const QString& ip, Uint16 port, const bt::SHA1Hash& info_hash, const bt::PeerID& peer_id, bt::PeerManager* pman); + EncryptedAuthenticate(const TQString& ip, Uint16 port, const bt::SHA1Hash& info_hash, const bt::PeerID& peer_id, bt::PeerManager* pman); virtual ~EncryptedAuthenticate(); private slots: diff --git a/libktorrent/mse/encryptedserverauthenticate.h b/libktorrent/mse/encryptedserverauthenticate.h index 3c358cd..b5df3ff 100644 --- a/libktorrent/mse/encryptedserverauthenticate.h +++ b/libktorrent/mse/encryptedserverauthenticate.h @@ -36,6 +36,7 @@ namespace mse class EncryptedServerAuthenticate : public bt::ServerAuthenticate { Q_OBJECT + TQ_OBJECT public: EncryptedServerAuthenticate(mse::StreamSocket* sock, bt::Server* server); virtual ~EncryptedServerAuthenticate(); diff --git a/libktorrent/mse/functions.cpp b/libktorrent/mse/functions.cpp index bb19b93..d9ed5cf 100644 --- a/libktorrent/mse/functions.cpp +++ b/libktorrent/mse/functions.cpp @@ -58,7 +58,7 @@ namespace mse return bt::SHA1Hash::generate(buf,120); } - void DumpBigInt(const QString & name,const BigInt & bi) + void DumpBigInt(const TQString & name,const BigInt & bi) { static Uint8 buf[512]; Uint32 nb = bi.toBuffer(buf,512); @@ -66,7 +66,7 @@ namespace mse lg << name << " (" << nb << ") = "; for (Uint32 i = 0;i < nb;i++) { - lg << QString("0x%1 ").arg(buf[i],0,16); + lg << TQString("0x%1 ").tqarg(buf[i],0,16); } lg << endl; } diff --git a/libktorrent/mse/functions.h b/libktorrent/mse/functions.h index 4be1667..95e8e5d 100644 --- a/libktorrent/mse/functions.h +++ b/libktorrent/mse/functions.h @@ -33,7 +33,7 @@ namespace mse BigInt DHSecret(const BigInt & our_priv,const BigInt & peer_pub); bt::SHA1Hash EncryptionKey(bool a,const BigInt & s,const bt::SHA1Hash & skey); - void DumpBigInt(const QString & name,const BigInt & bi); + void DumpBigInt(const TQString & name,const BigInt & bi); } #endif diff --git a/libktorrent/mse/streamsocket.cpp b/libktorrent/mse/streamsocket.cpp index 19a0a2e..08f2d7b 100644 --- a/libktorrent/mse/streamsocket.cpp +++ b/libktorrent/mse/streamsocket.cpp @@ -18,8 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <errno.h> -#include <qsocket.h> -#include <qsocketdevice.h> +#include <tqsocket.h> +#include <tqsocketdevice.h> #include <util/sha1hash.h> #include <util/log.h> #include <torrent/peer.h> @@ -181,7 +181,7 @@ namespace mse sock->close(); } - bool StreamSocket::connectTo(const QString & ip,Uint16 port) + bool StreamSocket::connectTo(const TQString & ip,Uint16 port) { // do a safety check if (ip.isNull() || ip.length() == 0) @@ -221,7 +221,7 @@ namespace mse return sock->ok(); } - QString StreamSocket::getRemoteIPAddress() const + TQString StreamSocket::getRemoteIPAddress() const { return sock->getPeerName().toString(); } diff --git a/libktorrent/mse/streamsocket.h b/libktorrent/mse/streamsocket.h index 5006a7b..6cfa6d8 100644 --- a/libktorrent/mse/streamsocket.h +++ b/libktorrent/mse/streamsocket.h @@ -20,11 +20,11 @@ #ifndef MSESTREAMSOCKET_H #define MSESTREAMSOCKET_H -#include <qobject.h> +#include <tqobject.h> #include <util/constants.h> #include <net/bufferedsocket.h> -class QString; +class TQString; using bt::Uint8; using bt::Uint16; @@ -52,9 +52,10 @@ namespace mse * not be used anymore, a SocketReader and SocketWriter should be provided, * so that reading and writing is controlled from the monitor thread. */ - class StreamSocket : public QObject,public net::SocketReader,public net::SocketWriter + class StreamSocket : public TQObject,public net::SocketReader,public net::SocketWriter { Q_OBJECT + TQ_OBJECT public: StreamSocket(); StreamSocket(int fd); @@ -99,10 +100,10 @@ namespace mse void close(); /// Connect the socket to a remote host - bool connectTo(const QString & ip,Uint16 port); + bool connectTo(const TQString & ip,Uint16 port); /// Get the IP address of the remote peer - QString getRemoteIPAddress() const; + TQString getRemoteIPAddress() const; /// Get the port of the remote peer bt::Uint16 getRemotePort() const; diff --git a/libktorrent/net/address.cpp b/libktorrent/net/address.cpp index 4a4da3c..e1de8d0 100644 --- a/libktorrent/net/address.cpp +++ b/libktorrent/net/address.cpp @@ -27,7 +27,7 @@ namespace net Address::Address() : m_ip(0),m_port(0) {} - Address::Address(const QString & host,Uint16 port) : m_ip(0),m_port(port) + Address::Address(const TQString & host,Uint16 port) : m_ip(0),m_port(port) { struct in_addr a; if (inet_aton(host.ascii(),&a)) @@ -55,13 +55,13 @@ namespace net return m_ip == a.ip() && m_port == a.port(); } - QString Address::toString() const + TQString Address::toString() const { - return QString("%1.%2.%3.%4") - .arg((m_ip & 0xFF000000) >> 24) - .arg((m_ip & 0x00FF0000) >> 16) - .arg((m_ip & 0x0000FF00) >> 8) - .arg(m_ip & 0x000000FF); + return TQString("%1.%2.%3.%4") + .tqarg((m_ip & 0xFF000000) >> 24) + .tqarg((m_ip & 0x00FF0000) >> 16) + .tqarg((m_ip & 0x0000FF00) >> 8) + .tqarg(m_ip & 0x000000FF); } } diff --git a/libktorrent/net/address.h b/libktorrent/net/address.h index 28c4e2c..af39380 100644 --- a/libktorrent/net/address.h +++ b/libktorrent/net/address.h @@ -20,7 +20,7 @@ #ifndef NETADDRESS_H #define NETADDRESS_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace net @@ -37,7 +37,7 @@ namespace net Uint16 m_port; public: Address(); - Address(const QString & host,Uint16 port); + Address(const TQString & host,Uint16 port); Address(const Address & addr); virtual ~Address(); @@ -51,7 +51,7 @@ namespace net Uint16 port() const {return m_port;} void setPort(Uint16 p) {m_port = p;} - QString toString() const; + TQString toString() const; }; diff --git a/libktorrent/net/bufferedsocket.h b/libktorrent/net/bufferedsocket.h index 2c0c3ec..2e594df 100644 --- a/libktorrent/net/bufferedsocket.h +++ b/libktorrent/net/bufferedsocket.h @@ -20,7 +20,7 @@ #ifndef NETBUFFEREDSOCKET_H #define NETBUFFEREDSOCKET_H -#include <qmutex.h> +#include <tqmutex.h> #include <net/socket.h> namespace net @@ -72,7 +72,7 @@ namespace net */ class BufferedSocket : public Socket { - mutable QMutex mutex; + mutable TQMutex mutex; SocketReader* rdr; SocketWriter* wrt; Uint8* output_buffer; diff --git a/libktorrent/net/circularbuffer.h b/libktorrent/net/circularbuffer.h index 63e271e..6d45723 100644 --- a/libktorrent/net/circularbuffer.h +++ b/libktorrent/net/circularbuffer.h @@ -20,7 +20,7 @@ #ifndef NETCIRCULARBUFFER_H #define NETCIRCULARBUFFER_H -#include <qmutex.h> +#include <tqmutex.h> #include <util/constants.h> namespace net @@ -43,7 +43,7 @@ namespace net Uint32 max_size; Uint32 first; // index of first byte in the buffer Uint32 size; // number of bytes in use - mutable QMutex mutex; + mutable TQMutex mutex; public: /** * Create the buffer. diff --git a/libktorrent/net/downloadthread.cpp b/libktorrent/net/downloadthread.cpp index ae0f0b9..2adf1a8 100644 --- a/libktorrent/net/downloadthread.cpp +++ b/libktorrent/net/downloadthread.cpp @@ -61,9 +61,9 @@ namespace net { // add to the correct group Uint32 gid = s->downloadGroupID(); - SocketGroup* g = groups.find(gid); + SocketGroup* g = groups.tqfind(gid); if (!g) - g = groups.find(0); + g = groups.tqfind(0); g->add(s); num_ready++; diff --git a/libktorrent/net/networkthread.cpp b/libktorrent/net/networkthread.cpp index 40791c9..0a48af9 100644 --- a/libktorrent/net/networkthread.cpp +++ b/libktorrent/net/networkthread.cpp @@ -51,7 +51,7 @@ namespace net void NetworkThread::addGroup(Uint32 gid,Uint32 limit) { // if group already exists, just change the limit - SocketGroup* g = groups.find(gid); + SocketGroup* g = groups.tqfind(gid); if (g) { g->setLimit(limit); @@ -72,7 +72,7 @@ namespace net void NetworkThread::setGroupLimit(Uint32 gid,Uint32 limit) { - SocketGroup* g = groups.find(gid); + SocketGroup* g = groups.tqfind(gid); if (g) { g->setLimit(limit); diff --git a/libktorrent/net/networkthread.h b/libktorrent/net/networkthread.h index 7472c15..d31ae3e 100644 --- a/libktorrent/net/networkthread.h +++ b/libktorrent/net/networkthread.h @@ -20,7 +20,7 @@ #ifndef NETNETWORKTHREAD_H #define NETNETWORKTHREAD_H -#include <qthread.h> +#include <tqthread.h> #include <util/constants.h> #include <util/ptrmap.h> @@ -37,7 +37,7 @@ namespace net Base class for the 2 networking threads. Handles the socket groups. */ - class NetworkThread : public QThread + class NetworkThread : public TQThread { protected: SocketMonitor* sm; diff --git a/libktorrent/net/portlist.cpp b/libktorrent/net/portlist.cpp index 56076ed..6fa4f6a 100644 --- a/libktorrent/net/portlist.cpp +++ b/libktorrent/net/portlist.cpp @@ -58,7 +58,7 @@ namespace net void PortList::removePort(bt::Uint16 number,Protocol proto) { - PortList::iterator itr = find(Port(number,proto,false)); + PortList::iterator itr = tqfind(Port(number,proto,false)); if (itr == end()) return; diff --git a/libktorrent/net/portlist.h b/libktorrent/net/portlist.h index af60c1c..c1a6e99 100644 --- a/libktorrent/net/portlist.h +++ b/libktorrent/net/portlist.h @@ -20,7 +20,7 @@ #ifndef NETPORTLIST_H #define NETPORTLIST_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/constants.h> namespace net @@ -69,7 +69,7 @@ namespace net * List of ports which are currently being used. * */ - class PortList : public QValueList<Port> + class PortList : public TQValueList<Port> { PortListener* lst; public: diff --git a/libktorrent/net/socket.cpp b/libktorrent/net/socket.cpp index b9a53f3..ff09a34 100644 --- a/libktorrent/net/socket.cpp +++ b/libktorrent/net/socket.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qglobal.h> +#include <tqglobal.h> #include <unistd.h> #include <string.h> @@ -39,7 +39,7 @@ #endif #ifndef MSG_NOSIGNAL -#define MSG_NOSIGNAL 0 +#define MSG_NOTQT_SIGNAL 0 #endif #include <unistd.h> @@ -60,7 +60,7 @@ namespace net int val = 1; if (setsockopt(m_fd,SOL_SOCKET,SO_NOSIGPIPE,&val,sizeof(int)) < 0) { - Out(SYS_CON|LOG_NOTICE) << QString("Failed to set the NOSIGPIPE option : %1").arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_NOTICE) << TQString("Failed to set the NOSIGPIPE option : %1").tqarg(strerror(errno)) << endl; } #endif cacheAddress(); @@ -71,14 +71,14 @@ namespace net int fd = socket(PF_INET,tcp ? SOCK_STREAM : SOCK_DGRAM,0); if (fd < 0) { - Out(SYS_GEN|LOG_IMPORTANT) << QString("Cannot create socket : %1").arg(strerror(errno)) << endl; + Out(SYS_GEN|LOG_IMPORTANT) << TQString("Cannot create socket : %1").tqarg(strerror(errno)) << endl; } m_fd = fd; #if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) || (defined(Q_OS_FREEBSD) && !defined(__DragonFly__) && __FreeBSD_version < 600020) int val = 1; if (setsockopt(m_fd,SOL_SOCKET,SO_NOSIGPIPE,&val,sizeof(int)) < 0) { - Out(SYS_CON|LOG_NOTICE) << QString("Failed to set the NOSIGPIPE option : %1").arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_NOTICE) << TQString("Failed to set the NOSIGPIPE option : %1").tqarg(strerror(errno)) << endl; } #endif } @@ -126,8 +126,8 @@ namespace net } else { - Out(SYS_CON|LOG_NOTICE) << QString("Cannot connect to host %1:%2 : %3") - .arg(a.toString()).arg(a.port()).arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_NOTICE) << TQString("Cannot connect to host %1:%2 : %3") + .tqarg(a.toString()).tqarg(a.port()).tqarg(strerror(errno)) << endl; return false; } } @@ -145,20 +145,20 @@ namespace net if (::bind(m_fd,(struct sockaddr*)&addr,sizeof(struct sockaddr)) < 0) { - Out(SYS_CON|LOG_IMPORTANT) << QString("Cannot bind to port %1 : %2").arg(port).arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_IMPORTANT) << TQString("Cannot bind to port %1 : %2").tqarg(port).tqarg(strerror(errno)) << endl; return false; } if (also_listen && listen(m_fd,5) < 0) { - Out(SYS_CON|LOG_IMPORTANT) << QString("Cannot listen to port %1 : %2").arg(port).arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_IMPORTANT) << TQString("Cannot listen to port %1 : %2").tqarg(port).tqarg(strerror(errno)) << endl; return false; } int val = 1; if (setsockopt(m_fd,SOL_SOCKET,SO_REUSEADDR,&val,sizeof(int)) < 0) { - Out(SYS_CON|LOG_NOTICE) << QString("Failed to set the reuseaddr option : %1").arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_NOTICE) << TQString("Failed to set the reuseaddr option : %1").tqarg(strerror(errno)) << endl; } m_state = BOUND; return true; @@ -171,7 +171,7 @@ namespace net { if (errno != EAGAIN && errno != EWOULDBLOCK) { - // Out(SYS_CON|LOG_DEBUG) << "Send error : " << QString(strerror(errno)) << endl; + // Out(SYS_CON|LOG_DEBUG) << "Send error : " << TQString(strerror(errno)) << endl; close(); } return 0; @@ -186,7 +186,7 @@ namespace net { if (errno != EAGAIN && errno != EWOULDBLOCK) { - // Out(SYS_CON|LOG_DEBUG) << "Receive error : " << QString(strerror(errno)) << endl; + // Out(SYS_CON|LOG_DEBUG) << "Receive error : " << TQString(strerror(errno)) << endl; close(); } return 0; @@ -215,7 +215,7 @@ namespace net int ret = ::sendto(m_fd,(char*)buf + ns,left,0,(struct sockaddr*)&addr,sizeof(struct sockaddr)); if (ret < 0) { - Out(SYS_CON|LOG_DEBUG) << "Send error : " << QString(strerror(errno)) << endl; + Out(SYS_CON|LOG_DEBUG) << "Send error : " << TQString(strerror(errno)) << endl; return 0; } @@ -233,7 +233,7 @@ namespace net int ret = ::recvfrom(m_fd,buf,max_len,0,(struct sockaddr*)&addr,&sl); if (ret < 0) { - Out(SYS_CON|LOG_DEBUG) << "Receive error : " << QString(strerror(errno)) << endl; + Out(SYS_CON|LOG_DEBUG) << "Receive error : " << TQString(strerror(errno)) << endl; return 0; } @@ -251,14 +251,14 @@ namespace net int sfd = ::accept(m_fd,(struct sockaddr*)&addr,&slen); if (sfd < 0) { - Out(SYS_CON|LOG_DEBUG) << "Accept error : " << QString(strerror(errno)) << endl; + Out(SYS_CON|LOG_DEBUG) << "Accept error : " << TQString(strerror(errno)) << endl; return -1; } a.setPort(ntohs(addr.sin_port)); a.setIP(ntohl(addr.sin_addr.s_addr)); - Out(SYS_CON|LOG_DEBUG) << "Accepted connection from " << QString(inet_ntoa(addr.sin_addr)) << endl; + Out(SYS_CON|LOG_DEBUG) << "Accepted connection from " << TQString(inet_ntoa(addr.sin_addr)) << endl; return sfd; } @@ -271,8 +271,8 @@ namespace net #endif if (setsockopt(m_fd,IPPROTO_IP,IP_TOS,&c,sizeof(c)) < 0) { - Out(SYS_CON|LOG_NOTICE) << QString("Failed to set TOS to %1 : %2") - .arg(type_of_service).arg(strerror(errno)) << endl; + Out(SYS_CON|LOG_NOTICE) << TQString("Failed to set TOS to %1 : %2") + .tqarg(type_of_service).tqarg(strerror(errno)) << endl; return false; } return true; diff --git a/libktorrent/net/socketmonitor.cpp b/libktorrent/net/socketmonitor.cpp index 38225ab..123536a 100644 --- a/libktorrent/net/socketmonitor.cpp +++ b/libktorrent/net/socketmonitor.cpp @@ -96,7 +96,7 @@ namespace net void SocketMonitor::add(BufferedSocket* sock) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); bool start_threads = smap.count() == 0; smap.append(sock); @@ -106,15 +106,15 @@ namespace net Out(SYS_CON|LOG_DEBUG) << "Starting socketmonitor threads" << endl; if (!dt->isRunning()) - dt->start(QThread::IdlePriority); + dt->start(TQThread::IdlePriority); if (!ut->isRunning()) - ut->start(QThread::IdlePriority); + ut->start(TQThread::IdlePriority); } } void SocketMonitor::remove(BufferedSocket* sock) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); if (smap.count() == 0) return; diff --git a/libktorrent/net/socketmonitor.h b/libktorrent/net/socketmonitor.h index 79e4a2e..6fc63c1 100644 --- a/libktorrent/net/socketmonitor.h +++ b/libktorrent/net/socketmonitor.h @@ -21,8 +21,8 @@ #define NETSOCKETMONITOR_H -#include <qmutex.h> -#include <qptrlist.h> +#include <tqmutex.h> +#include <tqptrlist.h> #include <util/constants.h> @@ -44,10 +44,10 @@ namespace net { static SocketMonitor self; - QMutex mutex; + TQMutex mutex; UploadThread* ut; DownloadThread* dt; - QPtrList<BufferedSocket> smap; + TQPtrList<BufferedSocket> smap; Uint32 next_group_id; SocketMonitor(); @@ -90,7 +90,7 @@ namespace net */ void removeGroup(GroupType type,Uint32 gid); - typedef QPtrList<BufferedSocket>::iterator Itr; + typedef TQPtrList<BufferedSocket>::iterator Itr; /// Get the begin of the list of sockets Itr begin() {return smap.begin();} diff --git a/libktorrent/net/speed.cpp b/libktorrent/net/speed.cpp index aa57513..35fde9d 100644 --- a/libktorrent/net/speed.cpp +++ b/libktorrent/net/speed.cpp @@ -37,16 +37,16 @@ namespace net void Speed::onData(Uint32 b,bt::TimeStamp ts) { - dlrate.append(qMakePair(b,ts)); + dlrate.append(tqMakePair(b,ts)); bytes += b; } void Speed::update(bt::TimeStamp now) { - QValueList<QPair<Uint32,TimeStamp> >::iterator i = dlrate.begin(); + TQValueList<TQPair<Uint32,TimeStamp> >::iterator i = dlrate.begin(); while (i != dlrate.end()) { - QPair<Uint32,TimeStamp> & p = *i; + TQPair<Uint32,TimeStamp> & p = *i; if (now - p.second > SPEED_INTERVAL || now < p.second) { if (bytes >= p.first) // make sure we don't wrap around diff --git a/libktorrent/net/speed.h b/libktorrent/net/speed.h index d5825e9..a9ea561 100644 --- a/libktorrent/net/speed.h +++ b/libktorrent/net/speed.h @@ -20,8 +20,8 @@ #ifndef NETSPEED_H #define NETSPEED_H -#include <qpair.h> -#include <qvaluelist.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include <util/constants.h> namespace net @@ -36,7 +36,7 @@ namespace net { float rate; bt::Uint32 bytes; - QValueList<QPair<bt::Uint32,bt::TimeStamp> > dlrate; + TQValueList<TQPair<bt::Uint32,bt::TimeStamp> > dlrate; public: Speed(); virtual ~Speed(); diff --git a/libktorrent/net/uploadthread.cpp b/libktorrent/net/uploadthread.cpp index 0023cf6..3d2fa0a 100644 --- a/libktorrent/net/uploadthread.cpp +++ b/libktorrent/net/uploadthread.cpp @@ -52,9 +52,9 @@ namespace net BufferedSocket* s = *itr; if (s && s->ok() && s->bytesReadyToWrite()) { - SocketGroup* g = groups.find(s->uploadGroupID()); + SocketGroup* g = groups.tqfind(s->uploadGroupID()); if (!g) - g = groups.find(0); + g = groups.tqfind(0); g->add(s); num_ready++; diff --git a/libktorrent/net/uploadthread.h b/libktorrent/net/uploadthread.h index 265abac..b273846 100644 --- a/libktorrent/net/uploadthread.h +++ b/libktorrent/net/uploadthread.h @@ -22,7 +22,7 @@ -#include <qwaitcondition.h> +#include <tqwaitcondition.h> #include "networkthread.h" namespace net @@ -38,7 +38,7 @@ namespace net static bt::Uint32 ucap; static bt::Uint32 sleep_time; - QWaitCondition data_ready; + TQWaitCondition data_ready; public: UploadThread(SocketMonitor* sm); virtual ~UploadThread(); diff --git a/libktorrent/pluginmanager.cpp b/libktorrent/pluginmanager.cpp index db9e0a3..2389162 100644 --- a/libktorrent/pluginmanager.cpp +++ b/libktorrent/pluginmanager.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kparts/componentfactory.h> #include <util/log.h> #include <util/error.h> @@ -61,7 +61,7 @@ namespace kt int errCode = 0; Plugin* plugin = KParts::ComponentFactory::createInstanceFromService<kt::Plugin> - (service, 0, 0, QStringList(),&errCode); + (service, 0, 0, TQStringList(),&errCode); if (!plugin) continue; @@ -70,8 +70,8 @@ namespace kt if (!plugin->versionCheck(kt::VERSION_STRING)) { Out(SYS_GEN|LOG_NOTICE) << - QString("Plugin %1 version does not match KTorrent version, unloading it.") - .arg(service->library()) << endl; + TQString("Plugin %1 version does not match KTorrent version, unloading it.") + .tqarg(service->library()) << endl; delete plugin; // unload the library again, no need to have it loaded @@ -80,7 +80,7 @@ namespace kt } unloaded.insert(plugin->getName(),plugin); - if (pltoload.contains(plugin->getName())) + if (pltoload.tqcontains(plugin->getName())) load(plugin->getName()); } @@ -93,9 +93,9 @@ namespace kt } - void PluginManager::load(const QString & name) + void PluginManager::load(const TQString & name) { - Plugin* p = unloaded.find(name); + Plugin* p = unloaded.tqfind(name); if (!p) return; @@ -112,9 +112,9 @@ namespace kt saveConfigFile(cfg_file); } - void PluginManager::unload(const QString & name) + void PluginManager::unload(const TQString & name) { - Plugin* p = plugins.find(name); + Plugin* p = plugins.tqfind(name); if (!p) return; @@ -146,7 +146,7 @@ namespace kt void PluginManager::loadAll() { - bt::PtrMap<QString,Plugin>::iterator i = unloaded.begin(); + bt::PtrMap<TQString,Plugin>::iterator i = unloaded.begin(); while (i != unloaded.end()) { Plugin* p = i->second; @@ -169,7 +169,7 @@ namespace kt bt::WaitJob* wjob = new WaitJob(2000); try { - bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); + bt::PtrMap<TQString,Plugin>::iterator i = plugins.begin(); while (i != plugins.end()) { Plugin* p = i->second; @@ -188,7 +188,7 @@ namespace kt } // then unload them - bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); + bt::PtrMap<TQString,Plugin>::iterator i = plugins.begin(); while (i != plugins.end()) { Plugin* p = i->second; @@ -205,7 +205,7 @@ namespace kt void PluginManager::updateGuiPlugins() { - bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); + bt::PtrMap<TQString,Plugin>::iterator i = plugins.begin(); while (i != plugins.end()) { Plugin* p = i->second; @@ -214,9 +214,9 @@ namespace kt } } - void PluginManager::fillPluginList(QPtrList<Plugin> & plist) + void PluginManager::fillPluginList(TQPtrList<Plugin> & plist) { - bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); + bt::PtrMap<TQString,Plugin>::iterator i = plugins.begin(); while (i != plugins.end()) { Plugin* p = i->second; @@ -234,13 +234,13 @@ namespace kt } } - bool PluginManager::isLoaded(const QString & name) const + bool PluginManager::isLoaded(const TQString & name) const { - const Plugin* p = plugins.find(name); + const Plugin* p = plugins.tqfind(name); return p != 0; } - void PluginManager::loadConfigFile(const QString & file) + void PluginManager::loadConfigFile(const TQString & file) { cfg_file = file; // make a default config file if doesn't exist @@ -250,19 +250,19 @@ namespace kt return; } - QFile f(file); + TQFile f(file); if (!f.open(IO_ReadOnly)) { - Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << f.errorString() << endl; + Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << TQString(f.errorString()) << endl; return; } pltoload.clear(); - QTextStream in(&f); + TQTextStream in(&f); while (!in.atEnd()) { - QString l = in.readLine(); + TQString l = in.readLine(); if (l.isNull()) break; @@ -270,18 +270,18 @@ namespace kt } } - void PluginManager::saveConfigFile(const QString & file) + void PluginManager::saveConfigFile(const TQString & file) { cfg_file = file; - QFile f(file); + TQFile f(file); if (!f.open(IO_WriteOnly)) { - Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << f.errorString() << endl; + Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << TQString(f.errorString()) << endl; return; } - QTextStream out(&f); - bt::PtrMap<QString,Plugin>::iterator i = plugins.begin(); + TQTextStream out(&f); + bt::PtrMap<TQString,Plugin>::iterator i = plugins.begin(); while (i != plugins.end()) { Plugin* p = i->second; @@ -291,17 +291,17 @@ namespace kt } - void PluginManager::writeDefaultConfigFile(const QString & file) + void PluginManager::writeDefaultConfigFile(const TQString & file) { // by default we will load the infowidget and searchplugin - QFile f(file); + TQFile f(file); if (!f.open(IO_WriteOnly)) { - Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << f.errorString() << endl; + Out(SYS_GEN|LOG_DEBUG) << "Cannot open file " << file << " : " << TQString(f.errorString()) << endl; return; } - QTextStream out(&f); + TQTextStream out(&f); out << "Info Widget" << endl << "Search" << endl; diff --git a/libktorrent/pluginmanager.h b/libktorrent/pluginmanager.h index 611ec66..af5f46c 100644 --- a/libktorrent/pluginmanager.h +++ b/libktorrent/pluginmanager.h @@ -20,10 +20,10 @@ #ifndef KTPLUGINMANAGER_H #define KTPLUGINMANAGER_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <util/ptrmap.h> #include <interfaces/plugin.h> -#include <qstringlist.h> +#include <tqstringlist.h> namespace kt @@ -40,12 +40,12 @@ namespace kt */ class PluginManager { - bt::PtrMap<QString,Plugin> plugins,unloaded; + bt::PtrMap<TQString,Plugin> plugins,unloaded; CoreInterface* core; GUIInterface* gui; PluginManagerPrefPage* prefpage; - QStringList pltoload; - QString cfg_file; + TQStringList pltoload; + TQString cfg_file; public: PluginManager(CoreInterface* core,GUIInterface* gui); virtual ~PluginManager(); @@ -62,38 +62,38 @@ namespace kt * Loads which plugins need to be loaded from a file. * @param file The file */ - void loadConfigFile(const QString & file); + void loadConfigFile(const TQString & file); /** * Saves which plugins are loaded to a file. * @param file The file */ - void saveConfigFile(const QString & file); + void saveConfigFile(const TQString & file); /** * Fill a list with all available plugins. * @param pllist The plugin list */ - void fillPluginList(QPtrList<Plugin> & plist); + void fillPluginList(TQPtrList<Plugin> & plist); /** * Is a plugin loaded * @param name Naame of plugin. * @return True if it is, false if it isn't */ - bool isLoaded(const QString & name) const; + bool isLoaded(const TQString & name) const; /** * Load a plugin. * @param name Name of the plugin */ - void load(const QString & name); + void load(const TQString & name); /** * Unload a plugin. * @param name Name of the plugin */ - void unload(const QString & name); + void unload(const TQString & name); /** * Load all unloaded plugins. @@ -110,7 +110,7 @@ namespace kt */ void updateGuiPlugins(); private: - void writeDefaultConfigFile(const QString & file); + void writeDefaultConfigFile(const TQString & file); }; } diff --git a/libktorrent/pluginmanagerprefpage.cpp b/libktorrent/pluginmanagerprefpage.cpp index 8151be4..0dfc9cc 100644 --- a/libktorrent/pluginmanagerprefpage.cpp +++ b/libktorrent/pluginmanagerprefpage.cpp @@ -20,7 +20,7 @@ #include <klocale.h> #include <kpushbutton.h> #include <klistview.h> -#include <qheader.h> +#include <tqheader.h> #include <kglobal.h> #include <kiconloader.h> #include <util/constants.h> @@ -38,8 +38,8 @@ namespace kt { Plugin* p; public: - PluginViewItem(Plugin* p,LabelView* parent) - : LabelViewItem(p->getIcon(),p->getGuiName(),p->getDescription(),parent),p(p) + PluginViewItem(Plugin* p,LabelView* tqparent) + : LabelViewItem(p->getIcon(),p->getGuiName(),p->getDescription(),tqparent),p(p) { update(); } @@ -51,12 +51,12 @@ namespace kt { setTitle("<h3>" + p->getGuiName() + "</h3>"); setDescription( - i18n("%1<br>Status: <b>%2</b><br>Author: %3").arg(p->getDescription()) - .arg(p->isLoaded() ? i18n("Loaded") : i18n("Not loaded")) - .arg(p->getAuthor())); + i18n("%1<br>tqStatus: <b>%2</b><br>Author: %3").tqarg(p->getDescription()) + .tqarg(p->isLoaded() ? i18n("Loaded") : i18n("Not loaded")) + .tqarg(p->getAuthor())); } - QString pluginName() {return p->getName();} + TQString pluginName() {return p->getName();} }; PluginManagerPrefPage::PluginManagerPrefPage(PluginManager* pman) @@ -74,16 +74,16 @@ namespace kt return true; } - void PluginManagerPrefPage::createWidget(QWidget* parent) + void PluginManagerPrefPage::createWidget(TQWidget* tqparent) { - pmw = new PluginManagerWidget(parent); + pmw = new PluginManagerWidget(tqparent); - connect(pmw->load_btn,SIGNAL(clicked()),this,SLOT(onLoad())); - connect(pmw->unload_btn,SIGNAL(clicked()),this,SLOT(onUnload())); - connect(pmw->load_all_btn,SIGNAL(clicked()),this,SLOT(onLoadAll())); - connect(pmw->unload_all_btn,SIGNAL(clicked()),this,SLOT(onUnloadAll())); + connect(pmw->load_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onLoad())); + connect(pmw->unload_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onUnload())); + connect(pmw->load_all_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onLoadAll())); + connect(pmw->unload_all_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onUnloadAll())); LabelView* lv = pmw->plugin_view; - connect(lv,SIGNAL(currentChanged(LabelViewItem * )),this,SLOT(onCurrentChanged( LabelViewItem* ))); + connect(lv,TQT_SIGNAL(currentChanged(LabelViewItem * )),this,TQT_SLOT(onCurrentChanged( LabelViewItem* ))); } void PluginManagerPrefPage::updatePluginList() @@ -91,11 +91,11 @@ namespace kt LabelView* lv = pmw->plugin_view; lv->clear(); // get list of plugins - QPtrList<Plugin> pl; + TQPtrList<Plugin> pl; pman->fillPluginList(pl); // Add them all - QPtrList<Plugin>::iterator i = pl.begin(); + TQPtrList<Plugin>::iterator i = pl.begin(); while (i != pl.end()) { Plugin* p = *i; @@ -139,10 +139,10 @@ namespace kt Uint32 tot = 0; Uint32 loaded = 0; // get list of plugins - QPtrList<Plugin> pl; + TQPtrList<Plugin> pl; pman->fillPluginList(pl); - QPtrList<Plugin>::iterator i = pl.begin(); + TQPtrList<Plugin>::iterator i = pl.begin(); while (i != pl.end()) { Plugin* p = *i; diff --git a/libktorrent/pluginmanagerprefpage.h b/libktorrent/pluginmanagerprefpage.h index 47df97f..9b78394 100644 --- a/libktorrent/pluginmanagerprefpage.h +++ b/libktorrent/pluginmanagerprefpage.h @@ -20,10 +20,10 @@ #ifndef KTPLUGINMANAGERPREFPAGE_H #define KTPLUGINMANAGERPREFPAGE_H -#include <qobject.h> +#include <tqobject.h> #include <interfaces/prefpageinterface.h> -class QListViewItem; +class TQListViewItem; class PluginManagerWidget; namespace kt @@ -36,15 +36,16 @@ namespace kt * * Pref page which allows to load and unload plugins. */ - class PluginManagerPrefPage : public QObject,public PrefPageInterface + class PluginManagerPrefPage : public TQObject,public PrefPageInterface { Q_OBJECT + TQ_OBJECT public: PluginManagerPrefPage(PluginManager* pman); virtual ~PluginManagerPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/libktorrent/pluginmanagerwidget.ui b/libktorrent/pluginmanagerwidget.ui index f83efe0..47617ba 100644 --- a/libktorrent/pluginmanagerwidget.ui +++ b/libktorrent/pluginmanagerwidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>PluginManagerWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>PluginManagerWidget</cstring> </property> @@ -32,9 +32,9 @@ </sizepolicy> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <vbox> <property name="name"> @@ -82,7 +82,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>31</height> @@ -116,7 +116,7 @@ <data format="PNG" length="1125">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000042c49444154388db5954f6c14551cc73fefcd7476b65bdaae4bb78bb5502a14d404e4801c88182d1c4c2c693da847400f9c24c68b878684238660e2b1e01f12c19493012ef2478c814412d354a46017a8a564bb6da5bbedccee767776e63d0ffb073751d483bfe49799974c3eeffb7ebf37df9fd05a530b2184040cc0042420aaf9a4d0d554800f045a6b256ae0e1e1e1d6bebebe838ee31c48a7d39b5cd7fd075e251cc7617272f2ded8d8d819cff33e0316819259537aead4a9839d5dd6d1784f91f55b0a94830242088404d304292bef68a89f520802a598fecddaa04f1a876f5c250c7c0a64cdeac686e33807e23d45e6b297c8b877f1831542614550b6599835c83c2a81b6786a75134faf2f1169f12997350881d9021d0903e06de0745d3160a6d3e94dbd5b0a64dcbb94b5831d0e3375ab892b1772dcf9790528543f8dd0d367b36768153b5e31503a0f1aecb004580b44ffac58baae8b1714f0833c7638cc8dab303a320f4822ab4c7a37c69196203de3319d5ce1c4d13c733331dedc67a129a154fd128401ab0616d55a130ac3d42d93d1913940d13fd0c9ee0183685c60da01c5421bd72f7a8c8efccef9afd374267ad93d642365be0636a0d28ec7600941d9e6f23917f0e97f23ce5bef35d19ec863da0ed9059b2be70bec196c66dfa10ec0e49b338f7017258651bf95021035c595429bb0903248fe52a2b5b595dd7b4d945cc2340cdca536be389ee3f67886c5798f773fe8e0dac508c989659277a2180da4ca4ff07821058b8b251445d63d6b13ed1098a6417e39cac85197dbe31962ab9bd9f1f22a226d45366f6d0620fdb08c900d281af6110284b20085b414861d905d88f2e52739ee8cbb8022143259d3dd84691730aa2d52da441a8de0c6958068870022a41e9629ad3473fd3b8fdbe319dadb9b4924da994d2d716c7896fbe35152f78b48245d6b2da4507faf582be8eaf159b721cc837b05ae7debb1f79d08cb8b515edad942a22bc4b1c33eb3d34b1c797f06af90a72d16e2f96d9a74aa11dca8586b222d01af0fb60070f6c402d72f15d97f28c6f6d7027a5f5ce6c3233dc4e2ede496b278be4fff608cee8d3e1add806aeca51094cbb06397c1ecc328e746537c7e3ccdb5cb1136bf60635882d4d41c6ec6836ab37efa214f72208ed9f4d7cdd38ee310280542e38b1c43fb6de26b3672e1ec3cc99bcb246f66a938a3241ab3e91f7c861fbf77710b1e5e49915bae974203ba0e9e9c9cbc373d6d6d305a040a89c2a77f50b27d5782bbbf7acccf28349235dd16cf6dd374f7295e1de8a45c02d37499182b01cc0201a085d61a2144d8b2ac8fb6ed340e77240c4261890e04c250185262546d534a032154b59e0ad394e41c98182bf268ce6721ed9f064e0253356f6da2e24c1f030f783c15fe6da680af8021602bd051532ca9b8521488559f61aa86c29343578fbf0264a94c906c7d3409214c20043457a116ff6de6795578012889ff6b98fe016ea0ce1c6a2573410000000049454e44ae426082</data> </image> </images> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>labelview.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/libktorrent/torrent/advancedchokealgorithm.cpp b/libktorrent/torrent/advancedchokealgorithm.cpp index 7ca0578..f6c807f 100644 --- a/libktorrent/torrent/advancedchokealgorithm.cpp +++ b/libktorrent/torrent/advancedchokealgorithm.cpp @@ -234,7 +234,7 @@ namespace bt while (i != start) { Peer* p = pman.getPeer(i); - if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.contains(p)) + if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.tqcontains(p)) return p->getID(); i = (i + 1) % num_peers; } diff --git a/libktorrent/torrent/announcelist.cpp b/libktorrent/torrent/announcelist.cpp index 74b3397..7eebf19 100644 --- a/libktorrent/torrent/announcelist.cpp +++ b/libktorrent/torrent/announcelist.cpp @@ -25,15 +25,15 @@ #include <util/log.h> #include <klocale.h> -#include <qstringlist.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqtextstream.h> namespace bt { AnnounceList::AnnounceList() - :m_datadir(QString::null) + :m_datadir(TQString()) { curr = 0; } @@ -87,7 +87,7 @@ namespace bt bool AnnounceList::removeTracker(KURL url) { - KURL::List::iterator i = custom_trackers.find(url); + KURL::List::iterator i = custom_trackers.tqfind(url); if(i != custom_trackers.end()) { custom_trackers.remove(i); @@ -122,11 +122,11 @@ namespace bt void AnnounceList::saveTrackers() { - QFile file(m_datadir + "trackers"); + TQFile file(m_datadir + "trackers"); if(!file.open(IO_WriteOnly)) return; - QTextStream stream(&file); + TQTextStream stream(&file); for (KURL::List::iterator i = custom_trackers.begin();i != custom_trackers.end();i++) stream << (*i).prettyURL() << ::endl; file.close(); @@ -134,11 +134,11 @@ namespace bt void AnnounceList::loadTrackers() { - QFile file(m_datadir + "trackers"); + TQFile file(m_datadir + "trackers"); if(!file.open(IO_ReadOnly)) return; - QTextStream stream(&file); + TQTextStream stream(&file); while (!stream.atEnd()) { KURL url(stream.readLine().stripWhiteSpace()); @@ -148,7 +148,7 @@ namespace bt file.close(); } - void AnnounceList::setDatadir(const QString& theValue) + void AnnounceList::setDatadir(const TQString& theValue) { m_datadir = theValue; loadTrackers(); @@ -187,7 +187,7 @@ namespace bt for (Uint32 i = 0;i < al->getNumTrackerURLs();i++) { KURL url = *al->trackers.at(i); - if (!trackers.contains(url) && !custom_trackers.contains(url)) + if (!trackers.tqcontains(url) && !custom_trackers.tqcontains(url)) custom_trackers.append(url); } } diff --git a/libktorrent/torrent/announcelist.h b/libktorrent/torrent/announcelist.h index 38f9e72..3cb9edd 100644 --- a/libktorrent/torrent/announcelist.h +++ b/libktorrent/torrent/announcelist.h @@ -22,7 +22,7 @@ #if 0 #include <kurl.h> -#include <qstring.h> +#include <tqstring.h> #include <interfaces/trackerslist.h> namespace bt @@ -88,7 +88,7 @@ namespace bt ///Loads custom trackers from a file void loadTrackers(); - void setDatadir(const QString& theValue); + void setDatadir(const TQString& theValue); /** * Merge an other announce list to this one. @@ -97,7 +97,7 @@ namespace bt void merge(const AnnounceList* al); private: - QString m_datadir; + TQString m_datadir; }; diff --git a/libktorrent/torrent/authenticate.cpp b/libktorrent/torrent/authenticate.cpp index 14e34ea..bb7fe3a 100644 --- a/libktorrent/torrent/authenticate.cpp +++ b/libktorrent/torrent/authenticate.cpp @@ -26,7 +26,7 @@ namespace bt { - Authenticate::Authenticate(const QString & ip,Uint16 port, + Authenticate::Authenticate(const TQString & ip,Uint16 port, const SHA1Hash & info_hash,const PeerID & peer_id,PeerManager* pman) : info_hash(info_hash),our_peer_id(peer_id),pman(pman) { diff --git a/libktorrent/torrent/authenticate.h b/libktorrent/torrent/authenticate.h index 03c8d75..36e6d05 100644 --- a/libktorrent/torrent/authenticate.h +++ b/libktorrent/torrent/authenticate.h @@ -44,6 +44,7 @@ namespace bt class Authenticate : public AuthenticateBase { Q_OBJECT + TQ_OBJECT public: /** @@ -54,7 +55,7 @@ namespace bt * @param peer_id Peer ID * @param pman PeerManager */ - Authenticate(const QString & ip,Uint16 port, + Authenticate(const TQString & ip,Uint16 port, const SHA1Hash & info_hash,const PeerID & peer_id, PeerManager* pman); @@ -73,7 +74,7 @@ namespace bt /// See if the authentication is succesfull bool isSuccesfull() const {return succes;} - const QString & getIP() const {return host;} + const TQString & getIP() const {return host;} Uint16 getPort() const {return port;} protected slots: @@ -88,7 +89,7 @@ namespace bt protected: SHA1Hash info_hash; PeerID our_peer_id,peer_id; - QString host; + TQString host; Uint16 port; bool succes; PeerManager* pman; diff --git a/libktorrent/torrent/authenticatebase.cpp b/libktorrent/torrent/authenticatebase.cpp index 9ee2ad7..c00e87f 100644 --- a/libktorrent/torrent/authenticatebase.cpp +++ b/libktorrent/torrent/authenticatebase.cpp @@ -32,7 +32,7 @@ namespace bt AuthenticateBase::AuthenticateBase(mse::StreamSocket* s) : sock(s),finished(false),local(false) { - connect(&timer,SIGNAL(timeout()),this,SLOT(onTimeout())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onTimeout())); timer.start(20000,true); memset(handshake,0x00,68); bytes_of_handshake_recieved = 0; diff --git a/libktorrent/torrent/authenticatebase.h b/libktorrent/torrent/authenticatebase.h index fdab158..87c851b 100644 --- a/libktorrent/torrent/authenticatebase.h +++ b/libktorrent/torrent/authenticatebase.h @@ -20,9 +20,9 @@ #ifndef BTAUTHENTICATEBASE_H #define BTAUTHENTICATEBASE_H -#include <qobject.h> -#include <qsocket.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqsocket.h> +#include <tqtimer.h> #include <util/constants.h> @@ -45,9 +45,10 @@ namespace bt * It has a socket, handles the timing out, provides a function to send * the handshake. */ - class AuthenticateBase : public QObject + class AuthenticateBase : public TQObject { Q_OBJECT + TQ_OBJECT public: AuthenticateBase(mse::StreamSocket* s = 0); virtual ~AuthenticateBase(); @@ -111,7 +112,7 @@ namespace bt protected: mse::StreamSocket* sock; - QTimer timer; + TQTimer timer; bool finished; Uint8 handshake[68]; Uint32 bytes_of_handshake_recieved; diff --git a/libktorrent/torrent/bdecoder.cpp b/libktorrent/torrent/bdecoder.cpp index 6c5a179..778cf8a 100644 --- a/libktorrent/torrent/bdecoder.cpp +++ b/libktorrent/torrent/bdecoder.cpp @@ -27,7 +27,7 @@ namespace bt { - BDecoder::BDecoder(const QByteArray & data,bool verbose,Uint32 off) + BDecoder::BDecoder(const TQByteArray & data,bool verbose,Uint32 off) : data(data),pos(off),verbose(verbose) { } @@ -59,7 +59,7 @@ namespace bt } else { - throw Error(i18n("Illegal token: %1").arg(data[pos])); + throw Error(i18n("Illegal token: %1").tqarg(data[pos])); } } @@ -83,7 +83,7 @@ namespace bt throw Error(i18n("Decode error")); } - QByteArray key = k->data().toByteArray(); + TQByteArray key = k->data().toByteArray(); delete kn; BNode* data = decode(); @@ -130,7 +130,7 @@ namespace bt { Uint32 off = pos; pos++; - QString n; + TQString n; // look for e and add everything between i and e to n while (pos < data.size() && data[pos] != 'e') { @@ -161,7 +161,7 @@ namespace bt Int64 bi = 0LL; bi = n.toLongLong(&ok); if (!ok) - throw Error(i18n("Cannot convert %1 to an int").arg(n)); + throw Error(i18n("Cannot convert %1 to an int").tqarg(n)); pos++; if (verbose) Out() << "INT64 = " << n << endl; @@ -177,7 +177,7 @@ namespace bt // string are encoded 4:spam (length:string) // first get length by looking for the : - QString n; + TQString n; while (pos < data.size() && data[pos] != ':') { n += data[pos]; @@ -195,16 +195,16 @@ namespace bt len = n.toInt(&ok); if (!ok) { - throw Error(i18n("Cannot convert %1 to an int").arg(n)); + throw Error(i18n("Cannot convert %1 to an int").tqarg(n)); } // move pos to the first part of the string pos++; if (pos + len > data.size()) throw Error(i18n("Torrent is incomplete!")); - QByteArray arr(len); + TQByteArray arr(len); for (unsigned int i = pos;i < pos + len;i++) - arr.at(i-pos) = data[i]; + arr.tqat(i-pos) = data[i]; pos += len; // read the string into n @@ -214,7 +214,7 @@ namespace bt if (verbose) { if (arr.size() < 200) - Out() << "STRING " << QString(arr) << endl; + Out() << "STRING " << TQString(arr) << endl; else Out() << "STRING " << "really long string" << endl; } diff --git a/libktorrent/torrent/bdecoder.h b/libktorrent/torrent/bdecoder.h index dfffce5..438a656 100644 --- a/libktorrent/torrent/bdecoder.h +++ b/libktorrent/torrent/bdecoder.h @@ -20,7 +20,7 @@ #ifndef BTBDECODER_H #define BTBDECODER_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace bt @@ -39,7 +39,7 @@ namespace bt */ class BDecoder { - const QByteArray & data; + const TQByteArray & data; Uint32 pos; bool verbose; public: @@ -49,7 +49,7 @@ namespace bt * @param verbose Verbose output to the log * @param off Offset to start parsing */ - BDecoder(const QByteArray & data,bool verbose,Uint32 off = 0); + BDecoder(const TQByteArray & data,bool verbose,Uint32 off = 0); virtual ~BDecoder(); /** diff --git a/libktorrent/torrent/bencoder.cpp b/libktorrent/torrent/bencoder.cpp index e4a80a0..ef01123 100644 --- a/libktorrent/torrent/bencoder.cpp +++ b/libktorrent/torrent/bencoder.cpp @@ -38,7 +38,7 @@ namespace bt //////////////////////////////////// - BEncoderBufferOutput::BEncoderBufferOutput(QByteArray & data) : data(data),ptr(0) + BEncoderBufferOutput::BEncoderBufferOutput(TQByteArray & data) : data(data),ptr(0) { } @@ -87,7 +87,7 @@ namespace bt { if (!out) return; - QCString s = QString("i%1e").arg(val).utf8(); + TQCString s = TQString("i%1e").tqarg(val).utf8(); out->write(s,s.length()); } @@ -95,25 +95,25 @@ namespace bt { if (!out) return; - QCString s = QString("i%1e").arg(val).utf8(); + TQCString s = TQString("i%1e").tqarg(val).utf8(); out->write(s,s.length()); } - void BEncoder::write(const QString & str) + void BEncoder::write(const TQString & str) { if (!out) return; - QCString u = str.utf8(); - QCString s = QString("%1:").arg(u.length()).utf8(); + TQCString u = str.utf8(); + TQCString s = TQString("%1:").tqarg(u.length()).utf8(); out->write(s,s.length()); out->write(u,u.length()); } - void BEncoder::write(const QByteArray & data) + void BEncoder::write(const TQByteArray & data) { if (!out) return; - QCString s = QString::number(data.size()).utf8(); + TQCString s = TQString::number(data.size()).utf8(); out->write(s,s.length()); out->write(":",1); out->write(data.data(),data.size()); @@ -123,7 +123,7 @@ namespace bt { if (!out) return; - QCString s = QString("%1:").arg(size).utf8(); + TQCString s = TQString("%1:").tqarg(size).utf8(); out->write(s,s.length()); out->write((const char*)data,size); } diff --git a/libktorrent/torrent/bencoder.h b/libktorrent/torrent/bencoder.h index 8760d14..eb84c39 100644 --- a/libktorrent/torrent/bencoder.h +++ b/libktorrent/torrent/bencoder.h @@ -58,14 +58,14 @@ namespace bt }; /** - * Write the output of a BEncoder to a QByteArray + * Write the output of a BEncoder to a TQByteArray */ class BEncoderBufferOutput : public BEncoderOutput { - QByteArray & data; + TQByteArray & data; Uint32 ptr; public: - BEncoderBufferOutput(QByteArray & data); + BEncoderBufferOutput(TQByteArray & data); void write(const char* str,Uint32 len); }; @@ -124,13 +124,13 @@ namespace bt * Write a string * @param str */ - void write(const QString & str); + void write(const TQString & str); /** - * Write a QByteArray + * Write a TQByteArray * @param data */ - void write(const QByteArray & data); + void write(const TQByteArray & data); /** * Write a data array diff --git a/libktorrent/torrent/bnode.cpp b/libktorrent/torrent/bnode.cpp index e76dcf3..07b7ba0 100644 --- a/libktorrent/torrent/bnode.cpp +++ b/libktorrent/torrent/bnode.cpp @@ -56,8 +56,8 @@ namespace bt BDictNode::~BDictNode() { - QValueList<DictEntry>::iterator i = children.begin(); - while (i != children.end()) + TQValueList<DictEntry>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { DictEntry & e = *i; delete e.node; @@ -65,31 +65,31 @@ namespace bt } } - void BDictNode::insert(const QByteArray & key,BNode* node) + void BDictNode::insert(const TQByteArray & key,BNode* node) { DictEntry entry; entry.key = key; entry.node = node; - children.append(entry); + tqchildren.append(entry); } - BNode* BDictNode::getData(const QString & key) + BNode* BDictNode::getData(const TQString & key) { - QValueList<DictEntry>::iterator i = children.begin(); - while (i != children.end()) + TQValueList<DictEntry>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { DictEntry & e = *i; - if (QString(e.key) == key) + if (TQString(e.key) == key) return e.node; i++; } return 0; } - BDictNode* BDictNode::getDict(const QByteArray & key) + BDictNode* BDictNode::getDict(const TQByteArray & key) { - QValueList<DictEntry>::iterator i = children.begin(); - while (i != children.end()) + TQValueList<DictEntry>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { DictEntry & e = *i; if (e.key == key) @@ -99,19 +99,19 @@ namespace bt return 0; } - BListNode* BDictNode::getList(const QString & key) + BListNode* BDictNode::getList(const TQString & key) { BNode* n = getData(key); return dynamic_cast<BListNode*>(n); } - BDictNode* BDictNode::getDict(const QString & key) + BDictNode* BDictNode::getDict(const TQString & key) { BNode* n = getData(key); return dynamic_cast<BDictNode*>(n); } - BValueNode* BDictNode::getValue(const QString & key) + BValueNode* BDictNode::getValue(const TQString & key) { BNode* n = getData(key); return dynamic_cast<BValueNode*>(n); @@ -120,11 +120,11 @@ namespace bt void BDictNode::printDebugInfo() { Out() << "DICT" << endl; - QValueList<DictEntry>::iterator i = children.begin(); - while (i != children.end()) + TQValueList<DictEntry>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { DictEntry & e = *i; - Out() << QString(e.key) << ": " << endl; + Out() << TQString(e.key) << ": " << endl; e.node->printDebugInfo(); i++; } @@ -135,7 +135,7 @@ namespace bt BListNode::BListNode(Uint32 off) : BNode(LIST,off) { - children.setAutoDelete(true); + tqchildren.setAutoDelete(true); } @@ -145,7 +145,7 @@ namespace bt void BListNode::append(BNode* node) { - children.append(node); + tqchildren.append(node); } BListNode* BListNode::getList(Uint32 idx) @@ -165,10 +165,10 @@ namespace bt void BListNode::printDebugInfo() { - Out() << "LIST " << children.count() << endl; - for (Uint32 i = 0;i < children.count();i++) + Out() << "LIST " << tqchildren.count() << endl; + for (Uint32 i = 0;i < tqchildren.count();i++) { - BNode* n = children.at(i); + BNode* n = tqchildren.at(i); n->printDebugInfo(); } Out() << "END" << endl; diff --git a/libktorrent/torrent/bnode.h b/libktorrent/torrent/bnode.h index 685291c..ccd2c94 100644 --- a/libktorrent/torrent/bnode.h +++ b/libktorrent/torrent/bnode.h @@ -20,8 +20,8 @@ #ifndef BTBNODE_H #define BTBNODE_H -#include <qptrlist.h> -#include <qvaluelist.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> #include <util/constants.h> #include "value.h" @@ -77,7 +77,7 @@ namespace bt * @author Joris Guisson * @brief Represents a value (string,bytearray or int) in bencoded data * - * @todo Use QVariant + * @todo Use TQVariant */ class BValueNode : public BNode { @@ -99,10 +99,10 @@ namespace bt { struct DictEntry { - QByteArray key; + TQByteArray key; BNode* node; }; - QValueList<DictEntry> children; + TQValueList<DictEntry> tqchildren; public: BDictNode(Uint32 off); virtual ~BDictNode(); @@ -112,42 +112,42 @@ namespace bt * @param key The key * @param node The node */ - void insert(const QByteArray & key,BNode* node); + void insert(const TQByteArray & key,BNode* node); /** * Get a BNode. * @param key The key * @return The node or 0 if there is no node with has key @a key */ - BNode* getData(const QString & key); + BNode* getData(const TQString & key); /** * Get a BListNode. * @param key The key * @return The node or 0 if there is no list node with has key @a key */ - BListNode* getList(const QString & key); + BListNode* getList(const TQString & key); /** * Get a BDictNode. * @param key The key * @return The node or 0 if there is no dict node with has key @a key */ - BDictNode* getDict(const QString & key); + BDictNode* getDict(const TQString & key); /** * Get a BDictNode. * @param key The key * @return The node or 0 if there is no dict node with has key @a key */ - BDictNode* getDict(const QByteArray & key); + BDictNode* getDict(const TQByteArray & key); /** * Get a BValueNode. * @param key The key * @return The node or 0 if there is no value node with has key @a key */ - BValueNode* getValue(const QString & key); + BValueNode* getValue(const TQString & key); void printDebugInfo(); }; @@ -159,7 +159,7 @@ namespace bt */ class BListNode : public BNode { - QPtrList<BNode> children; + TQPtrList<BNode> tqchildren; public: BListNode(Uint32 off); virtual ~BListNode(); @@ -172,14 +172,14 @@ namespace bt void printDebugInfo(); /// Get the number of nodes in the list. - Uint32 getNumChildren() const {return children.count();} + Uint32 getNumChildren() const {return tqchildren.count();} /** * Get a node from the list * @param idx The index * @return The node or 0 if idx is out of bounds */ - BNode* getChild(Uint32 idx) {return children.at(idx);} + BNode* getChild(Uint32 idx) {return tqchildren.at(idx);} /** * Get a BListNode. diff --git a/libktorrent/torrent/cache.cpp b/libktorrent/torrent/cache.cpp index dcf9a77..927e631 100644 --- a/libktorrent/torrent/cache.cpp +++ b/libktorrent/torrent/cache.cpp @@ -26,7 +26,7 @@ namespace bt { - Cache::Cache(Torrent & tor,const QString & tmpdir,const QString & datadir) + Cache::Cache(Torrent & tor,const TQString & tmpdir,const TQString & datadir) : tor(tor),tmpdir(tmpdir),datadir(datadir),mmap_failures(0) { if (!datadir.endsWith(bt::DirSeparator())) @@ -43,7 +43,7 @@ namespace bt {} - void Cache::changeTmpDir(const QString & ndir) + void Cache::changeTmpDir(const TQString & ndir) { tmpdir = ndir; } diff --git a/libktorrent/torrent/cache.h b/libktorrent/torrent/cache.h index 4c373ee..8630bc7 100644 --- a/libktorrent/torrent/cache.h +++ b/libktorrent/torrent/cache.h @@ -22,7 +22,7 @@ #include <kio/job.h> -class QStringList; +class TQStringList; namespace bt { @@ -43,36 +43,36 @@ namespace bt { protected: Torrent & tor; - QString tmpdir; - QString datadir; + TQString tmpdir; + TQString datadir; bool preexisting_files; Uint32 mmap_failures; public: - Cache(Torrent & tor,const QString & tmpdir,const QString & datadir); + Cache(Torrent & tor,const TQString & tmpdir,const TQString & datadir); virtual ~Cache(); /// Get the datadir - QString getDataDir() const {return datadir;} + TQString getDataDir() const {return datadir;} /** * Get the actual output path. * @return The output path */ - virtual QString getOutputPath() const = 0; + virtual TQString getOutputPath() const = 0; /** * Changes the tmp dir. All data files should already been moved. * This just modifies the tmpdir variable. * @param ndir The new tmpdir */ - virtual void changeTmpDir(const QString & ndir); + virtual void changeTmpDir(const TQString & ndir); /** * Move the data files to a new directory. * @param ndir The directory * @return The KIO::Job doing the move */ - virtual KIO::Job* moveDataFiles(const QString & ndir) = 0; + virtual KIO::Job* moveDataFiles(const TQString & ndir) = 0; /** * The move data files job is done. @@ -85,7 +85,7 @@ namespace bt * This just modifies the datadir variable. * @param outputpath New output path */ - virtual void changeOutputPath(const QString & outputpath) = 0; + virtual void changeOutputPath(const TQString & outputpath) = 0; /** * Load a chunk into memory. If something goes wrong, @@ -140,7 +140,7 @@ namespace bt * Test all files and see if they are not missing. * If so put them in a list */ - virtual bool hasMissingFiles(QStringList & sl) = 0; + virtual bool hasMissingFiles(TQStringList & sl) = 0; /** * Delete all data files, in case of multi file torrents diff --git a/libktorrent/torrent/cachefile.cpp b/libktorrent/torrent/cachefile.cpp index 6367b7f..4196016 100644 --- a/libktorrent/torrent/cachefile.cpp +++ b/libktorrent/torrent/cachefile.cpp @@ -28,7 +28,7 @@ #include <sys/mman.h> #include <unistd.h> #include <errno.h> -#include <qfile.h> +#include <tqfile.h> #include <kio/netaccess.h> #include <klocale.h> #include <kfileitem.h> @@ -46,7 +46,7 @@ // Not all systems have an O_LARGEFILE - Solaris depending // on command-line defines, FreeBSD never - so in those cases, -// make it a zero bitmask. As long as it's only OR'ed into +// make it a zero bittqmask. As long as it's only OR'ed into // open(2) flags, that's fine. // #ifndef O_LARGEFILE @@ -71,7 +71,7 @@ namespace bt close(); } - void CacheFile::changePath(const QString & npath) + void CacheFile::changePath(const TQString & npath) { path = npath; } @@ -81,26 +81,26 @@ namespace bt int flags = O_LARGEFILE; // by default allways try read write - fd = ::open(QFile::encodeName(path),flags | O_RDWR); + fd = ::open(TQFile::encodeName(path),flags | O_RDWR); if (fd < 0 && mode == READ) { // in case RDWR fails, try readonly if possible - fd = ::open(QFile::encodeName(path),flags | O_RDONLY); + fd = ::open(TQFile::encodeName(path),flags | O_RDONLY); if (fd >= 0) read_only = true; } if (fd < 0) { - throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno))); } file_size = FileSize(fd); } - void CacheFile::open(const QString & path,Uint64 size) + void CacheFile::open(const TQString & path,Uint64 size) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); // only set the path and the max size, we only open the file when it is needed this->path = path; max_size = size; @@ -108,7 +108,7 @@ namespace bt void* CacheFile::map(MMappeable* thing,Uint64 off,Uint32 size,Mode mode) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); // reopen the file if necessary if (fd == -1) { @@ -118,7 +118,7 @@ namespace bt if (read_only && mode != READ) { - throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path)); + throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path)); } if (off + size > max_size) @@ -164,7 +164,7 @@ namespace bt #endif if (ptr == MAP_FAILED) { - Out() << "mmap failed : " << QString(strerror(errno)) << endl; + Out() << "mmap failed : " << TQString(strerror(errno)) << endl; return 0; } else @@ -189,7 +189,7 @@ namespace bt #endif if (ptr == MAP_FAILED) { - Out() << "mmap failed : " << QString(strerror(errno)) << endl; + Out() << "mmap failed : " << TQString(strerror(errno)) << endl; return 0; } else @@ -217,7 +217,7 @@ namespace bt } if (read_only) - throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path)); + throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path)); // jump to the end of the file SeekFile(fd,0,SEEK_END); @@ -237,22 +237,22 @@ namespace bt int nb = to_write > 1024 ? 1024 : to_write; int ret = ::write(fd,buf,nb); if (ret < 0) - throw Error(i18n("Cannot expand file %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Cannot expand file %1 : %2").tqarg(path).tqarg(strerror(errno))); else if (ret != nb) - throw Error(i18n("Cannot expand file %1 : incomplete write").arg(path)); + throw Error(i18n("Cannot expand file %1 : incomplete write").tqarg(path)); to_write -= nb; } file_size += num; // - // Out() << QString("growing %1 = %2").arg(path).arg(kt::BytesToString(file_size)) << endl; + // Out() << TQString("growing %1 = %2").tqarg(path).tqarg(kt::BytesToString(file_size)) << endl; if (file_size != FileSize(fd)) { -// Out() << QString("Homer Simpson %1 %2").arg(file_size).arg(sb.st_size) << endl; +// Out() << TQString("Homer Simpson %1 %2").tqarg(file_size).tqarg(sb.st_size) << endl; fsync(fd); if (file_size != FileSize(fd)) { - throw Error(i18n("Cannot expand file %1").arg(path)); + throw Error(i18n("Cannot expand file %1").tqarg(path)); } } } @@ -260,9 +260,9 @@ namespace bt void CacheFile::unmap(void* ptr,Uint32 size) { int ret = 0; - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); // see if it wasn't an offsetted mapping - if (mappings.contains(ptr)) + if (mappings.tqcontains(ptr)) { CacheFile::Entry & e = mappings[ptr]; #if HAVE_MUNMAP64 @@ -292,18 +292,18 @@ namespace bt if (ret < 0) { - Out(SYS_DIO|LOG_IMPORTANT) << QString("Munmap failed with error %1 : %2").arg(errno).arg(strerror(errno)) << endl; + Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").tqarg(errno).tqarg(strerror(errno)) << endl; } } void CacheFile::close() { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); if (fd == -1) return; - QMap<void*,Entry>::iterator i = mappings.begin(); + TQMap<void*,Entry>::iterator i = mappings.begin(); while (i != mappings.end()) { int ret = 0; @@ -326,7 +326,7 @@ namespace bt if (ret < 0) { - Out(SYS_DIO|LOG_IMPORTANT) << QString("Munmap failed with error %1 : %2").arg(errno).arg(strerror(errno)) << endl; + Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").tqarg(errno).tqarg(strerror(errno)) << endl; } } ::close(fd); @@ -335,7 +335,7 @@ namespace bt void CacheFile::read(Uint8* buf,Uint32 size,Uint64 off) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); bool close_again = false; // reopen the file if necessary @@ -348,7 +348,7 @@ namespace bt if (off >= file_size || off >= max_size) { - throw Error(i18n("Error : Reading past the end of the file %1").arg(path)); + throw Error(i18n("Error : Reading past the end of the file %1").tqarg(path)); } // jump to right position @@ -358,7 +358,7 @@ namespace bt if (close_again) closeTemporary(); - throw Error(i18n("Error reading from %1").arg(path)); + throw Error(i18n("Error reading from %1").tqarg(path)); } if (close_again) @@ -367,7 +367,7 @@ namespace bt void CacheFile::write(const Uint8* buf,Uint32 size,Uint64 off) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); bool close_again = false; // reopen the file if necessary @@ -379,7 +379,7 @@ namespace bt } if (read_only) - throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path)); + throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path)); if (off + size > max_size) { @@ -389,7 +389,7 @@ namespace bt if (file_size < off) { - //Out() << QString("Writing %1 bytes at %2").arg(size).arg(off) << endl; + //Out() << TQString("Writing %1 bytes at %2").tqarg(size).tqarg(off) << endl; growFile(off - file_size); } @@ -400,11 +400,11 @@ namespace bt closeTemporary(); if (ret == -1) - throw Error(i18n("Error writing to %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Error writing to %1 : %2").tqarg(path).tqarg(strerror(errno))); else if ((Uint32)ret != size) { - Out() << QString("Incomplete write of %1 bytes, should be %2").arg(ret).arg(size) << endl; - throw Error(i18n("Error writing to %1").arg(path)); + Out() << TQString("Incomplete write of %1 bytes, should be %2").tqarg(ret).tqarg(size) << endl; + throw Error(i18n("Error writing to %1").tqarg(path)); } if (off + size > file_size) @@ -424,7 +424,7 @@ namespace bt void CacheFile::preallocate(PreallocationThread* prealloc) { - QMutexLocker lock(&mutex); + TQMutexLocker lock(&mutex); if (FileSize(path) == max_size) { @@ -445,7 +445,7 @@ namespace bt if (close_again) closeTemporary(); - throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path)); + throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path)); } try @@ -472,7 +472,7 @@ namespace bt if (close_again) closeTemporary(); - throw Error(i18n("Cannot preallocate diskspace : %1").arg(strerror(errno))); + throw Error(i18n("Cannot preallocate diskspace : %1").tqarg(strerror(errno))); } } diff --git a/libktorrent/torrent/cachefile.h b/libktorrent/torrent/cachefile.h index 9c4ebc6..749f46a 100644 --- a/libktorrent/torrent/cachefile.h +++ b/libktorrent/torrent/cachefile.h @@ -20,9 +20,9 @@ #ifndef BTCACHEFILE_H #define BTCACHEFILE_H -#include <qmap.h> -#include <qmutex.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqmutex.h> +#include <tqstring.h> #include <util/constants.h> namespace bt @@ -68,10 +68,10 @@ namespace bt * @param size Max size of the file * @throw Error when something goes wrong */ - void open(const QString & path,Uint64 size); + void open(const TQString & path,Uint64 size); /// Change the path of the file - void changePath(const QString & npath); + void changePath(const TQString & npath); /** * Map a part of the file into memory, will expand the file @@ -130,7 +130,7 @@ namespace bt int fd; bool read_only; Uint64 max_size,file_size; - QString path; + TQString path; struct Entry { MMappeable* thing; @@ -140,8 +140,8 @@ namespace bt Uint32 diff; Mode mode; }; - QMap<void*,Entry> mappings; // mappings where offset wasn't a multiple of 4K - mutable QMutex mutex; + TQMap<void*,Entry> mappings; // mappings where offset wasn't a multiple of 4K + mutable TQMutex mutex; }; } diff --git a/libktorrent/torrent/cap.cpp b/libktorrent/torrent/cap.cpp index a785520..9338444 100644 --- a/libktorrent/torrent/cap.cpp +++ b/libktorrent/torrent/cap.cpp @@ -23,7 +23,7 @@ namespace bt { - typedef QValueList<Cap::Entry>::iterator CapItr; + typedef TQValueList<Cap::Entry>::iterator CapItr; Cap::Cap(bool percentage_check) : max_bytes_per_sec(0),leftover(0),current_speed(0),percentage_check(percentage_check) { diff --git a/libktorrent/torrent/cap.h b/libktorrent/torrent/cap.h index a3a365e..712f5fa 100644 --- a/libktorrent/torrent/cap.h +++ b/libktorrent/torrent/cap.h @@ -21,7 +21,7 @@ #define BTCAP_H #if 0 -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/timer.h> #include <util/constants.h> @@ -100,7 +100,7 @@ namespace bt void update(); private: - QValueList<Entry> entries; + TQValueList<Entry> entries; Uint32 max_bytes_per_sec; Timer timer; Uint32 leftover; diff --git a/libktorrent/torrent/choker.cpp b/libktorrent/torrent/choker.cpp index 0cb08e9..6162644 100644 --- a/libktorrent/torrent/choker.cpp +++ b/libktorrent/torrent/choker.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ -#include <qptrlist.h> +#include <tqptrlist.h> #include <interfaces/functions.h> #include "choker.h" #include "peermanager.h" @@ -37,7 +37,7 @@ namespace bt PeerPtrList::~PeerPtrList() {} - int PeerPtrList::compareItems(QPtrCollection::Item a, QPtrCollection::Item b) + int PeerPtrList::compareItems(TQPtrCollection::Item a, TQPtrCollection::Item b) { if (pcmp) return pcmp((Peer*)a,(Peer*)b); diff --git a/libktorrent/torrent/choker.h b/libktorrent/torrent/choker.h index ba78f3c..b44fc48 100644 --- a/libktorrent/torrent/choker.h +++ b/libktorrent/torrent/choker.h @@ -20,7 +20,7 @@ #ifndef BTCHOKER_H #define BTCHOKER_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <util/constants.h> #include "peer.h" @@ -39,7 +39,7 @@ namespace bt typedef int (*PeerCompareFunc)(Peer* a,Peer* b); - class PeerPtrList : public QPtrList<Peer> + class PeerPtrList : public TQPtrList<Peer> { PeerCompareFunc pcmp; public: @@ -48,7 +48,7 @@ namespace bt void setCompareFunc(PeerCompareFunc p) {pcmp = p;} - virtual int compareItems(QPtrCollection::Item a, QPtrCollection::Item b); + virtual int compareItems(TQPtrCollection::Item a, TQPtrCollection::Item b); }; /** diff --git a/libktorrent/torrent/chunk.cpp b/libktorrent/torrent/chunk.cpp index 6873713..aaee35e 100644 --- a/libktorrent/torrent/chunk.cpp +++ b/libktorrent/torrent/chunk.cpp @@ -37,7 +37,7 @@ namespace bt clear(); } - void Chunk::setData(Uint8* d,Status nstatus) + void Chunk::setData(Uint8* d,tqStatus nstatus) { clear(); status = nstatus; diff --git a/libktorrent/torrent/chunk.h b/libktorrent/torrent/chunk.h index 0896e96..08d63c3 100644 --- a/libktorrent/torrent/chunk.h +++ b/libktorrent/torrent/chunk.h @@ -45,7 +45,7 @@ namespace bt Chunk(unsigned int index,Uint32 size); ~Chunk(); - enum Status + enum tqStatus { MMAPPED, BUFFERED, @@ -54,13 +54,13 @@ namespace bt }; /// Get the chunks status. - Status getStatus() const; + tqStatus gettqStatus() const; /** * Set the chunks status * @param s */ - void setStatus(Status s); + void settqStatus(tqStatus s); /// Get the data const Uint8* getData() const; @@ -69,7 +69,7 @@ namespace bt Uint8* getData(); /// Set the data and the new status - void setData(Uint8* d,Status nstatus); + void setData(Uint8* d,tqStatus nstatus); /// Clear the chunk (delete data depending on the mode) void clear(); @@ -118,7 +118,7 @@ namespace bt virtual void unmapped(); private: - Status status; + tqStatus status; Uint32 index; Uint8* data; Uint32 size; @@ -126,12 +126,12 @@ namespace bt Priority priority; }; - inline Chunk::Status Chunk::getStatus() const + inline Chunk::tqStatus Chunk::gettqStatus() const { return status; } - inline void Chunk::setStatus(Chunk::Status s) + inline void Chunk::settqStatus(Chunk::tqStatus s) { status = s; } diff --git a/libktorrent/torrent/chunkdownload.cpp b/libktorrent/torrent/chunkdownload.cpp index 51e9db9..fe095a7 100644 --- a/libktorrent/torrent/chunkdownload.cpp +++ b/libktorrent/torrent/chunkdownload.cpp @@ -35,17 +35,17 @@ namespace bt { - class DownloadStatus : public std::set<Uint32> + class DownloadtqStatus : public std::set<Uint32> { public: // typedef std::set<Uint32>::iterator iterator; - DownloadStatus() + DownloadtqStatus() { } - ~DownloadStatus() + ~DownloadtqStatus() { } @@ -59,7 +59,7 @@ namespace bt erase(p); } - bool contains(Uint32 p) + bool tqcontains(Uint32 p) { return count(p) > 0; } @@ -111,7 +111,7 @@ namespace bt return false; - DownloadStatus* ds = dstatus.find(p.getPeer()); + DownloadtqStatus* ds = dstatus.tqfind(p.getPeer()); if (ds) ds->remove(pp); @@ -143,7 +143,7 @@ namespace bt } } - for (QPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) + for (TQPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) sendRequests(*i); return false; @@ -155,8 +155,8 @@ namespace bt { PeerDownloader* pd = pdown.at(i); pd->release(); - disconnect(pd,SIGNAL(timedout(const Request& )),this,SLOT(onTimeout(const Request& ))); - disconnect(pd,SIGNAL(rejected( const Request& )),this,SLOT(onRejected( const Request& ))); + disconnect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& ))); + disconnect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& ))); } dstatus.clear(); pdown.clear(); @@ -164,22 +164,22 @@ namespace bt bool ChunkDownload::assignPeer(PeerDownloader* pd) { - if (!pd || pdown.contains(pd)) + if (!pd || pdown.tqcontains(pd)) return false; pd->grab(); pdown.append(pd); - dstatus.insert(pd->getPeer()->getID(),new DownloadStatus()); + dstatus.insert(pd->getPeer()->getID(),new DownloadtqStatus()); sendRequests(pd); - connect(pd,SIGNAL(timedout(const Request& )),this,SLOT(onTimeout(const Request& ))); - connect(pd,SIGNAL(rejected( const Request& )),this,SLOT(onRejected( const Request& ))); + connect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& ))); + connect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& ))); return true; } void ChunkDownload::notDownloaded(const Request & r,bool reject) { // find the peer - DownloadStatus* ds = dstatus.find(r.getPeer()); + DownloadtqStatus* ds = dstatus.tqfind(r.getPeer()); if (ds) { // Out() << "ds != 0" << endl; @@ -188,7 +188,7 @@ namespace bt } // go over all PD's and do requets again - for (QPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) + for (TQPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) sendRequests(*i); } @@ -196,7 +196,7 @@ namespace bt { if (chunk->getIndex() == r.getIndex()) { -// Out(SYS_CON|LOG_DEBUG) << QString("Request rejected %1 %2 %3 %4").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()).arg(r.getPeer()) << endl; +// Out(SYS_CON|LOG_DEBUG) << TQString("Request rejected %1 %2 %3 %4").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()).tqarg(r.getPeer()) << endl; notDownloaded(r,true); } @@ -207,7 +207,7 @@ namespace bt // see if we are dealing with a piece of ours if (chunk->getIndex() == r.getIndex()) { - Out(SYS_CON|LOG_DEBUG) << QString("Request timed out %1 %2 %3 %4").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()).arg(r.getPeer()) << endl; + Out(SYS_CON|LOG_DEBUG) << TQString("Request timed out %1 %2 %3 %4").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()).tqarg(r.getPeer()) << endl; notDownloaded(r,false); } @@ -216,7 +216,7 @@ namespace bt void ChunkDownload::sendRequests(PeerDownloader* pd) { timer.update(); - DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); if (!ds) return; @@ -229,7 +229,7 @@ namespace bt { // get the first one in the queue Uint32 i = piece_queue.first(); - if (!ds->contains(i)) + if (!ds->tqcontains(i)) { // send request pd->download( @@ -255,18 +255,18 @@ namespace bt void ChunkDownload::update() { // go over all PD's and do requets again - for (QPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) + for (TQPtrList<PeerDownloader>::iterator i = pdown.begin();i != pdown.end();++i) sendRequests(*i); } void ChunkDownload::sendCancels(PeerDownloader* pd) { - DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); if (!ds) return; - DownloadStatus::iterator itr = ds->begin(); + DownloadtqStatus::iterator itr = ds->begin(); while (itr != ds->end()) { Uint32 i = *itr; @@ -283,13 +283,13 @@ namespace bt void ChunkDownload::endgameCancel(const Piece & p) { - QPtrList<PeerDownloader>::iterator i = pdown.begin(); + TQPtrList<PeerDownloader>::iterator i = pdown.begin(); while (i != pdown.end()) { PeerDownloader* pd = *i; - DownloadStatus* ds = dstatus.find(pd->getPeer()->getID()); + DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID()); Uint32 pp = p.getOffset() / MAX_PIECE_LEN; - if (ds && ds->contains(pp)) + if (ds && ds->tqcontains(pp)) { pd->cancel(Request(p)); ds->remove(pp); @@ -300,13 +300,13 @@ namespace bt void ChunkDownload::peerKilled(PeerDownloader* pd) { - if (!pdown.contains(pd)) + if (!pdown.tqcontains(pd)) return; dstatus.erase(pd->getPeer()->getID()); pdown.remove(pd); - disconnect(pd,SIGNAL(timedout(const Request& )),this,SLOT(onTimeout(const Request& ))); - disconnect(pd,SIGNAL(rejected( const Request& )),this,SLOT(onRejected( const Request& ))); + disconnect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& ))); + disconnect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& ))); } @@ -323,11 +323,11 @@ namespace bt return chunk->getIndex(); } - QString ChunkDownload::getCurrentPeerID() const + TQString ChunkDownload::getCurrentPeerID() const { if (pdown.count() == 0) { - return QString::null; + return TQString(); } else if (pdown.count() == 1) { @@ -343,7 +343,7 @@ namespace bt Uint32 ChunkDownload::getDownloadSpeed() const { Uint32 r = 0; - QPtrList<PeerDownloader>::const_iterator i = pdown.begin(); + TQPtrList<PeerDownloader>::const_iterator i = pdown.begin(); while (i != pdown.end()) { const PeerDownloader* pd = *i; @@ -360,7 +360,7 @@ namespace bt ChunkDownloadHeader hdr; hdr.index = chunk->getIndex(); hdr.num_bits = pieces.getNumBits(); - hdr.buffered = chunk->getStatus() == Chunk::BUFFERED ? 1 : 0; + hdr.buffered = chunk->gettqStatus() == Chunk::BUFFERED ? 1 : 0; // save the chunk header file.write(&hdr,sizeof(ChunkDownloadHeader)); // save the bitset @@ -370,7 +370,7 @@ namespace bt // if it's a buffered chunk, save the contents to file.write(chunk->getData(),chunk->getSize()); chunk->clear(); - chunk->setStatus(Chunk::ON_DISK); + chunk->settqStatus(Chunk::ON_DISK); } } @@ -415,7 +415,7 @@ namespace bt void ChunkDownload::cancelAll() { - QPtrList<PeerDownloader>::iterator i = pdown.begin(); + TQPtrList<PeerDownloader>::iterator i = pdown.begin(); while (i != pdown.end()) { sendCancels(*i); @@ -448,7 +448,7 @@ namespace bt bool ChunkDownload::isChoked() const { - QPtrList<PeerDownloader>::const_iterator i = pdown.begin(); + TQPtrList<PeerDownloader>::const_iterator i = pdown.begin(); while (i != pdown.end()) { const PeerDownloader* pd = *i; diff --git a/libktorrent/torrent/chunkdownload.h b/libktorrent/torrent/chunkdownload.h index 4119a5b..c1960f0 100644 --- a/libktorrent/torrent/chunkdownload.h +++ b/libktorrent/torrent/chunkdownload.h @@ -21,8 +21,8 @@ #define BTCHUNKDOWNLOAD_H #include <set> -#include <qobject.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqptrlist.h> #include <util/timer.h> #include <util/ptrmap.h> #include <util/sha1hashgen.h> @@ -41,7 +41,7 @@ namespace bt class Peer; class Request; class PeerDownloader; - class DownloadStatus; + class DownloadtqStatus; struct ChunkDownloadHeader { @@ -59,9 +59,10 @@ namespace bt * * This class handles the download of one Chunk. */ - class ChunkDownload : public QObject,public kt::ChunkDownloadInterface + class ChunkDownload : public TQObject,public kt::ChunkDownloadInterface { Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the chunk and the PeerManager. @@ -90,7 +91,7 @@ namespace bt const Peer* getCurrentPeer() const; /// Get the PeerID of the current peer - QString getCurrentPeerID() const; + TQString getCurrentPeerID() const; /// Get the download speed Uint32 getDownloadSpeed() const; @@ -152,7 +153,7 @@ namespace bt bool getOnlyDownloader(Uint32 & pid); /// See if a PeerDownloader is assigned to this chunk - bool containsPeer(PeerDownloader *pd) {return pdown.contains(pd);} + bool containsPeer(PeerDownloader *pd) {return pdown.tqcontains(pd);} /// See if the download is choked (i.e. all downloaders are choked) bool isChoked() const; @@ -185,14 +186,14 @@ namespace bt private: BitSet pieces; - QValueList<Uint32> piece_queue; + TQValueList<Uint32> piece_queue; Chunk* chunk; Uint32 num; Uint32 num_downloaded; Uint32 last_size; Timer timer; - QPtrList<PeerDownloader> pdown; - PtrMap<Uint32,DownloadStatus> dstatus; + TQPtrList<PeerDownloader> pdown; + PtrMap<Uint32,DownloadtqStatus> dstatus; std::set<Uint32> piece_providers; diff --git a/libktorrent/torrent/chunkmanager.cpp b/libktorrent/torrent/chunkmanager.cpp index 08aac97..ac45be5 100644 --- a/libktorrent/torrent/chunkmanager.cpp +++ b/libktorrent/torrent/chunkmanager.cpp @@ -21,7 +21,7 @@ #include <algorithm> #include <util/file.h> #include <util/array.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include "chunkmanager.h" #include "torrent.h" #include <util/error.h> @@ -43,8 +43,8 @@ namespace bt ChunkManager::ChunkManager( Torrent & tor, - const QString & tmpdir, - const QString & datadir, + const TQString & tmpdir, + const TQString & datadir, bool custom_output_name) : tor(tor),chunks(tor.getNumChunks()), bitset(tor.getNumChunks()),excluded_chunks(tor.getNumChunks()),only_seed_chunks(tor.getNumChunks()),todo(tor.getNumChunks()) @@ -79,8 +79,8 @@ namespace bt for (Uint32 i = 0;i < tor.getNumFiles();i++) { TorrentFile & tf = tor.getFile(i); - connect(&tf,SIGNAL(downloadPriorityChanged(TorrentFile*, Priority, Priority )), - this,SLOT(downloadPriorityChanged(TorrentFile*, Priority, Priority ))); + connect(&tf,TQT_SIGNAL(downloadPriorityChanged(TorrentFile*, Priority, Priority )), + this,TQT_SLOT(downloadPriorityChanged(TorrentFile*, Priority, Priority ))); if (tf.getPriority() != NORMAL_PRIORITY) { @@ -135,12 +135,12 @@ namespace bt delete cache; } - QString ChunkManager::getDataDir() const + TQString ChunkManager::getDataDir() const { return cache->getDataDir(); } - void ChunkManager::changeDataDir(const QString & data_dir) + void ChunkManager::changeDataDir(const TQString & data_dir) { cache->changeTmpDir(data_dir); index_file = data_dir + "index"; @@ -148,7 +148,7 @@ namespace bt file_priority_file = data_dir + "file_priority"; } - KIO::Job* ChunkManager::moveDataFiles(const QString & ndir) + KIO::Job* ChunkManager::moveDataFiles(const TQString & ndir) { return cache->moveDataFiles(ndir); } @@ -158,7 +158,7 @@ namespace bt cache->moveDataFilesCompleted(job); } - void ChunkManager::changeOutputPath(const QString & output_path) + void ChunkManager::changeOutputPath(const TQString & output_path) { cache->changeOutputPath(output_path); } @@ -189,7 +189,7 @@ namespace bt Chunk* c = getChunk(hdr.index); if (c) { - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); bitset.set(hdr.index,true); todo.set(hdr.index,false); recalc_chunks_left = true; @@ -204,12 +204,12 @@ namespace bt { 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())); for (unsigned int i = 0;i < tor.getNumChunks();i++) { Chunk* c = getChunk(i); - if (c->getStatus() != Chunk::NOT_DOWNLOADED) + if (c->gettqStatus() != Chunk::NOT_DOWNLOADED) { NewChunkHeader hdr; hdr.index = i; @@ -232,8 +232,8 @@ namespace bt for (Uint32 i = 0;i < tor.getNumFiles();i++) { TorrentFile & tf = tor.getFile(i); - connect(&tf,SIGNAL(downloadPriorityChanged(TorrentFile*, Priority, Priority )), - this,SLOT(downloadPriorityChanged(TorrentFile*, Priority, Priority ))); + connect(&tf,TQT_SIGNAL(downloadPriorityChanged(TorrentFile*, Priority, Priority )), + this,TQT_SLOT(downloadPriorityChanged(TorrentFile*, Priority, Priority ))); if (tf.getPriority() != NORMAL_PRIORITY) { @@ -243,7 +243,7 @@ namespace bt } } - bool ChunkManager::hasMissingFiles(QStringList & sl) + bool ChunkManager::hasMissingFiles(TQStringList & sl) { return cache->hasMissingFiles(sl); } @@ -267,16 +267,16 @@ namespace bt for (Uint32 i = 0;i < bitset.getNumBits();i++) { Chunk* c = chunks[i]; - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) { cache->save(c); c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); } - else if (c->getStatus() == Chunk::BUFFERED) + else if (c->gettqStatus() == Chunk::BUFFERED) { c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); } } cache->close(); @@ -288,11 +288,11 @@ namespace bt return 0; Chunk* c = chunks[i]; - if (c->getStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded()) + if (c->gettqStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded()) { return 0; } - else if (c->getStatus() == Chunk::ON_DISK) + else if (c->gettqStatus() == Chunk::ON_DISK) { // load the chunk if it is on disk cache->load(c); @@ -338,10 +338,10 @@ namespace bt Chunk* c = chunks[i]; if (!c->taken()) { - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); loaded.remove(i); } } @@ -352,10 +352,10 @@ namespace bt return; Chunk* c = chunks[i]; - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->setStatus(Chunk::NOT_DOWNLOADED); + c->settqStatus(Chunk::NOT_DOWNLOADED); bitset.set(i,false); todo.set(i,!excluded_chunks.get(i) && !only_seed_chunks.get(i)); loaded.remove(i); @@ -365,18 +365,18 @@ namespace bt void ChunkManager::checkMemoryUsage() { Uint32 num_removed = 0; - QMap<Uint32,TimeStamp>::iterator i = loaded.begin(); + TQMap<Uint32,TimeStamp>::iterator i = loaded.begin(); while (i != loaded.end()) { Chunk* c = chunks[i.key()]; // get rid of chunk if nobody asked for it in the last 5 seconds if (!c->taken() && bt::GetCurrentTime() - i.data() > 5000) { - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) cache->save(c); c->clear(); - c->setStatus(Chunk::ON_DISK); - QMap<Uint32,TimeStamp>::iterator j = i; + c->settqStatus(Chunk::ON_DISK); + TQMap<Uint32,TimeStamp>::iterator j = i; i++; loaded.erase(j); num_removed++; @@ -387,7 +387,7 @@ namespace bt } } // Uint32 num_in_mem = loaded.count(); - // Out() << QString("Cleaned %1 chunks, %2 still in memory").arg(num_removed).arg(num_in_mem) << endl; + // Out() << TQString("Cleaned %1 chunks, %2 still in memory").tqarg(num_removed).tqarg(num_in_mem) << endl; } void ChunkManager::saveChunk(unsigned int i,bool update_index) @@ -413,7 +413,7 @@ namespace bt else { c->clear(); - c->setStatus(Chunk::NOT_DOWNLOADED); + c->settqStatus(Chunk::NOT_DOWNLOADED); Out(SYS_DIO|LOG_IMPORTANT) << "Warning: attempted to save a chunk which was excluded" << endl; } } @@ -429,7 +429,7 @@ namespace bt // try again if (!fptr.open(index_file,"r+b")) // panick if it failes - 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())); } @@ -837,7 +837,7 @@ namespace bt // Out(SYS_DIO|LOG_DEBUG) << "Excluding chunks " << first << " to " << last << endl; // first and last chunk may be part of multiple files // so we can't just exclude them - QValueList<Uint32> files,last_files; + TQValueList<Uint32> files,last_files; // get list of files where first chunk lies in tor.calcChunkPos(first,files); @@ -874,7 +874,7 @@ namespace bt bool modified = false; // if one file in the list needs to be downloaded,increment first - for (QValueList<Uint32>::iterator i = files.begin();i != files.end();i++) + for (TQValueList<Uint32>::iterator i = files.begin();i != files.end();i++) { if (*i == tf->getIndex()) continue; @@ -903,7 +903,7 @@ namespace bt modified = false; // if one file in the list needs to be downloaded,decrement last - for (QValueList<Uint32>::iterator i = last_files.begin();i != last_files.end();i++) + for (TQValueList<Uint32>::iterator i = last_files.begin();i != last_files.end();i++) { if (*i == tf->getIndex()) continue; @@ -962,14 +962,14 @@ namespace bt // first and last chunk may be part of multiple files // so we can't just exclude them - QValueList<Uint32> files; + TQValueList<Uint32> files; // get list of files where first chunk lies in tor.calcChunkPos(first,files); Chunk* c = chunks[first]; // if one file in the list needs to be downloaded,increment first - for (QValueList<Uint32>::iterator i = files.begin();i != files.end();i++) + for (TQValueList<Uint32>::iterator i = files.begin();i != files.end();i++) { Priority np = tor.getFile(*i).getPriority(); if (np > newpriority && *i != tf->getIndex()) @@ -988,7 +988,7 @@ namespace bt tor.calcChunkPos(last,files); c = chunks[last]; // if one file in the list needs to be downloaded,decrement last - for (QValueList<Uint32>::iterator i = files.begin();i != files.end();i++) + for (TQValueList<Uint32>::iterator i = files.begin();i != files.end();i++) { Priority np = tor.getFile(*i).getPriority(); if (np > newpriority && *i != tf->getIndex()) @@ -1016,13 +1016,13 @@ namespace bt bool ChunkManager::prepareChunk(Chunk* c,bool allways) { - if (!allways && c->getStatus() != Chunk::NOT_DOWNLOADED) + if (!allways && c->gettqStatus() != Chunk::NOT_DOWNLOADED) return false; return cache->prep(c); } - QString ChunkManager::getOutputPath() const + TQString ChunkManager::getOutputPath() const { return cache->getOutputPath(); } @@ -1044,7 +1044,7 @@ namespace bt bitset.set(i,true); todo.set(i,false); // the chunk must be on disk - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); tor.updateFilePercentage(i,bitset); } else if (!ok_chunks.get(i) && bitset.get(i)) @@ -1053,12 +1053,12 @@ namespace bt // We think we have a chunk, but we don't bitset.set(i,false); todo.set(i,!only_seed_chunks.get(i) && !excluded_chunks.get(i)); - if (c->getStatus() == Chunk::ON_DISK) + if (c->gettqStatus() == Chunk::ON_DISK) { - c->setStatus(Chunk::NOT_DOWNLOADED); + c->settqStatus(Chunk::NOT_DOWNLOADED); tor.updateFilePercentage(i,bitset); } - else if (c->getStatus() == Chunk::MMAPPED || c->getStatus() == Chunk::BUFFERED) + else if (c->gettqStatus() == Chunk::MMAPPED || c->gettqStatus() == Chunk::BUFFERED) { resetChunk(i); } diff --git a/libktorrent/torrent/chunkmanager.h b/libktorrent/torrent/chunkmanager.h index daa2300..2ff2ca7 100644 --- a/libktorrent/torrent/chunkmanager.h +++ b/libktorrent/torrent/chunkmanager.h @@ -20,15 +20,15 @@ #ifndef BTCHUNKMANAGER_H #define BTCHUNKMANAGER_H -#include <qmap.h> -#include <qstring.h> -#include <qobject.h> -#include <qptrvector.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqptrvector.h> #include <util/bitset.h> #include "chunk.h" #include "globals.h" -class QStringList; +class TQStringList; namespace KIO { @@ -58,15 +58,16 @@ namespace bt * The chunks are stored in the cache file in the correct order. Eliminating * the need for a file reconstruction algorithm for single files. */ - class ChunkManager : public QObject + class ChunkManager : public TQObject { Q_OBJECT + TQ_OBJECT Torrent & tor; - QString index_file,file_info_file,file_priority_file; - QPtrVector<Chunk> chunks; + TQString index_file,file_info_file,file_priority_file; + TQPtrVector<Chunk> chunks; Cache* cache; - QMap<Uint32,TimeStamp> loaded; // loaded chunks and when they were loaded + TQMap<Uint32,TimeStamp> loaded; // loaded chunks and when they were loaded BitSet bitset; BitSet excluded_chunks; BitSet only_seed_chunks; @@ -78,8 +79,8 @@ namespace bt bool during_load; public: ChunkManager(Torrent & tor, - const QString & tmpdir, - const QString & datadir, + const TQString & tmpdir, + const TQString & datadir, bool custom_output_name); virtual ~ChunkManager(); @@ -87,12 +88,12 @@ namespace bt const Torrent & getTorrent() const {return tor;} /// Get the data dir - QString getDataDir() const; + TQString getDataDir() const; /// Get the actual output path - QString getOutputPath() const; + TQString getOutputPath() const; - void changeOutputPath(const QString& output_path); + void changeOutputPath(const TQString& output_path); /// Remove obsolete chunks void checkMemoryUsage(); @@ -101,14 +102,14 @@ namespace bt * Change the data dir. * @param data_dir */ - void changeDataDir(const QString & data_dir); + void changeDataDir(const TQString & data_dir); /** * Move the data files of the torrent. * @param ndir The new directory * @return The job doing the move */ - KIO::Job* moveDataFiles(const QString & ndir); + KIO::Job* moveDataFiles(const TQString & ndir); /** * The move data files job has finished @@ -133,7 +134,7 @@ namespace bt * Test all files and see if they are not missing. * If so put them in a list */ - bool hasMissingFiles(QStringList & sl); + bool hasMissingFiles(TQStringList & sl); /** * Preallocate diskspace for all files @@ -357,7 +358,8 @@ namespace bt private slots: void downloadStatusChanged(TorrentFile* tf,bool download); void downloadPriorityChanged(TorrentFile* tf,Priority newpriority,Priority oldpriority); - + + private: static Uint32 max_chunk_size_for_data_check; }; diff --git a/libktorrent/torrent/chunkselector.cpp b/libktorrent/torrent/chunkselector.cpp index b1c42fa..9c05629 100644 --- a/libktorrent/torrent/chunkselector.cpp +++ b/libktorrent/torrent/chunkselector.cpp @@ -165,7 +165,7 @@ namespace bt for (Uint32 i = from;i <= to;i++) { bool in_chunks = std::find(chunks.begin(),chunks.end(),i) != chunks.end(); - if (!in_chunks && cman.getChunk(i)->getStatus() != Chunk::ON_DISK) + if (!in_chunks && cman.getChunk(i)->gettqStatus() != Chunk::ON_DISK) { // Out(SYS_DIO|LOG_DEBUG) << "ChunkSelector::reIncluded " << i << endl; chunks.push_back(i); diff --git a/libktorrent/torrent/dndfile.cpp b/libktorrent/torrent/dndfile.cpp index deace69..2ca669b 100644 --- a/libktorrent/torrent/dndfile.cpp +++ b/libktorrent/torrent/dndfile.cpp @@ -36,14 +36,14 @@ namespace bt Uint8 data_sha1[20]; }; - DNDFile::DNDFile(const QString & path) : path(path) + DNDFile::DNDFile(const TQString & path) : path(path) {} DNDFile::~DNDFile() {} - void DNDFile::changePath(const QString & npath) + void DNDFile::changePath(const TQString & npath) { path = npath; } @@ -105,7 +105,7 @@ namespace bt File fptr; if (!fptr.open(path,"wb")) - throw Error(i18n("Cannot create file %1 : %2").arg(path).arg(fptr.errorString())); + throw Error(i18n("Cannot create file %1 : %2").tqarg(path).tqarg(fptr.errorString())); fptr.write(&hdr,sizeof(DNDFileHeader)); fptr.close(); @@ -172,7 +172,7 @@ namespace bt create(); if (!fptr.open(path,"r+b")) { - throw Error(i18n("Failed to write first chunk to DND file : %1").arg(fptr.errorString())); + throw Error(i18n("Failed to write first chunk to DND file : %1").tqarg(fptr.errorString())); } } @@ -230,7 +230,7 @@ namespace bt create(); if (!fptr.open(path,"r+b")) { - throw Error(i18n("Failed to write last chunk to DND file : %1").arg(fptr.errorString())); + throw Error(i18n("Failed to write last chunk to DND file : %1").tqarg(fptr.errorString())); } } diff --git a/libktorrent/torrent/dndfile.h b/libktorrent/torrent/dndfile.h index a7a7e7b..09873d1 100644 --- a/libktorrent/torrent/dndfile.h +++ b/libktorrent/torrent/dndfile.h @@ -20,7 +20,7 @@ #ifndef BTDNDFILE_H #define BTDNDFILE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace bt @@ -36,11 +36,11 @@ namespace bt class DNDFile { public: - DNDFile(const QString & path); + DNDFile(const TQString & path); virtual ~DNDFile(); /// Change the path of the file - void changePath(const QString & npath); + void changePath(const TQString & npath); /** * CHeck integrity of the file, create it if it doesn't exist. @@ -81,7 +81,7 @@ namespace bt void create(); private: - QString path; + TQString path; }; } diff --git a/libktorrent/torrent/downloadcap.h b/libktorrent/torrent/downloadcap.h index 2bda73c..e05be21 100644 --- a/libktorrent/torrent/downloadcap.h +++ b/libktorrent/torrent/downloadcap.h @@ -21,7 +21,7 @@ #define BTDOWNLOADCAP_H #if 0 -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/timer.h> #include "globals.h" #include "cap.h" diff --git a/libktorrent/torrent/downloader.cpp b/libktorrent/torrent/downloader.cpp index b8acdc7..b566ad7 100644 --- a/libktorrent/torrent/downloader.cpp +++ b/libktorrent/torrent/downloader.cpp @@ -52,8 +52,8 @@ namespace bt unnecessary_data = 0; current_chunks.setAutoDelete(true); - connect(&pman,SIGNAL(newPeer(Peer* )),this,SLOT(onNewPeer(Peer* ))); - connect(&pman,SIGNAL(peerKilled(Peer* )),this,SLOT(onPeerKilled(Peer*))); + connect(&pman,TQT_SIGNAL(newPeer(Peer* )),this,TQT_SLOT(onNewPeer(Peer* ))); + connect(&pman,TQT_SIGNAL(peerKilled(Peer* )),this,TQT_SLOT(onPeerKilled(Peer*))); } @@ -87,7 +87,7 @@ namespace bt } // if the chunk is not in memory, reload it - if (cd->getChunk()->getStatus() == Chunk::ON_DISK) + if (cd->getChunk()->gettqStatus() == Chunk::ON_DISK) { cman.prepareChunk(cd->getChunk(),true); } @@ -119,7 +119,7 @@ namespace bt downloaded += p.getLength(); // save to disk again, if it is idle - if (cd->isIdle() && cd->getChunk()->getStatus() == Chunk::MMAPPED) + if (cd->isIdle() && cd->getChunk()->gettqStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -160,7 +160,7 @@ namespace bt if (cd->isIdle()) // idle chunks do not need to be in memory { Chunk* c = cd->getChunk(); - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -169,7 +169,7 @@ namespace bt { cd->releaseAllPDs(); Chunk* c = cd->getChunk(); - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) { cman.saveChunk(cd->getChunk()->getIndex(),false); } @@ -277,7 +277,7 @@ namespace bt if (sel) { // if it is on disk, reload it - if (sel->getChunk()->getStatus() == Chunk::ON_DISK) + if (sel->getChunk()->gettqStatus() == Chunk::ON_DISK) cman.prepareChunk(sel->getChunk(),true); sel->assignPeer(pd); @@ -341,7 +341,7 @@ namespace bt if (cdmin) { // if it is on disk, reload it - if (cdmin->getChunk()->getStatus() == Chunk::ON_DISK) + if (cdmin->getChunk()->gettqStatus() == Chunk::ON_DISK) { cman.prepareChunk(cdmin->getChunk(),true); } @@ -354,14 +354,14 @@ namespace bt bool Downloader::areWeDownloading(Uint32 chunk) const { - return current_chunks.find(chunk) != 0; + return current_chunks.tqfind(chunk) != 0; } void Downloader::onNewPeer(Peer* peer) { PeerDownloader* pd = peer->getPeerDownloader(); - connect(pd,SIGNAL(downloaded(const Piece& )), - this,SLOT(pieceRecieved(const Piece& ))); + connect(pd,TQT_SIGNAL(downloaded(const Piece& )), + this,TQT_SLOT(pieceRecieved(const Piece& ))); } void Downloader::onPeerKilled(Peer* peer) @@ -421,7 +421,7 @@ namespace bt Peer* p = pman.findPeer(pid); if (!p) return false; - QString IP(p->getIPAddresss()); + TQString IP(p->getIPAddresss()); Out(SYS_GEN|LOG_NOTICE) << "Peer " << IP << " sent bad data" << endl; IPBlocklist & ipfilter = IPBlocklist::instance(); ipfilter.insert( IP ); @@ -438,10 +438,10 @@ namespace bt { Uint32 ch = i->first; Chunk* c = i->second->getChunk(); - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) cman.saveChunk(ch,false); - c->setStatus(Chunk::NOT_DOWNLOADED); + c->settqStatus(Chunk::NOT_DOWNLOADED); } current_chunks.clear(); } @@ -473,7 +473,7 @@ namespace bt - void Downloader::saveDownloads(const QString & file) + void Downloader::saveDownloads(const TQString & file) { File fptr; if (!fptr.open(file,"wb")) @@ -496,7 +496,7 @@ namespace bt } } - void Downloader::loadDownloads(const QString & file) + void Downloader::loadDownloads(const TQString & file) { // don't load stuff if download is finished if (cman.completed()) @@ -531,7 +531,7 @@ namespace bt return; } - if (!cman.getChunk(hdr.index) || current_chunks.contains(hdr.index)) + if (!cman.getChunk(hdr.index) || current_chunks.tqcontains(hdr.index)) { Out() << "Illegal chunk " << hdr.index << endl; return; @@ -569,7 +569,7 @@ namespace bt curr_chunks_downloaded = 0; } - Uint32 Downloader::getDownloadedBytesOfCurrentChunksFile(const QString & file) + Uint32 Downloader::getDownloadedBytesOfCurrentChunksFile(const TQString & file) { // Load all partial downloads File fptr; @@ -628,7 +628,7 @@ namespace bt { for (Uint32 i = from;i <= to;i++) { - ChunkDownload* cd = current_chunks.find(i); + ChunkDownload* cd = current_chunks.tqfind(i); // let only seed chunks finish if (!cd || cman.getChunk(i)->getPriority() == ONLY_SEED_PRIORITY) continue; @@ -664,7 +664,7 @@ namespace bt { for (Uint32 i = 0;i < ok_chunks.getNumBits();i++) { - ChunkDownload* cd = current_chunks.find(i); + ChunkDownload* cd = current_chunks.tqfind(i); if (ok_chunks.get(i) && cd) { // we have a chunk and we are downloading it so kill it diff --git a/libktorrent/torrent/downloader.h b/libktorrent/torrent/downloader.h index 5b39eeb..fece8a6 100644 --- a/libktorrent/torrent/downloader.h +++ b/libktorrent/torrent/downloader.h @@ -20,7 +20,7 @@ #ifndef BTDOWNLOADER_H #define BTDOWNLOADER_H -#include <qobject.h> +#include <tqobject.h> #include <util/ptrmap.h> #include "globals.h" @@ -64,9 +64,10 @@ namespace bt * This class manages the downloading of the file. It should * regurarly be updated. */ - class Downloader : public QObject + class Downloader : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -109,20 +110,20 @@ namespace bt * Save the current downloads. * @param file The file to save to */ - void saveDownloads(const QString & file); + void saveDownloads(const TQString & file); /** * Load the current downloads. * @param file The file to load from */ - void loadDownloads(const QString & file); + void loadDownloads(const TQString & file); /** * Get the number of bytes already downloaded in the current_chunks file. * @param file The path of the current_chunks file * @return The bytes already downloading */ - Uint32 getDownloadedBytesOfCurrentChunksFile(const QString & file); + Uint32 getDownloadedBytesOfCurrentChunksFile(const TQString & file); /** * A corrupted chunk has been detected, make sure we redownload it. @@ -189,7 +190,7 @@ namespace bt * An error occurred while we we're writing or reading from disk. * @param msg Message */ - void ioError(const QString & msg); + void ioError(const TQString & msg); private: void downloadFrom(PeerDownloader* pd); diff --git a/libktorrent/torrent/globals.cpp b/libktorrent/torrent/globals.cpp index 0221c17..51dd7a1 100644 --- a/libktorrent/torrent/globals.cpp +++ b/libktorrent/torrent/globals.cpp @@ -61,7 +61,7 @@ namespace bt inst = 0; } - void Globals::initLog(const QString & file) + void Globals::initLog(const TQString & file) { log->setOutputFile(file); log->setOutputToConsole(debug_mode); diff --git a/libktorrent/torrent/globals.h b/libktorrent/torrent/globals.h index 7cfe3f5..16de41e 100644 --- a/libktorrent/torrent/globals.h +++ b/libktorrent/torrent/globals.h @@ -22,7 +22,7 @@ #include <util/constants.h> -class QString; +class TQString; namespace net { @@ -46,7 +46,7 @@ namespace bt public: virtual ~Globals(); - void initLog(const QString & file); + void initLog(const TQString & file); void initServer(Uint16 port); void setDebugMode(bool on) {debug_mode = on;} bool isDebugModeSet() const {return debug_mode;} diff --git a/libktorrent/torrent/httptracker.cpp b/libktorrent/torrent/httptracker.cpp index b220bc0..ad4bd79 100644 --- a/libktorrent/torrent/httptracker.cpp +++ b/libktorrent/torrent/httptracker.cpp @@ -21,7 +21,7 @@ #include <kurl.h> #include <klocale.h> -#include <qhostaddress.h> +#include <tqhostaddress.h> #include <util/log.h> #include <util/functions.h> #include <util/error.h> @@ -80,7 +80,7 @@ namespace bt { event = "completed"; doRequest(); - event = QString::null; + event = TQString(); } void HTTPTracker::manualUpdate() @@ -105,9 +105,9 @@ namespace bt } KURL scrape_url = url; - scrape_url.setFileName(url.fileName(false).replace("announce","scrape")); + scrape_url.setFileName(url.fileName(false).tqreplace("announce","scrape")); - QString epq = scrape_url.encodedPathAndQuery(); + TQString epq = scrape_url.encodedPathAndQuery(); const SHA1Hash & info_hash = tor->getInfoHash(); if (scrape_url.queryItems().count() > 0) epq += "&info_hash=" + info_hash.toURLString(); @@ -124,7 +124,7 @@ namespace bt j->setMetaData(md); KIO::Scheduler::scheduleJob(j); - connect(j,SIGNAL(result(KIO::Job* )),this,SLOT(onScrapeResult( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onScrapeResult( KIO::Job* ))); } void HTTPTracker::onScrapeResult(KIO::Job* j) @@ -152,7 +152,7 @@ namespace bt if (n && n->getType() == BNode::DICT) { BDictNode* d = (BDictNode*)n; - d = d->getDict("files"); + d = d->getDict(TQString("files")); if (d) { d = d->getDict(tor->getInfoHash().toByteArray()); @@ -188,21 +188,21 @@ namespace bt if (!url.isValid()) { requestPending(); - QTimer::singleShot(500,this,SLOT(emitInvalidURLFailure())); + TQTimer::singleShot(500,this,TQT_SLOT(emitInvalidURLFailure())); return; } Uint16 port = Globals::instance().getServer().getPortInUse();; u.addQueryItem("peer_id",peer_id.toString()); - u.addQueryItem("port",QString::number(port)); - u.addQueryItem("uploaded",QString::number(s.trk_bytes_uploaded)); - u.addQueryItem("downloaded",QString::number(s.trk_bytes_downloaded)); + u.addQueryItem("port",TQString::number(port)); + u.addQueryItem("uploaded",TQString::number(s.trk_bytes_uploaded)); + u.addQueryItem("downloaded",TQString::number(s.trk_bytes_downloaded)); if (event == "completed") u.addQueryItem("left","0"); // need to send 0 when we are completed else - u.addQueryItem("left",QString::number(s.bytes_left)); + u.addQueryItem("left",TQString::number(s.bytes_left)); u.addQueryItem("compact","1"); if (event != "stopped") @@ -210,14 +210,14 @@ namespace bt else u.addQueryItem("numwant","0"); - u.addQueryItem("key",QString::number(key)); - QString cip = Tracker::getCustomIP(); + u.addQueryItem("key",TQString::number(key)); + TQString cip = Tracker::getCustomIP(); if (!cip.isNull()) u.addQueryItem("ip",cip); - if (event != QString::null) + if (event != TQString()) u.addQueryItem("event",event); - QString epq = u.encodedPathAndQuery(); + TQString epq = u.encodedPathAndQuery(); const SHA1Hash & info_hash = tor->getInfoHash(); epq += "&info_hash=" + info_hash.toURLString(); @@ -238,12 +238,12 @@ namespace bt } } - bool HTTPTracker::updateData(const QByteArray & data) + bool HTTPTracker::updateData(const TQByteArray & data) { //#define DEBUG_PRINT_RESPONSE #ifdef DEBUG_PRINT_RESPONSE Out() << "Data : " << endl; - Out() << QString(data) << endl; + Out() << TQString(data) << endl; #endif // search for dictionary, there might be random garbage infront of the data Uint32 i = 0; @@ -285,7 +285,7 @@ namespace bt if (dict->getData("failure reason")) { BValueNode* vn = dict->getValue("failure reason"); - QString msg = vn->data().toString(); + TQString msg = vn->data().toString(); delete n; failures++; requestFailed(msg); @@ -321,14 +321,14 @@ namespace bt return false; } - QByteArray arr = vn->data().toByteArray(); + TQByteArray arr = vn->data().toByteArray(); for (Uint32 i = 0;i < arr.size();i+=6) { Uint8 buf[6]; for (int j = 0;j < 6;j++) buf[j] = arr[i + j]; - addPeer(QHostAddress(ReadUint32(buf,0)).toString(),ReadUint16(buf,4)); + addPeer(TQHostAddress(ReadUint32(buf,0)).toString(),ReadUint16(buf,4)); } } else @@ -398,7 +398,7 @@ namespace bt failures++; requestFailed(i18n("Invalid response from tracker")); } - event = QString::null; + event = TQString(); } else { @@ -429,7 +429,7 @@ namespace bt if (url.isValid()) md["UseProxy"] = url.pathOrURL(); else - md["UseProxy"] = QString::null; + md["UseProxy"] = TQString(); } } @@ -453,7 +453,7 @@ namespace bt j->setMetaData(md); KIO::Scheduler::scheduleJob(j); - connect(j,SIGNAL(result(KIO::Job* )),this,SLOT(onAnnounceResult( KIO::Job* ))); + connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onAnnounceResult( KIO::Job* ))); active_job = j; requestPending(); diff --git a/libktorrent/torrent/httptracker.h b/libktorrent/torrent/httptracker.h index 8ac7e69..effb4b7 100644 --- a/libktorrent/torrent/httptracker.h +++ b/libktorrent/torrent/httptracker.h @@ -20,7 +20,7 @@ #ifndef BTHTTPTRACKER_H #define BTHTTPTRACKER_H -#include <qtimer.h> +#include <tqtimer.h> #include "tracker.h" namespace KIO @@ -42,6 +42,7 @@ namespace bt class HTTPTracker : public Tracker { Q_OBJECT + TQ_OBJECT public: HTTPTracker(const KURL & url,kt::TorrentInterface* tor,const PeerID & id,int tier); virtual ~HTTPTracker(); @@ -60,7 +61,7 @@ namespace bt private: void doRequest(WaitJob* wjob = 0); - bool updateData(const QByteArray & data); + bool updateData(const TQByteArray & data); void setupMetaData(KIO::MetaData & md); void doAnnounceQueue(); void doAnnounce(const KURL & u); @@ -68,7 +69,7 @@ namespace bt private: KIO::Job* active_job; KURL::List announce_queue; - QString event; + TQString event; Uint32 failures; }; diff --git a/libktorrent/torrent/ipblocklist.cpp b/libktorrent/torrent/ipblocklist.cpp index de30968..04afe26 100644 --- a/libktorrent/torrent/ipblocklist.cpp +++ b/libktorrent/torrent/ipblocklist.cpp @@ -20,9 +20,9 @@ ***************************************************************************/ #include "ipblocklist.h" -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <util/constants.h> #include <util/log.h> #include "globals.h" @@ -31,7 +31,7 @@ namespace bt { - Uint32 toUint32(const QString& ip, bool* ok) + Uint32 toUint32(const TQString& ip, bool* ok) { bool test; *ok = true; @@ -69,29 +69,29 @@ namespace bt IPBlocklist::IPBlocklist(const IPBlocklist & ) {} - void IPBlocklist::insert( QString ip, int state ) + void IPBlocklist::insert( TQString ip, int state ) { bool ok; Uint32 ipi = toUint32(ip, &ok); if(!ok) return; - IPKey key(ipi,0xFFFFFFFF); //-- you can test ranges here. Just specify your mask. + IPKey key(ipi,0xFFFFFFFF); //-- you can test ranges here. Just specify your tqmask. insertRangeIP(key, state); Out(SYS_IPF|LOG_NOTICE) << "IP " << ip << " banned." << endl; } - void IPBlocklist::addRange(QString ip) + void IPBlocklist::addRange(TQString ip) { bool ok; int tmp = 0; Uint32 addr = 0; - Uint32 mask = 0xFFFFFFFF; + Uint32 tqmask = 0xFFFFFFFF; tmp = ip.section('.',0,0).toInt(&ok); if(!ok) { if(ip.section('.',0,0) == "*") - mask &= 0x00FFFFFF; + tqmask &= 0x00FFFFFF; else return; //illegal character } else @@ -102,7 +102,7 @@ namespace bt { addr <<= 8; if(ip.section('.',1,1) == "*") - mask &= 0xFF00FFFF; + tqmask &= 0xFF00FFFF; else return; //illegal character } else @@ -116,7 +116,7 @@ namespace bt { addr <<= 8; if(ip.section('.',2,2) == "*") - mask &= 0xFFFF00FF; + tqmask &= 0xFFFF00FF; else return; //illegal character } else @@ -130,7 +130,7 @@ namespace bt { addr <<= 8; if(ip.section('.',3,3) == "*") - mask &=0xFFFFFF00; + tqmask &=0xFFFFFF00; else return; //illegal character } else @@ -139,21 +139,21 @@ namespace bt addr |= tmp; } - IPKey key(addr, mask); + IPKey key(addr, tqmask); this->insertRangeIP(key); } void IPBlocklist::insertRangeIP(IPKey& key, int state) { -// Out() << "Blocked range: " << key.m_ip << " - " << key.m_mask << endl; - QMap<IPKey, int>::iterator it; - if ((it = m_peers.find(key)) != m_peers.end()) +// Out() << "Blocked range: " << key.m_ip << " - " << key.m_tqmask << endl; + TQMap<IPKey, int>::iterator it; + if ((it = m_peers.tqfind(key)) != m_peers.end()) { - if(it.key().m_mask != key.m_mask) + if(it.key().m_tqmask != key.m_tqmask) { int st = it.data(); - IPKey key1(key.m_ip, it.key().m_mask | key.m_mask); + IPKey key1(key.m_ip, it.key().m_tqmask | key.m_tqmask); m_peers.insert(key1, state+st); return; } @@ -163,18 +163,18 @@ namespace bt m_peers.insert(key,state); } - void IPBlocklist::removeRange(QString ip) + void IPBlocklist::removeRange(TQString ip) { bool ok; int tmp = 0; Uint32 addr = 0; - Uint32 mask = 0xFFFFFFFF; + Uint32 tqmask = 0xFFFFFFFF; tmp = ip.section('.',0,0).toInt(&ok); if(!ok) { if(ip.section('.',0,0) == "*") - mask &= 0x00FFFFFF; + tqmask &= 0x00FFFFFF; else return; //illegal character } else @@ -185,7 +185,7 @@ namespace bt { addr <<= 8; if(ip.section('.',1,1) == "*") - mask &= 0xFF00FFFF; + tqmask &= 0xFF00FFFF; else return; //illegal character } else @@ -199,7 +199,7 @@ namespace bt { addr <<= 8; if(ip.section('.',2,2) == "*") - mask &= 0xFFFF00FF; + tqmask &= 0xFFFF00FF; else return; //illegal character } else @@ -213,7 +213,7 @@ namespace bt { addr <<= 8; if(ip.section('.',3,3) == "*") - mask &=0xFFFFFF00; + tqmask &=0xFFFFFF00; else return; //illegal character } else @@ -222,9 +222,9 @@ namespace bt addr |= tmp; } - IPKey key(addr, mask); + IPKey key(addr, tqmask); - QMap<IPKey, int>::iterator it = m_peers.find(key); + TQMap<IPKey, int>::iterator it = m_peers.tqfind(key); if (it == m_peers.end()) return; @@ -236,7 +236,7 @@ namespace bt this->pluginInterface = ptr; } - bool IPBlocklist::isBlocked(const QString& ip ) + bool IPBlocklist::isBlocked(const TQString& ip ) { //First check local filter list if(isBlockedLocal(ip)) @@ -255,7 +255,7 @@ namespace bt return false; } - bool IPBlocklist::isBlockedLocal(const QString& ip ) + bool IPBlocklist::isBlockedLocal(const TQString& ip ) { bool ok; Uint32 ipi = toUint32(ip,&ok); @@ -263,15 +263,15 @@ namespace bt return false; IPKey key(ipi); - QMap<IPKey, int>::iterator it; - it = m_peers.find(key); + TQMap<IPKey, int>::iterator it; + it = m_peers.tqfind(key); if (it==m_peers.end()) return false; return m_peers[key] >= 3; } - bool IPBlocklist::isBlockedPlugin(const QString& ip ) + bool IPBlocklist::isBlockedPlugin(const TQString& ip ) { if (pluginInterface == 0) //the plugin is not loaded return false; @@ -279,10 +279,10 @@ namespace bt return pluginInterface->isBlockedIP(ip); } - QStringList* IPBlocklist::getBlocklist() + TQStringList* IPBlocklist::getBlocklist() { - QStringList* ret = new QStringList(); - QMap<IPKey,int>::iterator it = m_peers.begin(); + TQStringList* ret = new TQStringList(); + TQMap<IPKey,int>::iterator it = m_peers.begin(); for( ;it!=m_peers.end();++it) { IPKey key = it.key(); @@ -292,10 +292,10 @@ namespace bt return ret; } - void IPBlocklist::setBlocklist(QStringList* list) + void IPBlocklist::setBlocklist(TQStringList* list) { m_peers.clear(); - for (QStringList::Iterator it = list->begin(); it != list->end(); ++it ) + for (TQStringList::Iterator it = list->begin(); it != list->end(); ++it ) addRange(*it); } @@ -304,11 +304,11 @@ namespace bt IPKey::IPKey() { m_ip = 0; - m_mask = 0xFFFFFFFF; + m_tqmask = 0xFFFFFFFF; } - IPKey::IPKey(QString& ip, Uint32 mask) - : m_mask(mask) + IPKey::IPKey(TQString& ip, Uint32 tqmask) + : m_tqmask(tqmask) { bool ok; this->m_ip = toUint32(ip, &ok); @@ -317,81 +317,81 @@ namespace bt IPKey::IPKey(const IPKey& ip) { m_ip = ip.m_ip; - m_mask = ip.m_mask; + m_tqmask = ip.m_tqmask; } - IPKey::IPKey(Uint32 ip, Uint32 mask) - : m_ip(ip), m_mask(mask) + IPKey::IPKey(Uint32 ip, Uint32 tqmask) + : m_ip(ip), m_tqmask(tqmask) {} - QString IPKey::toString() + TQString IPKey::toString() { - Uint32 tmp, tmpmask; + Uint32 tmp, tmptqmask; Uint32 ip = m_ip; - Uint32 mask = m_mask; - QString out; + Uint32 tqmask = m_tqmask; + TQString out; tmp = ip; - tmpmask = mask; + tmptqmask = tqmask; tmp &= 0x000000FF; - tmpmask &= 0x000000FF; - if(tmpmask == 0) + tmptqmask &= 0x000000FF; + if(tmptqmask == 0) out.prepend("*"); else - out.prepend(QString("%1").arg(tmp)); + out.prepend(TQString("%1").tqarg(tmp)); ip >>= 8; - mask >>= 8; + tqmask >>= 8; tmp = ip; - tmpmask = mask; + tmptqmask = tqmask; tmp &= 0x000000FF; - tmpmask &= 0x000000FF; - if(tmpmask == 0) + tmptqmask &= 0x000000FF; + if(tmptqmask == 0) out.prepend("*."); else - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); ip >>= 8; - mask >>= 8; + tqmask >>= 8; tmp = ip; - tmpmask = mask; + tmptqmask = tqmask; tmp &= 0x000000FF; - tmpmask &= 0x000000FF; - if(tmpmask == 0) + tmptqmask &= 0x000000FF; + if(tmptqmask == 0) out.prepend("*."); else - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); ip >>= 8; - mask >>= 8; + tqmask >>= 8; tmp = ip; - tmpmask = mask; + tmptqmask = tqmask; tmp &= 0x000000FF; - tmpmask &= 0x000000FF; - if(tmpmask == 0) + tmptqmask &= 0x000000FF; + if(tmptqmask == 0) out.prepend("*."); else - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); return out; } bool IPKey::operator ==(const IPKey& ip) const { - return (m_ip & m_mask) == m_mask & ip.m_ip; + return (m_ip & m_tqmask) == m_tqmask & ip.m_ip; } bool IPKey::operator !=(const IPKey& ip) const { - return (m_ip & m_mask) != m_mask & ip.m_ip; + return (m_ip & m_tqmask) != m_tqmask & ip.m_ip; } bool IPKey::operator < (const IPKey& ip) const { - return (m_ip & m_mask) < (m_mask & ip.m_ip); + return (m_ip & m_tqmask) < (m_tqmask & ip.m_ip); } IPKey& IPKey::operator =(const IPKey& ip) { m_ip = ip.m_ip; - m_mask = ip.m_mask; + m_tqmask = ip.m_tqmask; return *this; } diff --git a/libktorrent/torrent/ipblocklist.h b/libktorrent/torrent/ipblocklist.h index b30a856..51e5aa5 100644 --- a/libktorrent/torrent/ipblocklist.h +++ b/libktorrent/torrent/ipblocklist.h @@ -23,11 +23,11 @@ #include <interfaces/ipblockinginterface.h> -#include <qmap.h> -#include <qstringlist.h> +#include <tqmap.h> +#include <tqstringlist.h> #include <util/constants.h> -class QString; +class TQString; namespace bt { @@ -35,8 +35,8 @@ namespace bt { public: IPKey(); - IPKey(QString& ip, Uint32 mask = 0xFFFFFFFF); - IPKey(Uint32 ip, Uint32 mask = 0xFFFFFFFF); + IPKey(TQString& ip, Uint32 tqmask = 0xFFFFFFFF); + IPKey(Uint32 ip, Uint32 tqmask = 0xFFFFFFFF); IPKey(const IPKey& ip); ~IPKey(); @@ -45,10 +45,10 @@ namespace bt bool operator < (const IPKey & ip) const; IPKey& operator= (const IPKey& ip); - QString toString(); + TQString toString(); Uint32 m_ip; - Uint32 m_mask; + Uint32 m_tqmask; }; /** @@ -77,33 +77,33 @@ namespace bt /** * @brief Adds ip address to the list. * It also increases the number of times this IP appeared in the list. - * @param ip QString containing the peer IP address + * @param ip TQString containing the peer IP address * @param state int number of bad chunks client from ip sent. Basically this parameter * is used only to permanently block some IP (by setting this param to 3) */ - void insert(QString ip, int state=1); + void insert(TQString ip, int state=1); /** * @brief Adds IP range to the list * It is used for blocking plugin. For single IP use insert() instead. - * @param ip QString peer IP address. Uses ''*" for ranges. + * @param ip TQString peer IP address. Uses ''*" for ranges. **/ - void addRange(QString ip); + void addRange(TQString ip); /** * @brief Removes IP range from list * It is used for blocking plugin. - * @param ip QString peer IP address. Uses ''*" for ranges. + * @param ip TQString peer IP address. Uses ''*" for ranges. **/ - void removeRange(QString ip); + void removeRange(TQString ip); /** * Checks if IP is in the blocking list * @param ip - IP address to check * @returns true if IP is blocked */ - bool isBlocked(const QString& ip); + bool isBlocked(const TQString& ip); /** * @brief Sets the pointer to the IPBlockingInterface (IPBlocking plugin) @@ -120,19 +120,19 @@ namespace bt /** - * @brief This function will fill QStringList with all banned peer IP addresses. - * @return QStringList filled with blacklisted peers. - * It will create a new QStringList object so don't forget to delete it after using. + * @brief This function will fill TQStringList with all banned peer IP addresses. + * @return TQStringList filled with blacklisted peers. + * It will create a new TQStringList object so don't forget to delete it after using. */ - QStringList* getBlocklist(); + TQStringList* getBlocklist(); /** * @brief This function will load blacklisted peers to IPFilter. - * @param list QStringList containing all banned peers. + * @param list TQStringList containing all banned peers. * @note This function will remove current peers from blocklist before setting new list!!! */ - void setBlocklist(QStringList* list); + void setBlocklist(TQStringList* list); private: @@ -143,10 +143,10 @@ namespace bt kt::IPBlockingInterface* pluginInterface; /** - * @param IPKey - Key: Peer IP address and bit mask if it is a range + * @param IPKey - Key: Peer IP address and bit tqmask if it is a range * @param int - Number of bad chunks sent. **/ - QMap<IPKey, int> m_peers; + TQMap<IPKey, int> m_peers; /** * @brief Adds IP range to the list. @@ -161,13 +161,13 @@ namespace bt * Checks if IP is listed in local database (IPBlocklist::m_peers) * @return TRUE if IP is to be blocked */ - bool isBlockedLocal(const QString& ip); + bool isBlockedLocal(const TQString& ip); /** * Checks if IP is listed in plugins antip2p file * @return TRUE if IP is to be blocked */ - bool isBlockedPlugin(const QString& ip); + bool isBlockedPlugin(const TQString& ip); }; } diff --git a/libktorrent/torrent/movedatafilesjob.cpp b/libktorrent/torrent/movedatafilesjob.cpp index c0c24e7..c3fc854 100644 --- a/libktorrent/torrent/movedatafilesjob.cpp +++ b/libktorrent/torrent/movedatafilesjob.cpp @@ -30,7 +30,7 @@ namespace bt MoveDataFilesJob::~MoveDataFilesJob() {} - void MoveDataFilesJob::addMove(const QString & src,const QString & dst) + void MoveDataFilesJob::addMove(const TQString & src,const TQString & dst) { todo.insert(src,dst); } @@ -53,7 +53,7 @@ namespace bt else { success.insert(active_src,active_dst); - active_src = active_dst = QString::null; + active_src = active_dst = TQString(); active_job = 0; startMoving(); } @@ -76,13 +76,13 @@ namespace bt return; } - QMap<QString,QString>::iterator i = todo.begin(); + TQMap<TQString,TQString>::iterator i = todo.begin(); active_job = KIO::move(KURL::fromPathOrURL(i.key()),KURL::fromPathOrURL(i.data()),false); active_src = i.key(); active_dst = i.data(); Out(SYS_GEN|LOG_DEBUG) << "Moving " << active_src << " -> " << active_dst << endl; - connect(active_job,SIGNAL(result(KIO::Job*)),this,SLOT(onJobDone(KIO::Job*))); - connect(active_job,SIGNAL(canceled(KIO::Job*)),this,SLOT(onCanceled(KIO::Job*))); + connect(active_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onJobDone(KIO::Job*))); + connect(active_job,TQT_SIGNAL(canceled(KIO::Job*)),this,TQT_SLOT(onCanceled(KIO::Job*))); todo.erase(i); } @@ -93,10 +93,10 @@ namespace bt emitResult(); return; } - QMap<QString,QString>::iterator i = success.begin(); + TQMap<TQString,TQString>::iterator i = success.begin(); active_job = KIO::move(KURL::fromPathOrURL(i.data()),KURL::fromPathOrURL(i.key()),false); - connect(active_job,SIGNAL(result(KIO::Job*)),this,SLOT(onJobDone(KIO::Job*))); - connect(active_job,SIGNAL(canceled(KIO::Job*)),this,SLOT(onCanceled(KIO::Job*))); + connect(active_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(onJobDone(KIO::Job*))); + connect(active_job,TQT_SIGNAL(canceled(KIO::Job*)),this,TQT_SLOT(onCanceled(KIO::Job*))); success.erase(i); } } diff --git a/libktorrent/torrent/movedatafilesjob.h b/libktorrent/torrent/movedatafilesjob.h index b0002d9..272ac14 100644 --- a/libktorrent/torrent/movedatafilesjob.h +++ b/libktorrent/torrent/movedatafilesjob.h @@ -32,6 +32,7 @@ namespace bt class MoveDataFilesJob : public KIO::Job { Q_OBJECT + TQ_OBJECT public: MoveDataFilesJob(); virtual ~MoveDataFilesJob(); @@ -41,7 +42,7 @@ namespace bt * @param src File to move * @param dst Where to move it to */ - void addMove(const QString & src,const QString & dst); + void addMove(const TQString & src,const TQString & dst); /** * Start moving the files. @@ -58,9 +59,9 @@ namespace bt private: bool err; KIO::Job* active_job; - QString active_src,active_dst; - QMap<QString,QString> todo; - QMap<QString,QString> success; + TQString active_src,active_dst; + TQMap<TQString,TQString> todo; + TQMap<TQString,TQString> success; }; } diff --git a/libktorrent/torrent/multifilecache.cpp b/libktorrent/torrent/multifilecache.cpp index c6af92c..88f6d69 100644 --- a/libktorrent/torrent/multifilecache.cpp +++ b/libktorrent/torrent/multifilecache.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <errno.h> -#include <qdir.h> -#include <qstringlist.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqstringlist.h> +#include <tqfileinfo.h> #include <klocale.h> #include <kio/netaccess.h> #include <util/file.h> @@ -44,10 +44,10 @@ namespace bt { static Uint64 FileOffset(Chunk* c,const TorrentFile & f,Uint64 chunk_size); static Uint64 FileOffset(Uint32 cindex,const TorrentFile & f,Uint64 chunk_size); - static void DeleteEmptyDirs(const QString & output_dir,const QString & fpath); + static void DeleteEmptyDirs(const TQString & output_dir,const TQString & fpath); - MultiFileCache::MultiFileCache(Torrent& tor,const QString & tmpdir,const QString & datadir,bool custom_output_name) : Cache(tor, tmpdir,datadir) + MultiFileCache::MultiFileCache(Torrent& tor,const TQString & tmpdir,const TQString & datadir,bool custom_output_name) : Cache(tor, tmpdir,datadir) { cache_dir = tmpdir + "cache" + bt::DirSeparator(); if (datadir.length() == 0) @@ -63,7 +63,7 @@ namespace bt MultiFileCache::~MultiFileCache() {} - QString MultiFileCache::guessDataDir() + TQString MultiFileCache::guessDataDir() { for (Uint32 i = 0;i < tor.getNumFiles();i++) { @@ -71,13 +71,13 @@ namespace bt if (tf.doNotDownload()) continue; - QString p = cache_dir + tf.getPath(); - QFileInfo fi(p); + TQString p = cache_dir + tf.getPath(); + TQFileInfo fi(p); if (!fi.isSymLink()) continue; - QString dst = fi.readLink(); - QString tmp = tor.getNameSuggestion() + bt::DirSeparator() + tf.getPath(); + TQString dst = fi.readLink(); + TQString tmp = tor.getNameSuggestion() + bt::DirSeparator() + tf.getPath(); dst = dst.left(dst.length() - tmp.length()); if (dst.length() == 0) continue; @@ -88,10 +88,10 @@ namespace bt return dst; } - return QString::null; + return TQString(); } - QString MultiFileCache::getOutputPath() const + TQString MultiFileCache::getOutputPath() const { return output_dir; } @@ -103,7 +103,7 @@ namespace bt void MultiFileCache::open() { - QString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); + TQString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); // open all files for (Uint32 i = 0;i < tor.getNumFiles();i++) { @@ -114,7 +114,7 @@ namespace bt { if (!tf.doNotDownload()) { - if (files.contains(i)) + if (files.tqcontains(i)) files.erase(i); fd = new CacheFile(); @@ -123,7 +123,7 @@ namespace bt } else { - if (dnd_files.contains(i)) + if (dnd_files.tqcontains(i)) dnd_files.erase(i); dfd = new DNDFile(dnd_dir + tf.getPath() + ".dnd"); @@ -142,11 +142,11 @@ namespace bt } } - void MultiFileCache::changeTmpDir(const QString& ndir) + void MultiFileCache::changeTmpDir(const TQString& ndir) { Cache::changeTmpDir(ndir); cache_dir = tmpdir + "cache/"; - QString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); + TQString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); // change paths for individual files, it should not // be a problem to move these files when they are open @@ -155,20 +155,20 @@ namespace bt TorrentFile & tf = tor.getFile(i); if (tf.doNotDownload()) { - DNDFile* dfd = dnd_files.find(i); + DNDFile* dfd = dnd_files.tqfind(i); if (dfd) dfd->changePath(dnd_dir + tf.getPath() + ".dnd"); } else { - CacheFile* fd = files.find(i); + CacheFile* fd = files.tqfind(i); if (fd) fd->changePath(cache_dir + tf.getPath()); } } } - void MultiFileCache::changeOutputPath(const QString & outputpath) + void MultiFileCache::changeOutputPath(const TQString & outputpath) { output_dir = outputpath; if (!output_dir.endsWith(bt::DirSeparator())) @@ -184,7 +184,7 @@ namespace bt TorrentFile & tf = tor.getFile(i); if (!tf.doNotDownload()) { - QString fpath = tf.getPath(); + TQString fpath = tf.getPath(); if (bt::Exists(output_dir + fpath)) { bt::Delete(cache_dir + fpath,true); // delete any existing symlinks @@ -195,12 +195,12 @@ namespace bt } } - KIO::Job* MultiFileCache::moveDataFiles(const QString & ndir) + KIO::Job* MultiFileCache::moveDataFiles(const TQString & ndir) { if (!bt::Exists(ndir)) bt::MakeDir(ndir); - QString nd = ndir; + TQString nd = ndir; if (!nd.endsWith(bt::DirSeparator())) nd += bt::DirSeparator(); @@ -215,8 +215,8 @@ namespace bt // check if every directory along the path exists, and if it doesn't // create it - QStringList sl = QStringList::split(bt::DirSeparator(),nd + tf.getPath()); - QString odir = bt::DirSeparator(); + TQStringList sl = TQStringList::split(bt::DirSeparator(),nd + tf.getPath()); + TQString odir = bt::DirSeparator(); for (Uint32 i = 0;i < sl.count() - 1;i++) { odir += sl[i] + bt::DirSeparator(); @@ -271,14 +271,14 @@ namespace bt void MultiFileCache::touch(TorrentFile & tf) { - QString fpath = tf.getPath(); + TQString fpath = tf.getPath(); bool dnd = tf.doNotDownload(); // first split fpath by / separator - QStringList sl = QStringList::split(bt::DirSeparator(),fpath); + TQStringList sl = TQStringList::split(bt::DirSeparator(),fpath); // create all necessary subdirs - QString ctmp = cache_dir; - QString otmp = output_dir; - QString dtmp = tmpdir + "dnd" + bt::DirSeparator(); + TQString ctmp = cache_dir; + TQString otmp = output_dir; + TQString dtmp = tmpdir + "dnd" + bt::DirSeparator(); for (Uint32 i = 0;i < sl.count() - 1;i++) { otmp += sl[i]; @@ -301,7 +301,7 @@ namespace bt bt::Delete(cache_dir + fpath,true); // delete any existing symlinks // then make the file - QString tmp = dnd ? tmpdir + "dnd" + bt::DirSeparator() : output_dir; + TQString tmp = dnd ? tmpdir + "dnd" + bt::DirSeparator() : output_dir; if (dnd) { // only symlink, when we open the files a default dnd file will be made if the file is corrupt or doesn't exist @@ -325,14 +325,14 @@ namespace bt void MultiFileCache::load(Chunk* c) { - QValueList<Uint32> tflist; + TQValueList<Uint32> tflist; tor.calcChunkPos(c->getIndex(),tflist); // one file is simple, just mmap it if (tflist.count() == 1) { const TorrentFile & f = tor.getFile(tflist.first()); - CacheFile* fd = files.find(tflist.first()); + CacheFile* fd = files.tqfind(tflist.first()); if (!fd) return; @@ -357,8 +357,8 @@ namespace bt for (Uint32 i = 0;i < tflist.count();i++) { const TorrentFile & f = tor.getFile(tflist[i]); - CacheFile* fd = files.find(tflist[i]); - DNDFile* dfd = dnd_files.find(tflist[i]); + CacheFile* fd = files.tqfind(tflist[i]); + DNDFile* dfd = dnd_files.tqfind(tflist[i]); // first calculate offset into file // only the first file can have an offset @@ -404,7 +404,7 @@ namespace bt bool MultiFileCache::prep(Chunk* c) { // find out in which files a chunk lies - QValueList<Uint32> tflist; + TQValueList<Uint32> tflist; tor.calcChunkPos(c->getIndex(),tflist); // Out() << "Prep " << c->getIndex() << endl; @@ -412,7 +412,7 @@ namespace bt { // in one so just mmap it Uint64 off = FileOffset(c,tor.getFile(tflist.first()),tor.getChunkSize()); - CacheFile* fd = files.find(tflist.first()); + CacheFile* fd = files.tqfind(tflist.first()); Uint8* buf = 0; if (fd && Cache::mappedModeAllowed() && mmap_failures < 3) { @@ -425,7 +425,7 @@ namespace bt { // if mmap fails or is not possible use buffered mode c->allocate(); - c->setStatus(Chunk::BUFFERED); + c->settqStatus(Chunk::BUFFERED); } else { @@ -436,26 +436,26 @@ namespace bt { // just allocate it c->allocate(); - c->setStatus(Chunk::BUFFERED); + c->settqStatus(Chunk::BUFFERED); } return true; } void MultiFileCache::save(Chunk* c) { - QValueList<Uint32> tflist; + TQValueList<Uint32> tflist; tor.calcChunkPos(c->getIndex(),tflist); - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) { // mapped chunks are easy - CacheFile* fd = files.find(tflist[0]); + CacheFile* fd = files.tqfind(tflist[0]); if (!fd) return; fd->unmap(c->getData(),c->getSize()); c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); return; } @@ -464,8 +464,8 @@ namespace bt for (Uint32 i = 0;i < tflist.count();i++) { const TorrentFile & f = tor.getFile(tflist[i]); - CacheFile* fd = files.find(tflist[i]); - DNDFile* dfd = dnd_files.find(tflist[i]); + CacheFile* fd = files.tqfind(tflist[i]); + DNDFile* dfd = dnd_files.tqfind(tflist[i]); // first calculate offset into file // only the first file can have an offset @@ -506,13 +506,13 @@ namespace bt // set the chunk to on disk and clear it c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); } void MultiFileCache::downloadStatusChanged(TorrentFile* tf, bool download) { bool dnd = !download; - QString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); + TQString dnd_dir = tmpdir + "dnd" + bt::DirSeparator(); // if it is dnd and it is already in the dnd tree do nothing if (dnd && bt::Exists(dnd_dir + tf->getPath() + ".dnd")) return; @@ -587,12 +587,12 @@ namespace bt - void MultiFileCache::saveFirstAndLastChunk(TorrentFile* tf,const QString & src_file,const QString & dst_file) + void MultiFileCache::saveFirstAndLastChunk(TorrentFile* tf,const TQString & src_file,const TQString & dst_file) { DNDFile out(dst_file); File fptr; if (!fptr.open(src_file,"rb")) - throw Error(i18n("Cannot open file %1 : %2").arg(src_file).arg(fptr.errorString())); + throw Error(i18n("Cannot open file %1 : %2").tqarg(src_file).tqarg(fptr.errorString())); Uint32 cs = 0; if (tf->getFirstChunk() == tor.getNumChunks() - 1) @@ -626,7 +626,7 @@ namespace bt } } - void MultiFileCache::recreateFile(TorrentFile* tf,const QString & dnd_file,const QString & output_file) + void MultiFileCache::recreateFile(TorrentFile* tf,const TQString & dnd_file,const TQString & output_file) { DNDFile dnd(dnd_file); @@ -654,7 +654,7 @@ namespace bt // first attempt failed, must be fat so try that if (!FatPreallocate(output_file,tf->getSize())) { - throw Error(i18n("Cannot preallocate diskspace : %1").arg(strerror(errno))); + throw Error(i18n("Cannot preallocate diskspace : %1").tqarg(strerror(errno))); } } @@ -670,7 +670,7 @@ namespace bt File fptr; if (!fptr.open(output_file,"r+b")) - throw Error(i18n("Cannot open file %1 : %2").arg(output_file).arg(fptr.errorString())); + throw Error(i18n("Cannot open file %1 : %2").tqarg(output_file).tqarg(fptr.errorString())); Uint32 ts = cs - tf->getFirstChunkOffset() > tf->getLastChunkSize() ? @@ -719,7 +719,7 @@ namespace bt } } - bool MultiFileCache::hasMissingFiles(QStringList & sl) + bool MultiFileCache::hasMissingFiles(TQStringList & sl) { bool ret = false; for (Uint32 i = 0;i < tor.getNumFiles();i++) @@ -728,8 +728,8 @@ namespace bt if (tf.doNotDownload()) continue; - QString p = cache_dir + tf.getPath(); - QFileInfo fi(p); + TQString p = cache_dir + tf.getPath(); + TQFileInfo fi(p); // always use symlink first, file might have been moved if (!fi.exists()) { @@ -755,21 +755,21 @@ namespace bt return ret; } - static void DeleteEmptyDirs(const QString & output_dir,const QString & fpath) + static void DeleteEmptyDirs(const TQString & output_dir,const TQString & fpath) { - QStringList sl = QStringList::split(bt::DirSeparator(),fpath); + TQStringList sl = TQStringList::split(bt::DirSeparator(),fpath); // remove the last, which is just the filename sl.pop_back(); while (sl.count() > 0) { - QString path = output_dir; + TQString path = output_dir; // reassemble the full directory path - for (QStringList::iterator itr = sl.begin(); itr != sl.end();itr++) + for (TQStringList::iterator itr = sl.begin(); itr != sl.end();itr++) path += *itr + bt::DirSeparator(); - QDir dir(path); - QStringList el = dir.entryList(QDir::All|QDir::System|QDir::Hidden); + TQDir dir(path); + TQStringList el = dir.entryList(TQDir::All|TQDir::System|TQDir::Hidden); el.remove("."); el.remove(".."); if (el.count() == 0) @@ -782,14 +782,14 @@ namespace bt else { - // children, so we cannot delete any more directories higher up + // tqchildren, so we cannot delete any more directories higher up return; } } // now the output_dir itself - QDir dir(output_dir); - QStringList el = dir.entryList(QDir::All|QDir::System|QDir::Hidden); + TQDir dir(output_dir); + TQStringList el = dir.entryList(TQDir::All|TQDir::System|TQDir::Hidden); el.remove("."); el.remove(".."); if (el.count() == 0) @@ -804,7 +804,7 @@ namespace bt for (Uint32 i = 0;i < tor.getNumFiles();i++) { TorrentFile & tf = tor.getFile(i); - QString fpath = tf.getPath(); + TQString fpath = tf.getPath(); if (!tf.doNotDownload()) { // first delete the file @@ -828,7 +828,7 @@ namespace bt try { - CacheFile* cf = files.find(i); + CacheFile* cf = files.tqfind(i); if (cf) { sum += cf->diskUsage(); diff --git a/libktorrent/torrent/multifilecache.h b/libktorrent/torrent/multifilecache.h index 9c1280e..ed09525 100644 --- a/libktorrent/torrent/multifilecache.h +++ b/libktorrent/torrent/multifilecache.h @@ -39,34 +39,34 @@ namespace bt */ class MultiFileCache : public Cache { - QString cache_dir,output_dir; + TQString cache_dir,output_dir; PtrMap<Uint32,CacheFile> files; PtrMap<Uint32,DNDFile> dnd_files; public: - MultiFileCache(Torrent& tor,const QString & tmpdir,const QString & datadir,bool custom_output_name); + MultiFileCache(Torrent& tor,const TQString & tmpdir,const TQString & datadir,bool custom_output_name); virtual ~MultiFileCache(); - virtual void changeTmpDir(const QString& ndir); + virtual void changeTmpDir(const TQString& ndir); virtual void create(); virtual void load(Chunk* c); virtual void save(Chunk* c); virtual bool prep(Chunk* c); virtual void close(); virtual void open(); - virtual QString getOutputPath() const; - virtual void changeOutputPath(const QString & outputpath); - virtual KIO::Job* moveDataFiles(const QString & ndir); + virtual TQString getOutputPath() const; + virtual void changeOutputPath(const TQString & outputpath); + virtual KIO::Job* moveDataFiles(const TQString & ndir); virtual void moveDataFilesCompleted(KIO::Job* job); virtual void preallocateDiskSpace(PreallocationThread* prealloc); - virtual bool hasMissingFiles(QStringList & sl); + virtual bool hasMissingFiles(TQStringList & sl); virtual void deleteDataFiles(); virtual Uint64 diskUsage(); private: void touch(TorrentFile & tf); virtual void downloadStatusChanged(TorrentFile*, bool); - QString guessDataDir(); - void saveFirstAndLastChunk(TorrentFile* tf,const QString & src_file,const QString & dst_file); - void recreateFile(TorrentFile* tf,const QString & dnd_file,const QString & output_file); + TQString guessDataDir(); + void saveFirstAndLastChunk(TorrentFile* tf,const TQString & src_file,const TQString & dst_file); + void recreateFile(TorrentFile* tf,const TQString & dnd_file,const TQString & output_file); }; } diff --git a/libktorrent/torrent/oldchokealgorithm.cpp b/libktorrent/torrent/oldchokealgorithm.cpp index e24d63a..6c529ce 100644 --- a/libktorrent/torrent/oldchokealgorithm.cpp +++ b/libktorrent/torrent/oldchokealgorithm.cpp @@ -109,7 +109,7 @@ namespace bt void OldChokeAlgorithm::updateDownloaders() { - QPtrList<Peer>::iterator itr = interested.begin(); + TQPtrList<Peer>::iterator itr = interested.begin(); int num = 0; // send all downloaders an unchoke for (;itr != interested.end();itr++) @@ -152,7 +152,7 @@ namespace bt if (downloaders.count() == 0) return; - QPtrList<Peer>::iterator itr = not_interested.begin(); + TQPtrList<Peer>::iterator itr = not_interested.begin(); // fd = fastest_downloader Peer* fd = downloaders.first(); // send all downloaders an unchoke @@ -188,8 +188,8 @@ namespace bt } // Get current time - QTime now = QTime::currentTime(); - QPtrList<Peer> peers; // list to store peers to select from + TQTime now = TQTime::currentTime(); + TQPtrList<Peer> peers; // list to store peers to select from // recently connected peers == peers connected in the last 5 minutes const int RECENTLY_CONNECT_THRESH = 5*60; diff --git a/libktorrent/torrent/packet.cpp b/libktorrent/torrent/packet.cpp index febede2..4e6cf01 100644 --- a/libktorrent/torrent/packet.cpp +++ b/libktorrent/torrent/packet.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qstring.h> +#include <tqstring.h> #include <string.h> #include <util/log.h> #include <util/bitset.h> @@ -86,7 +86,7 @@ namespace bt memcpy(data+13,ch->getData() + begin,len); } - Packet::Packet(Uint8 ext_id,const QByteArray & ext_data) : data(0),size(0),written(0) + Packet::Packet(Uint8 ext_id,const TQByteArray & ext_data) : data(0),size(0),written(0) { size = 6 + ext_data.size(); data = AllocPacket(size,EXTENDED); @@ -131,23 +131,23 @@ namespace bt } /* - QString Packet::debugString() const + TQString Packet::debugString() const { if (!data) - return QString::null; + return TQString(); switch (data[4]) { - case CHOKE : return QString("CHOKE %1 %2").arg(hdr_length).arg(data_length); - case UNCHOKE : return QString("UNCHOKE %1 %2").arg(hdr_length).arg(data_length); - case INTERESTED : return QString("INTERESTED %1 %2").arg(hdr_length).arg(data_length); - case NOT_INTERESTED : return QString("NOT_INTERESTED %1 %2").arg(hdr_length).arg(data_length); - case HAVE : return QString("HAVE %1 %2").arg(hdr_length).arg(data_length); - case BITFIELD : return QString("BITFIELD %1 %2").arg(hdr_length).arg(data_length); - case PIECE : return QString("PIECE %1 %2").arg(hdr_length).arg(data_length); - case REQUEST : return QString("REQUEST %1 %2").arg(hdr_length).arg(data_length); - case CANCEL : return QString("CANCEL %1 %2").arg(hdr_length).arg(data_length); - default: return QString("UNKNOWN %1 %2").arg(hdr_length).arg(data_length); + case CHOKE : return TQString("CHOKE %1 %2").tqarg(hdr_length).tqarg(data_length); + case UNCHOKE : return TQString("UNCHOKE %1 %2").tqarg(hdr_length).tqarg(data_length); + case INTERESTED : return TQString("INTERESTED %1 %2").tqarg(hdr_length).tqarg(data_length); + case NOT_INTERESTED : return TQString("NOT_INTERESTED %1 %2").tqarg(hdr_length).tqarg(data_length); + case HAVE : return TQString("HAVE %1 %2").tqarg(hdr_length).tqarg(data_length); + case BITFIELD : return TQString("BITFIELD %1 %2").tqarg(hdr_length).tqarg(data_length); + case PIECE : return TQString("PIECE %1 %2").tqarg(hdr_length).tqarg(data_length); + case REQUEST : return TQString("REQUEST %1 %2").tqarg(hdr_length).tqarg(data_length); + case CANCEL : return TQString("CANCEL %1 %2").tqarg(hdr_length).tqarg(data_length); + default: return TQString("UNKNOWN %1 %2").tqarg(hdr_length).tqarg(data_length); } } */ diff --git a/libktorrent/torrent/packet.h b/libktorrent/torrent/packet.h index 9259d31..d9eb550 100644 --- a/libktorrent/torrent/packet.h +++ b/libktorrent/torrent/packet.h @@ -22,7 +22,7 @@ #include "globals.h" -class QString; +class TQString; namespace bt { @@ -48,7 +48,7 @@ namespace bt Packet(const BitSet & bs); Packet(const Request & req,Uint8 type); Packet(Uint32 index,Uint32 begin,Uint32 len,Chunk* ch); - Packet(Uint8 ext_id,const QByteArray & ext_data); // extension protocol packet + Packet(Uint8 ext_id,const TQByteArray & ext_data); // extension protocol packet virtual ~Packet(); Uint8 getType() const {return data ? data[4] : 0;} diff --git a/libktorrent/torrent/packetreader.cpp b/libktorrent/torrent/packetreader.cpp index 8df348b..3d4910a 100644 --- a/libktorrent/torrent/packetreader.cpp +++ b/libktorrent/torrent/packetreader.cpp @@ -36,13 +36,13 @@ namespace bt #ifdef LOG_PACKET static void LogPacket(const Uint8* data,Uint32 size,Uint32 len) { - QString file = QString("/tmp/kt-packetreader-%1.log").arg(getpid()); + TQString file = TQString("/tmp/kt-packetreader-%1.log").tqarg(getpid()); File fptr; if (!fptr.open(file,"a")) return; - QString tmp = QString("PACKET len = %1, type = %2\nDATA: \n").arg(len).arg(data[0]); + TQString tmp = TQString("PACKET len = %1, type = %2\nDATA: \n").tqarg(len).tqarg(data[0]); fptr.write(tmp.ascii(),tmp.length()); @@ -51,7 +51,7 @@ namespace bt { for (Uint32 i = 0;i < size;i++) { - tmp = QString("0x%1 ").arg(data[i],0,16); + tmp = TQString("0x%1 ").tqarg(data[i],0,16); fptr.write(tmp.ascii(),tmp.length()); j++; if (j > 10) @@ -65,7 +65,7 @@ namespace bt { for (Uint32 i = 0;i < 20;i++) { - tmp = QString("0x%1 ").arg(data[i],0,16); + tmp = TQString("0x%1 ").tqarg(data[i],0,16); fptr.write(tmp.ascii(),tmp.length()); j++; if (j > 10) @@ -74,11 +74,11 @@ namespace bt j = 0; } } - tmp = QString("\n ... \n"); + tmp = TQString("\n ... \n"); fptr.write(tmp.ascii(),tmp.length()); for (Uint32 i = size - 20;i < size;i++) { - tmp = QString("0x%1 ").arg(data[i],0,16); + tmp = TQString("0x%1 ").tqarg(data[i],0,16); fptr.write(tmp.ascii(),tmp.length()); j++; if (j > 10) diff --git a/libktorrent/torrent/packetreader.h b/libktorrent/torrent/packetreader.h index da1e03e..782604d 100644 --- a/libktorrent/torrent/packetreader.h +++ b/libktorrent/torrent/packetreader.h @@ -20,8 +20,8 @@ #ifndef BTPACKETREADER_H #define BTPACKETREADER_H -#include <qmutex.h> -#include <qptrlist.h> +#include <tqmutex.h> +#include <tqptrlist.h> #include <net/bufferedsocket.h> #include "globals.h" @@ -46,8 +46,8 @@ namespace bt { Peer* peer; bool error; - QPtrList<IncomingPacket> packet_queue; - QMutex mutex; + TQPtrList<IncomingPacket> packet_queue; + TQMutex mutex; Uint8 len[4]; int len_received; public: diff --git a/libktorrent/torrent/packetwriter.cpp b/libktorrent/torrent/packetwriter.cpp index 888d23d..6c186dc 100644 --- a/libktorrent/torrent/packetwriter.cpp +++ b/libktorrent/torrent/packetwriter.cpp @@ -71,7 +71,7 @@ namespace bt void PacketWriter::queuePacket(Packet* p) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); if (p->getType() == PIECE) data_packets.push_back(p); else @@ -194,8 +194,8 @@ namespace bt } else { - /* Out(SYS_CON|LOG_DEBUG) << QString("Uploading %1 %2 %3 %4 %5") - .arg(index).arg(begin).arg(len).arg((Q_ULLONG)ch,0,16).arg((Q_ULLONG)ch->getData(),0,16) + /* Out(SYS_CON|LOG_DEBUG) << TQString("Uploading %1 %2 %3 %4 %5") + .tqarg(index).tqarg(begin).tqarg(len).tqarg((TQ_ULLONG)ch,0,16).tqarg((TQ_ULLONG)ch->getData(),0,16) << endl;; */ queuePacket(new Packet(index,begin,len,ch)); @@ -205,25 +205,25 @@ namespace bt void PacketWriter::sendExtProtHandshake(Uint16 port,bool pex_on) { - QByteArray arr; + TQByteArray arr; BEncoder enc(new BEncoderBufferOutput(arr)); enc.beginDict(); - enc.write("m"); + enc.write(TQString("m")); // supported messages enc.beginDict(); - enc.write("ut_pex");enc.write((Uint32)(pex_on ? 1 : 0)); + enc.write(TQString("ut_pex"));enc.write((Uint32)(pex_on ? 1 : 0)); enc.end(); if (port > 0) { - enc.write("p"); + enc.write(TQString("p")); enc.write((Uint32)port); } - enc.write("v"); enc.write(QString("KTorrent %1").arg(kt::VERSION_STRING)); + enc.write(TQString("v")); enc.write(TQString("KTorrent %1").tqarg(kt::VERSION_STRING)); enc.end(); sendExtProtMsg(0,arr); } - void PacketWriter::sendExtProtMsg(Uint8 id,const QByteArray & data) + void PacketWriter::sendExtProtMsg(Uint8 id,const TQByteArray & data) { queuePacket(new Packet(id,data)); } @@ -259,7 +259,7 @@ namespace bt Uint32 PacketWriter::onReadyToWrite(Uint8* data,Uint32 max_to_write) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); if (!curr_packet) curr_packet = selectPacket(); @@ -314,7 +314,7 @@ namespace bt Uint32 PacketWriter::getUploadedDataBytes() const { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); Uint32 ret = uploaded; uploaded = 0; return ret; @@ -322,7 +322,7 @@ namespace bt Uint32 PacketWriter::getUploadedNonDataBytes() const { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); Uint32 ret = uploaded_non_data; uploaded_non_data = 0; return ret; @@ -330,19 +330,19 @@ namespace bt Uint32 PacketWriter::getNumPacketsToWrite() const { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); return data_packets.size() + control_packets.size(); } Uint32 PacketWriter::getNumDataPacketsToWrite() const { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); return data_packets.size(); } void PacketWriter::doNotSendPiece(const Request & req,bool reject) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); std::list<Packet*>::iterator i = data_packets.begin(); while (i != data_packets.end()) { @@ -370,7 +370,7 @@ namespace bt void PacketWriter::clearPieces(bool reject) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); std::list<Packet*>::iterator i = data_packets.begin(); while (i != data_packets.end()) diff --git a/libktorrent/torrent/packetwriter.h b/libktorrent/torrent/packetwriter.h index 9b77731..8330b65 100644 --- a/libktorrent/torrent/packetwriter.h +++ b/libktorrent/torrent/packetwriter.h @@ -21,7 +21,7 @@ #define BTPACKETWRITER_H #include <list> -#include <qmutex.h> +#include <tqmutex.h> #include <net/bufferedsocket.h> #include "globals.h" @@ -45,7 +45,7 @@ namespace bt Uint32 ctrl_packets_sent; mutable Uint32 uploaded; mutable Uint32 uploaded_non_data; - mutable QMutex mutex; + mutable TQMutex mutex; public: PacketWriter(Peer* peer); virtual ~PacketWriter(); @@ -145,7 +145,7 @@ namespace bt void sendExtProtHandshake(Uint16 port,bool pex_on = true); /// Send an extended protocol message - void sendExtProtMsg(Uint8 id,const QByteArray & data); + void sendExtProtMsg(Uint8 id,const TQByteArray & data); /// Get the number of packets which need to be written Uint32 getNumPacketsToWrite() const; diff --git a/libktorrent/torrent/peer.cpp b/libktorrent/torrent/peer.cpp index 7a5727b..6e5f519 100644 --- a/libktorrent/torrent/peer.cpp +++ b/libktorrent/torrent/peer.cpp @@ -66,7 +66,7 @@ namespace bt time_choked = GetCurrentTime(); time_unchoked = 0; - connect_time = QTime::currentTime(); + connect_time = TQTime::currentTime(); //sock->attachPeer(this); stats.client = peer_id.identifyClient(); stats.ip_address = getIPAddresss(); @@ -353,7 +353,7 @@ namespace bt return; } - QByteArray tmp; + TQByteArray tmp; tmp.setRawData((const char*)packet,size); BNode* node = 0; try @@ -365,7 +365,7 @@ namespace bt BDictNode* dict = (BDictNode*)node; // handshake packet, so just check if the peer supports ut_pex - dict = dict->getDict("m"); + dict = dict->getDict(TQString("m")); BValueNode* val = 0; if (dict && (val = dict->getValue("ut_pex"))) { @@ -490,12 +490,12 @@ namespace bt return pieces.allOn(); } - QString Peer::getIPAddresss() const + TQString Peer::getIPAddresss() const { if (sock) return sock->getRemoteIPAddress(); else - return QString::null; + return TQString(); } Uint16 Peer::getPort() const @@ -555,7 +555,7 @@ namespace bt gotPortPacket(sock->getRemoteIPAddress(),sock->getRemotePort()); } - void Peer::emitPex(const QByteArray & data) + void Peer::emitPex(const TQByteArray & data) { pex(data); } diff --git a/libktorrent/torrent/peer.h b/libktorrent/torrent/peer.h index 68dfecc..bb487aa 100644 --- a/libktorrent/torrent/peer.h +++ b/libktorrent/torrent/peer.h @@ -20,8 +20,8 @@ #ifndef BTPEER_H #define BTPEER_H -#include <qobject.h> -#include <qdatetime.h> +#include <tqobject.h> +#include <tqdatetime.h> #include <util/timer.h> #include <interfaces/peerinterface.h> #include <util/bitset.h> @@ -64,10 +64,11 @@ namespace bt * It provides functions for sending packets. Packets it receives * get relayed to the outside world using a bunch of signals. */ - class Peer : public QObject, public kt::PeerInterface + class Peer : public TQObject, public kt::PeerInterface //,public Object { Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the socket. @@ -92,7 +93,7 @@ namespace bt Uint32 getID() const {return id;} /// Get the IP address of the Peer. - QString getIPAddresss() const; + TQString getIPAddresss() const; /// Get the port of the Peer Uint16 getPort() const; @@ -197,7 +198,7 @@ namespace bt Uint32 getTimeSinceLastPiece() const; /// Get the time the peer connection was established. - const QTime & getConnectTime() const {return connect_time;} + const TQTime & getConnectTime() const {return connect_time;} /** * Get the percentual amount of data available from peer. @@ -224,7 +225,7 @@ namespace bt /** * Emit the pex signal */ - void emitPex(const QByteArray & data); + void emitPex(const TQByteArray & data); /// Disable or enable pex void setPexEnabled(bool on); @@ -281,12 +282,12 @@ namespace bt * @param ip The IP * @param port The port */ - void gotPortPacket(const QString & ip,Uint16 port); + void gotPortPacket(const TQString & ip,Uint16 port); /** - * A Peer Exchange has been received, the QByteArray contains the data. + * A Peer Exchange has been received, the TQByteArray contains the data. */ - void pex(const QByteArray & data); + void pex(const TQByteArray & data); private: void packetReady(const Uint8* packet,Uint32 size); @@ -310,7 +311,7 @@ namespace bt PeerDownloader* downloader; PeerUploader* uploader; mutable kt::PeerInterface::Stats stats; - QTime connect_time; + TQTime connect_time; UTPex* ut_pex; bool pex_allowed; Uint32 utorrent_pex_id; diff --git a/libktorrent/torrent/peerdownloader.cpp b/libktorrent/torrent/peerdownloader.cpp index 0c6cdd8..00e0b7a 100644 --- a/libktorrent/torrent/peerdownloader.cpp +++ b/libktorrent/torrent/peerdownloader.cpp @@ -70,8 +70,8 @@ namespace bt PeerDownloader::PeerDownloader(Peer* peer,Uint32 chunk_size) : peer(peer),grabbed(0),chunk_size(chunk_size / MAX_PIECE_LEN) { - connect(peer,SIGNAL(piece(const Piece& )),this,SLOT(piece(const Piece& ))); - connect(peer,SIGNAL(destroyed()),this,SLOT(peerDestroyed())); + connect(peer,TQT_SIGNAL(piece(const Piece& )),this,TQT_SLOT(piece(const Piece& ))); + connect(peer,TQT_SIGNAL(destroyed()),this,TQT_SLOT(peerDestroyed())); nearly_done = false; max_wait_queue_size = 25; } @@ -83,7 +83,7 @@ namespace bt #if 0 void PeerDownloader::retransmitRequests() { - for (QValueList<Request>::iterator i = reqs.begin();i != reqs.end();i++) + for (TQValueList<Request>::iterator i = reqs.begin();i != reqs.end();i++) peer->getPacketWriter().sendRequest(*i); } @@ -126,11 +126,11 @@ namespace bt if (!peer) return; - if (wait_queue.contains(req)) + if (wait_queue.tqcontains(req)) { wait_queue.remove(req); } - else if (reqs.contains(req)) + else if (reqs.tqcontains(req)) { reqs.remove(req); peer->getPacketWriter().sendCancel(req); @@ -144,7 +144,7 @@ namespace bt // Out(SYS_CON|LOG_DEBUG) << "Rejected : " << req.getIndex() << " " // << req.getOffset() << " " << req.getLength() << endl; - if (reqs.contains(req)) + if (reqs.tqcontains(req)) { reqs.remove(req); rejected(req); @@ -155,7 +155,7 @@ namespace bt { if (peer) { - QValueList<TimeStampedRequest>::iterator i = reqs.begin(); + TQValueList<TimeStampedRequest>::iterator i = reqs.begin(); while (i != reqs.end()) { TimeStampedRequest & tr = *i; @@ -171,9 +171,9 @@ namespace bt void PeerDownloader::piece(const Piece & p) { Request r(p); - if (wait_queue.contains(r)) + if (wait_queue.tqcontains(r)) wait_queue.remove(r); - else if (reqs.contains(r)) + else if (reqs.tqcontains(r)) reqs.remove(r); downloaded(p); @@ -214,7 +214,7 @@ namespace bt TimeStamp now = bt::GetCurrentTime(); // we use a 60 second interval const Uint32 MAX_INTERVAL = 60 * 1000; - QValueList<TimeStampedRequest>::iterator i = reqs.begin(); + TQValueList<TimeStampedRequest>::iterator i = reqs.begin(); while (i != reqs.end()) { TimeStampedRequest & tr = *i; @@ -266,7 +266,7 @@ namespace bt if (peer->getStats().fast_extensions) return; - QValueList<TimeStampedRequest>::iterator i = reqs.begin(); + TQValueList<TimeStampedRequest>::iterator i = reqs.begin(); while (i != reqs.end()) { TimeStampedRequest & tr = *i; @@ -275,7 +275,7 @@ namespace bt } reqs.clear(); - QValueList<Request>::iterator j = wait_queue.begin(); + TQValueList<Request>::iterator j = wait_queue.begin(); while (j != wait_queue.end()) { Request & req = *j; diff --git a/libktorrent/torrent/peerdownloader.h b/libktorrent/torrent/peerdownloader.h index 4eb37d2..6173c97 100644 --- a/libktorrent/torrent/peerdownloader.h +++ b/libktorrent/torrent/peerdownloader.h @@ -21,8 +21,8 @@ #define BTPEERDOWNLOADER_H #include <set> -#include <qvaluelist.h> -#include <qobject.h> +#include <tqvaluelist.h> +#include <tqobject.h> #include "globals.h" #include "request.h" @@ -91,9 +91,10 @@ namespace bt * * This class downloads Piece's from a Peer. */ - class PeerDownloader : public QObject + class PeerDownloader : public TQObject { - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the Peer @@ -218,8 +219,8 @@ namespace bt private: Peer* peer; - QValueList<TimeStampedRequest> reqs; - QValueList<Request> wait_queue; + TQValueList<TimeStampedRequest> reqs; + TQValueList<Request> wait_queue; Uint32 max_wait_queue_size; int grabbed; Uint32 chunk_size; diff --git a/libktorrent/torrent/peerid.cpp b/libktorrent/torrent/peerid.cpp index 5f314b3..b1741d2 100644 --- a/libktorrent/torrent/peerid.cpp +++ b/libktorrent/torrent/peerid.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include <time.h> #include <stdlib.h> -#include <qmap.h> +#include <tqmap.h> #include <klocale.h> #include "peerid.h" #include "ktversion.h" @@ -97,23 +97,23 @@ namespace bt return false; } - QString PeerID::toString() const + TQString PeerID::toString() const { - QString r; + TQString r; for (int i = 0;i < 20;i++) r += id[i] == 0 ? ' ' : id[i]; return r; } - QString PeerID::identifyClient() const + TQString PeerID::identifyClient() const { if (!client_name.isNull()) return client_name; - QString peer_id = toString(); + TQString peer_id = toString(); // we only need to create this map once // so make it static - static QMap<QString, QString> Map; + static TQMap<TQString, TQString> Map; static bool first = true; if (first) @@ -159,8 +159,8 @@ namespace bt Map["MT"] = "MoonLight"; Map["PD"] = "Pando"; Map["qB"] = "qBittorrent"; - Map["QD"] = "QQDownload"; - Map["QT"] = "Qt 4 Torrent example"; + Map["QD"] = "TQQDownload"; + Map["QT"] = "TQt 4 Torrent example"; Map["RS"] = "Rufus"; Map["RT"] = "Retriever"; Map["S~"] = "Shareaza alpha/beta"; @@ -174,7 +174,7 @@ namespace bt Map["TS"] = "Torrent Storm"; Map["TT"] = "TuoTu"; Map["UL"] = "uLeecher!"; - Map["UT"] = QString("%1Torrent").arg(QChar(0x00B5)); // µTorrent, 0x00B5 is unicode for µ + Map["UT"] = TQString("%1Torrent").tqarg(TQChar(0x00B5)); // µTorrent, 0x00B5 is tqunicode for µ Map["WT"] = "BitLet"; Map["WY"] = "FireTorrent"; Map["XL"] = "Xunlei"; @@ -200,32 +200,32 @@ namespace bt first = false; } - QString name = i18n("Unknown client"); - if (peer_id.at(0) == '-' && - peer_id.at(1).isLetter() && - peer_id.at(2).isLetter() ) //AZ style + TQString name = i18n("Unknown client"); + if (peer_id.tqat(0) == '-' && + peer_id.tqat(1).isLetter() && + peer_id.tqat(2).isLetter() ) //AZ style { - QString ID(peer_id.mid(1,2)); - if (Map.contains(ID)) - name = Map[ID] + " " + peer_id.at(3) + "." + peer_id.at(4) + "." - + peer_id.at(5) + "." + peer_id.at(6); + TQString ID(peer_id.mid(1,2)); + if (Map.tqcontains(ID)) + name = Map[ID] + " " + peer_id.tqat(3) + "." + peer_id.tqat(4) + "." + + peer_id.tqat(5) + "." + peer_id.tqat(6); } - else if (peer_id.at(0).isLetter() && - peer_id.at(1).isDigit() && - peer_id.at(2).isDigit() ) //Shadow's style + else if (peer_id.tqat(0).isLetter() && + peer_id.tqat(1).isDigit() && + peer_id.tqat(2).isDigit() ) //Shadow's style { - QString ID = QString(peer_id.at(0)); - if (Map.contains(ID)) - name = Map[ID] + " " + peer_id.at(1) + "." + - peer_id.at(2) + "." + peer_id.at(3); + TQString ID = TQString(peer_id.tqat(0)); + if (Map.tqcontains(ID)) + name = Map[ID] + " " + peer_id.tqat(1) + "." + + peer_id.tqat(2) + "." + peer_id.tqat(3); } - else if (peer_id.at(0) == 'M' && peer_id.at(2) == '-' && (peer_id.at(4) == '-' || peer_id.at(5) == '-')) + else if (peer_id.tqat(0) == 'M' && peer_id.tqat(2) == '-' && (peer_id.tqat(4) == '-' || peer_id.tqat(5) == '-')) { - name = Map["M"] + " " + peer_id.at(1) + "." + peer_id.at(3); - if(peer_id.at(4) == '-') - name += "." + peer_id.at(5); + name = Map["M"] + " " + peer_id.tqat(1) + "." + peer_id.tqat(3); + if(peer_id.tqat(4) == '-') + name += "." + peer_id.tqat(5); else - name += peer_id.at(4) + "." + peer_id.at(6); + name += peer_id.tqat(4) + "." + peer_id.tqat(6); } else if (peer_id.startsWith("OP")) { @@ -245,7 +245,7 @@ namespace bt } else if ( peer_id.startsWith("Mbrst")) { - name = Map["Mbrst"] + " " + peer_id.at(5) + "." + peer_id.at(7); + name = Map["Mbrst"] + " " + peer_id.tqat(5) + "." + peer_id.tqat(7); } return name; diff --git a/libktorrent/torrent/peerid.h b/libktorrent/torrent/peerid.h index 90ba439..8ebea9a 100644 --- a/libktorrent/torrent/peerid.h +++ b/libktorrent/torrent/peerid.h @@ -20,7 +20,7 @@ #ifndef BTPEERID_H #define BTPEERID_H -#include <qstring.h> +#include <tqstring.h> namespace bt { @@ -31,7 +31,7 @@ namespace bt class PeerID { char id[20]; - QString client_name; + TQString client_name; public: PeerID(); PeerID(const char* pid); @@ -42,14 +42,14 @@ namespace bt const char* data() const {return id;} - QString toString() const; + TQString toString() const; /** * Interprets the PeerID to figure out which client it is. * @author Ivan + Joris * @return The name of the client */ - QString identifyClient() const; + TQString identifyClient() const; friend bool operator == (const PeerID & a,const PeerID & b); friend bool operator != (const PeerID & a,const PeerID & b); diff --git a/libktorrent/torrent/peermanager.cpp b/libktorrent/torrent/peermanager.cpp index d3744fc..c85ebd4 100644 --- a/libktorrent/torrent/peermanager.cpp +++ b/libktorrent/torrent/peermanager.cpp @@ -31,14 +31,14 @@ #include "uploader.h" #include "downloader.h" #include <util/functions.h> -#include <qhostaddress.h> +#include <tqhostaddress.h> #include <mse/streamsocket.h> #include <mse/encryptedauthenticate.h> #include <klocale.h> #include "ipblocklist.h" #include "chunkcounter.h" #include "authenticationmonitor.h" -#include <qdatetime.h> +#include <tqdatetime.h> using namespace kt; @@ -81,7 +81,7 @@ namespace bt // update the speed of each peer, // and get ridd of some killed peers - QPtrList<Peer>::iterator i = peer_list.begin(); + TQPtrList<Peer>::iterator i = peer_list.begin(); while (i != peer_list.end()) { Peer* p = *i; @@ -111,7 +111,7 @@ namespace bt { Out() << "Getting rid of peers which have been choked for a long time" << endl; TimeStamp now = bt::GetCurrentTime(); - QPtrList<Peer>::iterator i = peer_list.begin(); + TQPtrList<Peer>::iterator i = peer_list.begin(); Uint32 num_killed = 0; while (i != peer_list.end() && num_killed < 20) { @@ -157,7 +157,7 @@ namespace bt void PeerManager::killSeeders() { - QPtrList<Peer>::iterator i = peer_list.begin(); + TQPtrList<Peer>::iterator i = peer_list.begin(); while (i != peer_list.end()) { Peer* p = *i; @@ -169,11 +169,11 @@ namespace bt void PeerManager::killUninterested() { - QPtrList<Peer>::iterator i = peer_list.begin(); + TQPtrList<Peer>::iterator i = peer_list.begin(); while (i != peer_list.end()) { Peer* p = *i; - if ( !p->isInterested() && (p->getConnectTime().secsTo(QTime::currentTime()) > 30) ) + if ( !p->isInterested() && (p->getConnectTime().secsTo(TQTime::currentTime()) > 30) ) p->kill(); i++; } @@ -233,13 +233,13 @@ namespace bt if (a && Globals::instance().getServer().unencryptedConnectionsAllowed()) { // if possible try unencrypted - QString ip = a->getIP(); + TQString ip = a->getIP(); Uint16 port = a->getPort(); Authenticate* st = new Authenticate(ip,port,tor.getInfoHash(),tor.getPeerID(),this); if (auth->isLocal()) st->setLocal(true); - connect(this,SIGNAL(stopped()),st,SLOT(onPeerManagerDestroyed())); + connect(this,TQT_SIGNAL(stopped()),st,TQT_SLOT(onPeerManagerDestroyed())); AuthenticationMonitor::instance().add(st); num_pending++; total_connections++; @@ -259,11 +259,11 @@ namespace bt { Peer* peer = new Peer(sock,peer_id,tor.getNumChunks(),tor.getChunkSize(),support,local); - connect(peer,SIGNAL(haveChunk(Peer*, Uint32 )),this,SLOT(onHave(Peer*, Uint32 ))); - connect(peer,SIGNAL(bitSetRecieved(const BitSet& )), - this,SLOT(onBitSetRecieved(const BitSet& ))); - connect(peer,SIGNAL(rerunChoker()),this,SLOT(onRerunChoker())); - connect(peer,SIGNAL(pex( const QByteArray& )),this,SLOT(pex( const QByteArray& ))); + connect(peer,TQT_SIGNAL(haveChunk(Peer*, Uint32 )),this,TQT_SLOT(onHave(Peer*, Uint32 ))); + connect(peer,TQT_SIGNAL(bitSetRecieved(const BitSet& )), + this,TQT_SLOT(onBitSetRecieved(const BitSet& ))); + connect(peer,TQT_SIGNAL(rerunChoker()),this,TQT_SLOT(onRerunChoker())); + connect(peer,TQT_SIGNAL(pex( const TQByteArray& )),this,TQT_SLOT(pex( const TQByteArray& ))); peer_list.append(peer); peer_map.insert(peer->getID(),peer); @@ -288,7 +288,7 @@ namespace bt return false; } - bool PeerManager::connectedTo(const QString & ip,Uint16 port) const + bool PeerManager::connectedTo(const TQString & ip,Uint16 port) const { PtrMap<Uint32,Peer>::const_iterator i = peer_map.begin(); while (i != peer_map.end()) @@ -356,7 +356,7 @@ namespace bt if (pp.local) auth->setLocal(true); - connect(this,SIGNAL(stopped()),auth,SLOT(onPeerManagerDestroyed())); + connect(this,TQT_SIGNAL(stopped()),auth,TQT_SLOT(onPeerManagerDestroyed())); AuthenticationMonitor::instance().add(auth); num_pending++; @@ -406,7 +406,7 @@ namespace bt Uint16 port; }; - void PeerManager::savePeerList(const QString & file) + void PeerManager::savePeerList(const TQString & file) { bt::File fptr; if (!fptr.open(file,"wb")) @@ -424,7 +424,7 @@ namespace bt Out(SYS_GEN|LOG_DEBUG) << "Saving list of peers to " << file << endl; // first the active peers - for (QPtrList<Peer>::iterator itr = peer_list.begin(); itr != peer_list.end();itr++) + for (TQPtrList<Peer>::iterator itr = peer_list.begin(); itr != peer_list.end();itr++) { Peer* p = *itr; PeerListEntry e; @@ -452,7 +452,7 @@ namespace bt } } - void PeerManager::loadPeerList(const QString & file) + void PeerManager::loadPeerList(const TQString & file) { bt::File fptr; if (!fptr.open(file,"rb")) @@ -474,11 +474,11 @@ namespace bt PotentialPeer pp; // convert IP address to string - pp.ip = QString("%1.%2.%3.%4") - .arg((e.ip & 0xFF000000) >> 24) - .arg((e.ip & 0x00FF0000) >> 16) - .arg((e.ip & 0x0000FF00) >> 8) - .arg( e.ip & 0x000000FF); + pp.ip = TQString("%1.%2.%3.%4") + .tqarg((e.ip & 0xFF000000) >> 24) + .tqarg((e.ip & 0x00FF0000) >> 16) + .tqarg((e.ip & 0x0000FF00) >> 8) + .tqarg( e.ip & 0x000000FF); pp.port = e.port; addPotentialPeer(pp); } @@ -509,7 +509,7 @@ namespace bt Peer* PeerManager::findPeer(Uint32 peer_id) { - return peer_map.find(peer_id); + return peer_map.tqfind(peer_id); } void PeerManager::onRerunChoker() @@ -550,7 +550,7 @@ namespace bt return false; } - void PeerManager::pex(const QByteArray & arr) + void PeerManager::pex(const TQByteArray & arr) { if (!pex_on) return; @@ -563,11 +563,11 @@ namespace bt PotentialPeer pp; pp.port = ReadUint16(tmp,4); Uint32 ip = ReadUint32(tmp,0); - pp.ip = QString("%1.%2.%3.%4") - .arg((ip & 0xFF000000) >> 24) - .arg((ip & 0x00FF0000) >> 16) - .arg((ip & 0x0000FF00) >> 8) - .arg( ip & 0x000000FF); + pp.ip = TQString("%1.%2.%3.%4") + .tqarg((ip & 0xFF000000) >> 24) + .tqarg((ip & 0x00FF0000) >> 16) + .tqarg((ip & 0x0000FF00) >> 8) + .tqarg( ip & 0x000000FF); pp.local = false; addPotentialPeer(pp); @@ -583,7 +583,7 @@ namespace bt if (pex_on == on) return; - QPtrList<Peer>::iterator i = peer_list.begin(); + TQPtrList<Peer>::iterator i = peer_list.begin(); while (i != peer_list.end()) { Peer* p = *i; diff --git a/libktorrent/torrent/peermanager.h b/libktorrent/torrent/peermanager.h index d5fdb9f..df55beb 100644 --- a/libktorrent/torrent/peermanager.h +++ b/libktorrent/torrent/peermanager.h @@ -21,8 +21,8 @@ #define BTPEERMANAGER_H #include <map> -#include <qobject.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqptrlist.h> #include <util/ptrmap.h> #include "globals.h" #include "peerid.h" @@ -53,9 +53,10 @@ namespace bt * This class manages all Peer objects. * It can also open connections to other peers. */ - class PeerManager : public QObject + class PeerManager : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Constructor. @@ -180,14 +181,14 @@ namespace bt /** * Save the IP's and port numbers of all peers. */ - void savePeerList(const QString & file); + void savePeerList(const TQString & file); /** * Load the peer list again and add them to the potential peers */ - void loadPeerList(const QString & file); + void loadPeerList(const TQString & file); - typedef QPtrList<Peer>::const_iterator CItr; + typedef TQPtrList<Peer>::const_iterator CItr; CItr beginPeerList() const {return peer_list.begin();} CItr endPeerList() const {return peer_list.end();} @@ -212,13 +213,13 @@ namespace bt void updateAvailableChunks(); bool killBadPeer(); void createPeer(mse::StreamSocket* sock,const PeerID & peer_id,Uint32 support,bool local); - bool connectedTo(const QString & ip,Uint16 port) const; + bool connectedTo(const TQString & ip,Uint16 port) const; private slots: void onHave(Peer* p,Uint32 index); void onBitSetRecieved(const BitSet & bs); void onRerunChoker(); - void pex(const QByteArray & arr); + void pex(const TQByteArray & arr); signals: @@ -228,8 +229,8 @@ namespace bt private: PtrMap<Uint32,Peer> peer_map; - QPtrList<Peer> peer_list; - QPtrList<Peer> killed; + TQPtrList<Peer> peer_list; + TQPtrList<Peer> killed; Torrent & tor; bool started; BitSet available_chunks; @@ -241,9 +242,9 @@ namespace bt static Uint32 max_total_connections; static Uint32 total_connections; - std::multimap<QString,kt::PotentialPeer> potential_peers; + std::multimap<TQString,kt::PotentialPeer> potential_peers; - typedef std::multimap<QString,kt::PotentialPeer>::iterator PPItr; + typedef std::multimap<TQString,kt::PotentialPeer>::iterator PPItr; }; } diff --git a/libktorrent/torrent/peersourcemanager.cpp b/libktorrent/torrent/peersourcemanager.cpp index fef55b5..80af240 100644 --- a/libktorrent/torrent/peersourcemanager.cpp +++ b/libktorrent/torrent/peersourcemanager.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> +#include <tqfile.h> #include <klocale.h> #include <functions.h> #include <util/log.h> @@ -65,14 +65,14 @@ namespace bt //load custom trackers loadCustomURLs(); - connect(&timer,SIGNAL(timeout()),this,SLOT(updateCurrentManually())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(updateCurrentManually())); } PeerSourceManager::~PeerSourceManager() { saveCustomURLs(); additional.setAutoDelete(true); - QPtrList<kt::PeerSource>::iterator itr = additional.begin(); + TQPtrList<kt::PeerSource>::iterator itr = additional.begin(); while (itr != additional.end()) { kt::PeerSource* ps = *itr; @@ -85,21 +85,21 @@ namespace bt void PeerSourceManager::addTracker(Tracker* trk) { trackers.insert(trk->trackerURL(),trk); - connect(trk,SIGNAL(peersReady( kt::PeerSource* )), - pman,SLOT(peerSourceReady( kt::PeerSource* ))); + connect(trk,TQT_SIGNAL(peersReady( kt::PeerSource* )), + pman,TQT_SLOT(peerSourceReady( kt::PeerSource* ))); } void PeerSourceManager::addPeerSource(kt::PeerSource* ps) { additional.append(ps); - connect(ps,SIGNAL(peersReady( kt::PeerSource* )), - pman,SLOT(peerSourceReady( kt::PeerSource* ))); + connect(ps,TQT_SIGNAL(peersReady( kt::PeerSource* )), + pman,TQT_SLOT(peerSourceReady( kt::PeerSource* ))); } void PeerSourceManager::removePeerSource(kt::PeerSource* ps) { - disconnect(ps,SIGNAL(peersReady( kt::PeerSource* )), - pman,SLOT(peerSourceReady( kt::PeerSource* ))); + disconnect(ps,TQT_SIGNAL(peersReady( kt::PeerSource* )), + pman,TQT_SLOT(peerSourceReady( kt::PeerSource* ))); additional.remove(ps); } @@ -109,7 +109,7 @@ namespace bt return; started = true; - QPtrList<kt::PeerSource>::iterator i = additional.begin(); + TQPtrList<kt::PeerSource>::iterator i = additional.begin(); while (i != additional.end()) { (*i)->start(); @@ -138,7 +138,7 @@ namespace bt return; started = false; - QPtrList<kt::PeerSource>::iterator i = additional.begin(); + TQPtrList<kt::PeerSource>::iterator i = additional.begin(); while (i != additional.end()) { (*i)->stop(); @@ -154,7 +154,7 @@ namespace bt void PeerSourceManager::completed() { - QPtrList<kt::PeerSource>::iterator i = additional.begin(); + TQPtrList<kt::PeerSource>::iterator i = additional.begin(); while (i != additional.end()) { (*i)->completed(); @@ -167,7 +167,7 @@ namespace bt void PeerSourceManager::manualUpdate() { - QPtrList<kt::PeerSource>::iterator i = additional.begin(); + TQPtrList<kt::PeerSource>::iterator i = additional.begin(); while (i != additional.end()) { (*i)->manualUpdate(); @@ -207,7 +207,7 @@ namespace bt void PeerSourceManager::addTracker(KURL url, bool custom,int tier) { - if (trackers.contains(url)) + if (trackers.tqcontains(url)) return; Tracker* trk = 0; @@ -227,11 +227,11 @@ namespace bt bool PeerSourceManager::removeTracker(KURL url) { - if (!custom_trackers.contains(url)) + if (!custom_trackers.tqcontains(url)) return false; custom_trackers.remove(url); - Tracker* trk = trackers.find(url); + Tracker* trk = trackers.tqfind(url); if (curr == trk) { // do a timed delete on the tracker, so the stop signal @@ -260,7 +260,7 @@ namespace bt void PeerSourceManager::setTracker(KURL url) { - Tracker* trk = trackers.find(url); + Tracker* trk = trackers.tqfind(url); if (!trk) return; @@ -279,7 +279,7 @@ namespace bt KURL::List::iterator i = custom_trackers.begin(); while (i != custom_trackers.end()) { - Tracker* t = trackers.find(*i); + Tracker* t = trackers.tqfind(*i); if (t) { if (curr == t) @@ -313,25 +313,25 @@ namespace bt void PeerSourceManager::saveCustomURLs() { - QString trackers_file = tor->getTorDir() + "trackers"; - QFile file(trackers_file); + TQString trackers_file = tor->getTorDir() + "trackers"; + TQFile file(trackers_file); if(!file.open(IO_WriteOnly)) return; - QTextStream stream(&file); + TQTextStream stream(&file); for (KURL::List::iterator i = custom_trackers.begin();i != custom_trackers.end();i++) stream << (*i).prettyURL() << ::endl; } void PeerSourceManager::loadCustomURLs() { - QString trackers_file = tor->getTorDir() + "trackers"; - QFile file(trackers_file); + TQString trackers_file = tor->getTorDir() + "trackers"; + TQFile file(trackers_file); if(!file.open(IO_ReadOnly)) return; no_save_custom_trackers = true; - QTextStream stream(&file); + TQTextStream stream(&file); while (!stream.atEnd()) { KURL url = stream.readLine(); @@ -365,7 +365,7 @@ namespace bt return n; } - void PeerSourceManager::onTrackerError(const QString & err) + void PeerSourceManager::onTrackerError(const TQString & err) { failures++; pending = false; @@ -386,7 +386,7 @@ namespace bt // 30 minutes curr->setInterval(FINAL_WAIT_TIME); timer.start(FINAL_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } else if (curr->failureCount() > 2) { @@ -394,14 +394,14 @@ namespace bt // a minute or 5, no need for hammering every 30 seconds curr->setInterval(LONGER_WAIT_TIME); timer.start(LONGER_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } else { // lets not hammer and wait 30 seconds curr->setInterval(INITIAL_WAIT_TIME); timer.start(INITIAL_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } } else @@ -418,7 +418,7 @@ namespace bt { curr->setInterval(FINAL_WAIT_TIME); timer.start(FINAL_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } else if (trk->failureCount() > 2) { @@ -426,14 +426,14 @@ namespace bt // wait 5 minutes and try again curr->setInterval(LONGER_WAIT_TIME); timer.start(LONGER_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } else { // wait 30 seconds and try again curr->setInterval(INITIAL_WAIT_TIME); timer.start(INITIAL_WAIT_TIME * 1000,true); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } } } @@ -449,7 +449,7 @@ namespace bt pending = false; if (started) statusChanged(i18n("OK")); - request_time = QDateTime::currentDateTime(); + request_time = TQDateTime::tqcurrentDateTime(); } void PeerSourceManager::onTrackerRequestPending() @@ -477,10 +477,10 @@ namespace bt if (curr) { - disconnect(curr,SIGNAL(requestFailed( const QString& )), - this,SLOT(onTrackerError( const QString& ))); - disconnect(curr,SIGNAL(requestOK()),this,SLOT(onTrackerOK())); - disconnect(curr,SIGNAL(requestPending()),this,SLOT(onTrackerRequestPending())); + disconnect(curr,TQT_SIGNAL(requestFailed( const TQString& )), + this,TQT_SLOT(onTrackerError( const TQString& ))); + disconnect(curr,TQT_SIGNAL(requestOK()),this,TQT_SLOT(onTrackerOK())); + disconnect(curr,TQT_SIGNAL(requestPending()),this,TQT_SLOT(onTrackerRequestPending())); curr = 0; } @@ -488,14 +488,14 @@ namespace bt if (curr) { Out(SYS_TRK|LOG_NOTICE) << "Switching to tracker " << trk->trackerURL() << endl; - QObject::connect(curr,SIGNAL(requestFailed( const QString& )), - this,SLOT(onTrackerError( const QString& ))); + TQObject::connect(curr,TQT_SIGNAL(requestFailed( const TQString& )), + this,TQT_SLOT(onTrackerError( const TQString& ))); - QObject::connect(curr,SIGNAL(requestOK()), - this,SLOT(onTrackerOK())); + TQObject::connect(curr,TQT_SIGNAL(requestOK()), + this,TQT_SLOT(onTrackerOK())); - QObject::connect(curr,SIGNAL(requestPending()), - this,SLOT(onTrackerRequestPending())); + TQObject::connect(curr,TQT_SIGNAL(requestPending()), + this,TQT_SLOT(onTrackerRequestPending())); } } @@ -504,7 +504,7 @@ namespace bt if (pending || !started || !curr) return 0; - return curr->getInterval() - request_time.secsTo(QDateTime::currentDateTime()); + return curr->getInterval() - request_time.secsTo(TQDateTime::tqcurrentDateTime()); } Uint32 PeerSourceManager::getNumSeeders() const diff --git a/libktorrent/torrent/peersourcemanager.h b/libktorrent/torrent/peersourcemanager.h index cdace4e..c46bbb8 100644 --- a/libktorrent/torrent/peersourcemanager.h +++ b/libktorrent/torrent/peersourcemanager.h @@ -20,9 +20,9 @@ #ifndef BTPEERSOURCEMANAGER_H #define BTPEERSOURCEMANAGER_H -#include <qtimer.h> -#include <qdatetime.h> -#include <qptrlist.h> +#include <tqtimer.h> +#include <tqdatetime.h> +#include <tqptrlist.h> #include <util/ptrmap.h> #include <interfaces/trackerslist.h> @@ -48,21 +48,22 @@ namespace bt * * This class manages all PeerSources. */ - class PeerSourceManager : public QObject, public kt::TrackersList + class PeerSourceManager : public TQObject, public kt::TrackersList { Q_OBJECT + TQ_OBJECT TorrentControl* tor; PeerManager* pman; PtrMap<KURL,Tracker> trackers; - QPtrList<kt::PeerSource> additional; + TQPtrList<kt::PeerSource> additional; Tracker* curr; dht::DHTTrackerBackend* m_dht; bool started; bool pending; KURL::List custom_trackers; - QDateTime request_time; - QTimer timer; + TQDateTime request_time; + TQTimer timer; Uint32 failures; bool no_save_custom_trackers; public: @@ -144,7 +145,7 @@ namespace bt * The an error happened contacting the tracker. * @param err The error */ - void onTrackerError(const QString & err); + void onTrackerError(const TQString & err); /** * Tracker update was OK. @@ -164,10 +165,10 @@ namespace bt signals: /** - * Status has changed of the tracker. + * tqStatus has changed of the tracker. * @param ns The new status */ - void statusChanged(const QString & ns); + void statusChanged(const TQString & ns); private: void saveCustomURLs(); diff --git a/libktorrent/torrent/peeruploader.cpp b/libktorrent/torrent/peeruploader.cpp index 1e0dbca..4881dc8 100644 --- a/libktorrent/torrent/peeruploader.cpp +++ b/libktorrent/torrent/peeruploader.cpp @@ -45,7 +45,7 @@ namespace bt void PeerUploader::addRequest(const Request & r) { // Out(SYS_CON|LOG_DEBUG) << - // QString("PeerUploader::addRequest %1 %2 %3\n").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()) << endl; + // TQString("PeerUploader::addRequest %1 %2 %3\n").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()) << endl; // allowed fast chunks go to the front of the queue requests.append(r); @@ -54,7 +54,7 @@ namespace bt void PeerUploader::removeRequest(const Request & r) { // Out(SYS_CON|LOG_DEBUG) << - // QString("PeerUploader::removeRequest %1 %2 %3\n").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()) << endl; + // TQString("PeerUploader::removeRequest %1 %2 %3\n").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()) << endl; requests.remove(r); peer->getPacketWriter().doNotSendPiece(r,peer->getStats().fast_extensions); } @@ -113,7 +113,7 @@ namespace bt // reject all requests // if the peer supports fast extensions, // choke doesn't mean reject all - QValueList<Request>::iterator i = requests.begin(); + TQValueList<Request>::iterator i = requests.begin(); while (i != requests.end()) { pw.sendReject(*i); diff --git a/libktorrent/torrent/peeruploader.h b/libktorrent/torrent/peeruploader.h index 94aea74..596cdbb 100644 --- a/libktorrent/torrent/peeruploader.h +++ b/libktorrent/torrent/peeruploader.h @@ -21,7 +21,7 @@ #define BTPEERUPLOADER_H #include <set> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "request.h" @@ -45,7 +45,7 @@ namespace bt class PeerUploader { Peer* peer; - QValueList<Request> requests; + TQValueList<Request> requests; Uint32 uploaded; public: /** diff --git a/libktorrent/torrent/preallocationthread.cpp b/libktorrent/torrent/preallocationthread.cpp index 6fb2100..4b2e40d 100644 --- a/libktorrent/torrent/preallocationthread.cpp +++ b/libktorrent/torrent/preallocationthread.cpp @@ -25,7 +25,7 @@ #include <util/log.h> #include <util/error.h> -#include <qfile.h> +#include <tqfile.h> #include <klocale.h> #include "preallocationthread.h" #include "chunkmanager.h" @@ -71,7 +71,7 @@ namespace bt mutex.unlock(); } - void PreallocationThread::setErrorMsg(const QString & msg) + void PreallocationThread::setErrorMsg(const TQString & msg) { mutex.lock(); error_msg = msg; stopped = true; diff --git a/libktorrent/torrent/preallocationthread.h b/libktorrent/torrent/preallocationthread.h index 31bd668..581017d 100644 --- a/libktorrent/torrent/preallocationthread.h +++ b/libktorrent/torrent/preallocationthread.h @@ -20,10 +20,10 @@ #ifndef BTPREALLOCATIONTHREAD_H #define BTPREALLOCATIONTHREAD_H -#include <qstring.h> -#include <qthread.h> -#include <qmap.h> -#include <qmutex.h> +#include <tqstring.h> +#include <tqthread.h> +#include <tqmap.h> +#include <tqmutex.h> #include <util/constants.h> @@ -37,13 +37,13 @@ namespace bt * * Thread to preallocate diskspace */ - class PreallocationThread : public QThread + class PreallocationThread : public TQThread { ChunkManager* cman; bool stopped,not_finished,done; - QString error_msg; + TQString error_msg; Uint64 bytes_written; - mutable QMutex mutex; + mutable TQMutex mutex; public: PreallocationThread(ChunkManager* cman); virtual ~PreallocationThread(); @@ -60,7 +60,7 @@ namespace bt * Set an error message, also calls stop * @param msg The message */ - void setErrorMsg(const QString & msg); + void setErrorMsg(const TQString & msg); /// See if the thread has been stopped bool isStopped() const; @@ -69,7 +69,7 @@ namespace bt bool errorHappened() const; /// Get the error_msg - const QString & errorMessage() const {return error_msg;} + const TQString & errorMessage() const {return error_msg;} /// nb Number of bytes have been written void written(Uint64 nb); @@ -86,7 +86,7 @@ namespace bt /// See if the thread was done bool isDone() const; private: - bool expand(const QString & path,Uint64 max_size); + bool expand(const TQString & path,Uint64 max_size); }; } diff --git a/libktorrent/torrent/queuemanager.cpp b/libktorrent/torrent/queuemanager.cpp index 4135f8f..1199179 100644 --- a/libktorrent/torrent/queuemanager.cpp +++ b/libktorrent/torrent/queuemanager.cpp @@ -20,7 +20,7 @@ ***************************************************************************/ #include "queuemanager.h" -#include <qstring.h> +#include <tqstring.h> #include <kmessagebox.h> #include <klocale.h> #include <util/log.h> @@ -41,7 +41,7 @@ using namespace kt; namespace bt { - QueueManager::QueueManager() : QObject(),exiting(false) + QueueManager::QueueManager() : TQObject(),exiting(false) { downloads.setAutoDelete(true); max_downloads = 0; @@ -60,15 +60,15 @@ namespace bt downloads.append(tc); downloads.sort(); - connect(tc, SIGNAL(diskSpaceLow(kt::TorrentInterface*, bool)), this, SLOT(onLowDiskSpace(kt::TorrentInterface*, bool))); - connect(tc, SIGNAL(torrentStopped(kt::TorrentInterface*)), this, SLOT(torrentStopped(kt::TorrentInterface*))); + connect(tc, TQT_SIGNAL(diskSpaceLow(kt::TorrentInterface*, bool)), this, TQT_SLOT(onLowDiskSpace(kt::TorrentInterface*, bool))); + connect(tc, TQT_SIGNAL(torrentStopped(kt::TorrentInterface*)), this, TQT_SLOT(torrentStopped(kt::TorrentInterface*))); } void QueueManager::remove(kt::TorrentInterface* tc) { paused_torrents.erase(tc); - int index = downloads.findRef(tc); + int index = downloads.tqfindRef(tc); if (index != -1) downloads.remove(index); @@ -132,7 +132,7 @@ namespace bt return kt::NOT_ENOUGH_DISKSPACE; case 1: //ask user - if (KMessageBox::questionYesNo(0, i18n("You don't have enough disk space to download this torrent. Are you sure you want to continue?"), i18n("Insufficient disk space for %1").arg(s.torrent_name)) == KMessageBox::No) + if (KMessageBox::questionYesNo(0, i18n("You don't have enough disk space to download this torrent. Are you sure you want to continue?"), i18n("Insufficient disk space for %1").tqarg(s.torrent_name)) == KMessageBox::No) { tc->setPriority(0); return kt::USER_CANCELED; @@ -154,7 +154,7 @@ namespace bt if (s.completed && max_ratio > 0 && ratio >= max_ratio) { - if (KMessageBox::questionYesNo(0, i18n("Torrent \"%1\" has reached its maximum share ratio. Ignore the limit and start seeding anyway?").arg(s.torrent_name), i18n("Maximum share ratio limit reached.")) == KMessageBox::Yes) + if (KMessageBox::questionYesNo(0, i18n("Torrent \"%1\" has reached its maximum share ratio. Ignore the limit and start seeding anyway?").tqarg(s.torrent_name), i18n("Maximum share ratio limit reached.")) == KMessageBox::Yes) { tc->setMaxShareRatio(0.00f); startSafely(tc); @@ -167,7 +167,7 @@ namespace bt } else { - return kt::QM_LIMITS_REACHED; + return kt::TQM_LIMITS_REACHED; } return kt::START_OK; @@ -193,7 +193,7 @@ namespace bt void QueueManager::startall(int type) { - QPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); + TQPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); while (i != downloads.end()) { @@ -213,7 +213,7 @@ namespace bt void QueueManager::stopall(int type) { - QPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); + TQPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); while (i != downloads.end()) { @@ -232,9 +232,9 @@ namespace bt } catch (bt::Error & err) { - QString msg = + TQString msg = i18n("Error stopping torrent %1 : %2") - .arg(s.torrent_name).arg(err.toString()); + .tqarg(s.torrent_name).tqarg(err.toString()); KMessageBox::error(0, msg, i18n("Error")); } } @@ -249,7 +249,7 @@ namespace bt void QueueManager::onExit(WaitJob* wjob) { exiting = true; - QPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); + TQPtrList<kt::TorrentInterface>::iterator i = downloads.begin(); while (i != downloads.end()) { @@ -272,7 +272,7 @@ namespace bt int QueueManager::countDownloads() { int nr = 0; - QPtrList<TorrentInterface>::const_iterator i = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator i = downloads.begin(); while (i != downloads.end()) { @@ -288,7 +288,7 @@ namespace bt int QueueManager::countSeeds() { int nr = 0; - QPtrList<TorrentInterface>::const_iterator i = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator i = downloads.begin(); while (i != downloads.end()) { @@ -305,7 +305,7 @@ namespace bt { int nr = 0; // int test = 1; - QPtrList<TorrentInterface>::const_iterator i = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator i = downloads.begin(); while (i != downloads.end()) { @@ -342,7 +342,7 @@ namespace bt { int nr = 0; // int test = 1; - QPtrList<TorrentInterface>::const_iterator i = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator i = downloads.begin(); while (i != downloads.end()) { @@ -375,12 +375,12 @@ namespace bt return nr; } - QPtrList<kt::TorrentInterface>::iterator QueueManager::begin() + TQPtrList<kt::TorrentInterface>::iterator QueueManager::begin() { return downloads.begin(); } - QPtrList<kt::TorrentInterface>::iterator QueueManager::end() + TQPtrList<kt::TorrentInterface>::iterator QueueManager::end() { return downloads.end(); } @@ -402,7 +402,7 @@ namespace bt bool QueueManager::allreadyLoaded(const SHA1Hash & ih) const { - QPtrList<kt::TorrentInterface>::const_iterator itr = downloads.begin(); + TQPtrList<kt::TorrentInterface>::const_iterator itr = downloads.begin(); while (itr != downloads.end()) { @@ -420,7 +420,7 @@ namespace bt void QueueManager::mergeAnnounceList(const SHA1Hash & ih, const TrackerTier* trk) { - QPtrList<kt::TorrentInterface>::iterator itr = downloads.begin(); + TQPtrList<kt::TorrentInterface>::iterator itr = downloads.begin(); while (itr != downloads.end()) { @@ -447,8 +447,8 @@ namespace bt downloads.sort(); - QPtrList<TorrentInterface>::const_iterator it = downloads.begin(); - QPtrList<TorrentInterface>::const_iterator its = downloads.end(); + TQPtrList<TorrentInterface>::const_iterator it = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator its = downloads.end(); if (max_downloads != 0 || max_seeds != 0) @@ -607,7 +607,7 @@ namespace bt { if (!user) { - QPtrList<TorrentInterface>::const_iterator it = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator it = downloads.begin(); while (it != downloads.end()) { @@ -659,7 +659,7 @@ namespace bt } else { - QPtrList<TorrentInterface>::const_iterator it = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator it = downloads.begin(); for (; it != downloads.end(); it++) { TorrentInterface* tc = *it; @@ -692,7 +692,7 @@ namespace bt { int tp = tc->getPriority(); bool completed = tc->getStats().completed; - QPtrList<TorrentInterface>::const_iterator it = downloads.begin(); + TQPtrList<TorrentInterface>::const_iterator it = downloads.begin(); while (it != downloads.end()) { @@ -738,9 +738,9 @@ namespace bt { const TorrentStats & s = tc->getStats(); - QString msg = + TQString msg = i18n("Error starting torrent %1 : %2") - .arg(s.torrent_name).arg(err.toString()); + .tqarg(s.torrent_name).tqarg(err.toString()); KMessageBox::error(0, msg, i18n("Error")); } @@ -756,9 +756,9 @@ namespace bt { const TorrentStats & s = tc->getStats(); - QString msg = + TQString msg = i18n("Error stopping torrent %1 : %2") - .arg(s.torrent_name).arg(err.toString()); + .tqarg(s.torrent_name).tqarg(err.toString()); KMessageBox::error(0, msg, i18n("Error")); } @@ -783,13 +783,13 @@ namespace bt ///////////////////////////////////////////////////////////////////////////////////////////// - QueuePtrList::QueuePtrList() : QPtrList<kt::TorrentInterface>() + QueuePtrList::QueuePtrList() : TQPtrList<kt::TorrentInterface>() {} QueuePtrList::~QueuePtrList() {} - int QueuePtrList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) + int QueuePtrList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { kt::TorrentInterface* tc1 = (kt::TorrentInterface*) item1; kt::TorrentInterface* tc2 = (kt::TorrentInterface*) item2; diff --git a/libktorrent/torrent/queuemanager.h b/libktorrent/torrent/queuemanager.h index 658c252..9771f53 100644 --- a/libktorrent/torrent/queuemanager.h +++ b/libktorrent/torrent/queuemanager.h @@ -18,12 +18,12 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QUEUEMANAGER_H -#define QUEUEMANAGER_H +#ifndef TQUEUEMANAGER_H +#define TQUEUEMANAGER_H #include <set> -#include <qobject.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqptrlist.h> #include <interfaces/torrentinterface.h> @@ -39,23 +39,24 @@ namespace bt struct TrackerTier; class WaitJob; - class QueuePtrList : public QPtrList<kt::TorrentInterface> + class QueuePtrList : public TQPtrList<kt::TorrentInterface> { public: QueuePtrList(); virtual ~QueuePtrList(); protected: - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); }; /** * @author Ivan Vasic * @brief This class contains list of all TorrentControls and is responsible for starting/stopping them */ - class QueueManager : public QObject + class QueueManager : public TQObject { Q_OBJECT + TQ_OBJECT public: QueueManager(); @@ -93,7 +94,7 @@ namespace bt void startNext(); - typedef QPtrList<kt::TorrentInterface>::iterator iterator; + typedef TQPtrList<kt::TorrentInterface>::iterator iterator; iterator begin(); iterator end(); diff --git a/libktorrent/torrent/server.cpp b/libktorrent/torrent/server.cpp index e3d00ae..758ebf5 100644 --- a/libktorrent/torrent/server.cpp +++ b/libktorrent/torrent/server.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qserversocket.h> +#include <tqserversocket.h> #include <mse/streamsocket.h> #include <util/sha1hash.h> #include <util/log.h> @@ -36,13 +36,13 @@ namespace bt { - class ServerSocket : public QServerSocket + class ServerSocket : public TQServerSocket { Server* srv; public: - ServerSocket(Server* srv,Uint16 port) : QServerSocket(port),srv(srv) + ServerSocket(Server* srv,Uint16 port) : TQServerSocket(port),srv(srv) { - QSocketDevice* sd = socketDevice(); + TQSocketDevice* sd = socketDevice(); if (sd) sd->setAddressReusable(true); } @@ -114,7 +114,7 @@ namespace bt else { IPBlocklist& ipfilter = IPBlocklist::instance(); - QString IP(s->getRemoteIPAddress()); + TQString IP(s->getRemoteIPAddress()); if (ipfilter.isBlocked( IP )) { delete s; @@ -145,7 +145,7 @@ namespace bt PeerManager* Server::findPeerManager(const SHA1Hash & hash) { - QPtrList<PeerManager>::iterator i = peer_managers.begin(); + TQPtrList<PeerManager>::iterator i = peer_managers.begin(); while (i != peer_managers.end()) { PeerManager* pm = *i; @@ -165,7 +165,7 @@ namespace bt { Uint8 buf[24]; memcpy(buf,"req2",4); - QPtrList<PeerManager>::iterator i = peer_managers.begin(); + TQPtrList<PeerManager>::iterator i = peer_managers.begin(); while (i != peer_managers.end()) { PeerManager* pm = *i; diff --git a/libktorrent/torrent/server.h b/libktorrent/torrent/server.h index 99c06eb..b53c2da 100644 --- a/libktorrent/torrent/server.h +++ b/libktorrent/torrent/server.h @@ -20,8 +20,8 @@ #ifndef BTSERVER_H #define BTSERVER_H -#include <qptrlist.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqobject.h> #include "globals.h" namespace bt @@ -42,11 +42,12 @@ namespace bt * All PeerManager's should register with this class when they * are created and should unregister when they are destroyed. */ - class Server : public QObject + class Server : public TQObject { Q_OBJECT + TQ_OBJECT - QPtrList<PeerManager> peer_managers; + TQPtrList<PeerManager> peer_managers; ServerSocket* sock; Uint16 port; bool encryption; diff --git a/libktorrent/torrent/serverauthenticate.cpp b/libktorrent/torrent/serverauthenticate.cpp index 479f0ce..9f7c76f 100644 --- a/libktorrent/torrent/serverauthenticate.cpp +++ b/libktorrent/torrent/serverauthenticate.cpp @@ -67,7 +67,7 @@ namespace bt Uint8* hs = handshake; IPBlocklist& ipfilter = IPBlocklist::instance(); - QString IP = sock->getRemoteIPAddress(); + TQString IP = sock->getRemoteIPAddress(); if (ipfilter.isBlocked( IP )) { diff --git a/libktorrent/torrent/serverauthenticate.h b/libktorrent/torrent/serverauthenticate.h index 70d3739..3a1c320 100644 --- a/libktorrent/torrent/serverauthenticate.h +++ b/libktorrent/torrent/serverauthenticate.h @@ -38,6 +38,7 @@ namespace bt class ServerAuthenticate : public AuthenticateBase { Q_OBJECT + TQ_OBJECT public: ServerAuthenticate(mse::StreamSocket* sock,Server* server); virtual ~ServerAuthenticate(); diff --git a/libktorrent/torrent/singlefilecache.cpp b/libktorrent/torrent/singlefilecache.cpp index 7d31bef..7ad0fd6 100644 --- a/libktorrent/torrent/singlefilecache.cpp +++ b/libktorrent/torrent/singlefilecache.cpp @@ -18,8 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <klocale.h> -#include <qfileinfo.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> #include <util/fileops.h> #include <util/error.h> #include <util/functions.h> @@ -35,24 +35,24 @@ namespace bt { - SingleFileCache::SingleFileCache(Torrent& tor,const QString & tmpdir,const QString & datadir) + SingleFileCache::SingleFileCache(Torrent& tor,const TQString & tmpdir,const TQString & datadir) : Cache(tor,tmpdir,datadir),fd(0) { cache_file = tmpdir + "cache"; - output_file = QFileInfo(cache_file).readLink(); + output_file = TQFileInfo(cache_file).readLink(); } SingleFileCache::~SingleFileCache() {} - void SingleFileCache::changeTmpDir(const QString & ndir) + void SingleFileCache::changeTmpDir(const TQString & ndir) { Cache::changeTmpDir(ndir); cache_file = tmpdir + "cache"; } - KIO::Job* SingleFileCache::moveDataFiles(const QString & ndir) + KIO::Job* SingleFileCache::moveDataFiles(const TQString & ndir) { return KIO::move(KURL::fromPathOrURL(output_file),KURL::fromPathOrURL(ndir)); } @@ -61,11 +61,11 @@ namespace bt { } - void bt::SingleFileCache::changeOutputPath(const QString & outputpath) + void bt::SingleFileCache::changeOutputPath(const TQString & outputpath) { bt::Delete(cache_file); output_file = outputpath; - datadir = output_file.left(output_file.findRev(bt::DirSeparator())); + datadir = output_file.left(output_file.tqfindRev(bt::DirSeparator())); bt::SymLink(output_file, cache_file); } @@ -76,7 +76,7 @@ namespace bt { // mmap continuously fails, so stop using it c->allocate(); - c->setStatus(Chunk::BUFFERED); + c->settqStatus(Chunk::BUFFERED); } else { @@ -88,7 +88,7 @@ namespace bt // buffer it if mmapping fails Out(SYS_GEN|LOG_IMPORTANT) << "Warning : mmap failure, falling back to buffered mode" << endl; c->allocate(); - c->setStatus(Chunk::BUFFERED); + c->settqStatus(Chunk::BUFFERED); } else { @@ -105,7 +105,7 @@ namespace bt if (mmap_failures >= 3 || !(buf = (Uint8*)fd->map(c,off,c->getSize(),CacheFile::READ))) { c->allocate(); - c->setStatus(Chunk::BUFFERED); + c->settqStatus(Chunk::BUFFERED); fd->read(c->getData(),c->getSize(),off); if (mmap_failures < 3) mmap_failures++; @@ -119,27 +119,27 @@ namespace bt void SingleFileCache::save(Chunk* c) { // unmap the chunk if it is mapped - if (c->getStatus() == Chunk::MMAPPED) + if (c->gettqStatus() == Chunk::MMAPPED) { fd->unmap(c->getData(),c->getSize()); c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); } - else if (c->getStatus() == Chunk::BUFFERED) + else if (c->gettqStatus() == Chunk::BUFFERED) { Uint64 off = c->getIndex() * tor.getChunkSize(); fd->write(c->getData(),c->getSize(),off); c->clear(); - c->setStatus(Chunk::ON_DISK); + c->settqStatus(Chunk::ON_DISK); } } void SingleFileCache::create() { - QFileInfo fi(cache_file); + TQFileInfo fi(cache_file); if (!fi.exists()) { - QString out_file = fi.readLink(); + TQString out_file = fi.readLink(); if (out_file.isNull()) out_file = datadir + tor.getNameSuggestion(); @@ -157,7 +157,7 @@ namespace bt } else { - QString out_file = fi.readLink(); + TQString out_file = fi.readLink(); if (!bt::Exists(out_file)) bt::Touch(out_file); else @@ -205,12 +205,12 @@ namespace bt prealloc->setNotFinished(); } - bool SingleFileCache::hasMissingFiles(QStringList & sl) + bool SingleFileCache::hasMissingFiles(TQStringList & sl) { - QFileInfo fi(cache_file); + TQFileInfo fi(cache_file); if (!fi.exists()) { - QString out_file = fi.readLink(); + TQString out_file = fi.readLink(); sl.append(fi.readLink()); return true; } diff --git a/libktorrent/torrent/singlefilecache.h b/libktorrent/torrent/singlefilecache.h index faa71b6..fc96fe7 100644 --- a/libktorrent/torrent/singlefilecache.h +++ b/libktorrent/torrent/singlefilecache.h @@ -35,11 +35,11 @@ namespace bt */ class SingleFileCache : public Cache { - QString cache_file; - QString output_file; + TQString cache_file; + TQString output_file; CacheFile* fd; public: - SingleFileCache(Torrent& tor,const QString & tmpdir,const QString & datadir); + SingleFileCache(Torrent& tor,const TQString & tmpdir,const TQString & datadir); virtual ~SingleFileCache(); virtual bool prep(Chunk* c); @@ -48,13 +48,13 @@ namespace bt virtual void create(); virtual void close(); virtual void open(); - virtual void changeTmpDir(const QString & ndir); - virtual KIO::Job* moveDataFiles(const QString & ndir); + virtual void changeTmpDir(const TQString & ndir); + virtual KIO::Job* moveDataFiles(const TQString & ndir); virtual void moveDataFilesCompleted(KIO::Job* job); - virtual void changeOutputPath(const QString& outputpath); - virtual QString getOutputPath() const {return output_file;} + virtual void changeOutputPath(const TQString& outputpath); + virtual TQString getOutputPath() const {return output_file;} virtual void preallocateDiskSpace(PreallocationThread* prealloc); - virtual bool hasMissingFiles(QStringList & sl); + virtual bool hasMissingFiles(TQStringList & sl); virtual void deleteDataFiles(); virtual Uint64 diskUsage(); }; diff --git a/libktorrent/torrent/speedestimater.cpp b/libktorrent/torrent/speedestimater.cpp index f12b5ac..a0b67da 100644 --- a/libktorrent/torrent/speedestimater.cpp +++ b/libktorrent/torrent/speedestimater.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qpair.h> -#include <qvaluelist.h> +#include <tqpair.h> +#include <tqvaluelist.h> #include <util/log.h> #include <util/timer.h> #include "speedestimater.h" @@ -29,14 +29,14 @@ namespace bt class SpeedEstimater::SpeedEstimaterPriv { float rate; - QValueList<QPair<Uint32,TimeStamp> > dlrate; + TQValueList<TQPair<Uint32,TimeStamp> > dlrate; public: SpeedEstimaterPriv() : rate(0) {} ~SpeedEstimaterPriv() {} void data(Uint32 bytes) { - dlrate.append(qMakePair(bytes,GetCurrentTime())); + dlrate.append(tqMakePair(bytes,GetCurrentTime())); } void update() @@ -44,10 +44,10 @@ namespace bt TimeStamp now = GetCurrentTime(); Uint32 bytes = 0,oldest = now; - QValueList<QPair<Uint32,TimeStamp> >::iterator i = dlrate.begin(); + TQValueList<TQPair<Uint32,TimeStamp> >::iterator i = dlrate.begin(); while (i != dlrate.end()) { - QPair<Uint32,TimeStamp> & p = *i; + TQPair<Uint32,TimeStamp> & p = *i; if (now - p.second > 3000) { i = dlrate.erase(i); diff --git a/libktorrent/torrent/statsfile.cpp b/libktorrent/torrent/statsfile.cpp index 2ffd3ae..54033aa 100644 --- a/libktorrent/torrent/statsfile.cpp +++ b/libktorrent/torrent/statsfile.cpp @@ -23,14 +23,14 @@ #include <util/log.h> #include <util/functions.h> -#include <qstring.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqtextstream.h> namespace bt { - StatsFile::StatsFile(QString filename) + StatsFile::StatsFile(TQString filename) :m_filename(filename) { m_file.setName(filename); @@ -47,42 +47,42 @@ namespace bt m_file.close(); } - void StatsFile::write(QString key, QString value) + void StatsFile::write(TQString key, TQString value) { m_values.insert(key.stripWhiteSpace(), value.stripWhiteSpace()); } - QString StatsFile::readString(QString key) + TQString StatsFile::readString(TQString key) { return m_values[key].stripWhiteSpace(); } - Uint64 StatsFile::readUint64(QString key) + Uint64 StatsFile::readUint64(TQString key) { bool ok = true; Uint64 val = readString(key).toULongLong(&ok); return val; } - int StatsFile::readInt(QString key) + int StatsFile::readInt(TQString key) { bool ok = true; int val = readString(key).toInt(&ok); return val; } - bool StatsFile::readBoolean(QString key) + bool StatsFile::readBoolean(TQString key) { return (bool) readInt(key); } - unsigned long StatsFile::readULong(QString key) + unsigned long StatsFile::readULong(TQString key) { bool ok = true; return readString(key).toULong(&ok); } - float bt::StatsFile::readFloat( QString key ) + float bt::StatsFile::readFloat( TQString key ) { bool ok = true; return readString(key).toFloat(&ok); @@ -93,11 +93,11 @@ namespace bt if (!m_file.open(IO_ReadOnly)) return; - QTextStream in(&m_file); + TQTextStream in(&m_file); while (!in.atEnd()) { - QString line = in.readLine(); - QString tmp = line.left(line.find('=')); + TQString line = in.readLine(); + TQString tmp = line.left(line.tqfind('=')); m_values.insert(tmp, line.mid(tmp.length()+1)); } close(); @@ -107,8 +107,8 @@ namespace bt { if (!m_file.open(IO_WriteOnly)) return; - QTextStream out(&m_file); - QMap<QString, QString>::iterator it = m_values.begin(); + TQTextStream out(&m_file); + TQMap<TQString, TQString>::iterator it = m_values.begin(); while(it!=m_values.end()) { out << it.key() << "=" << it.data() << ::endl; diff --git a/libktorrent/torrent/statsfile.h b/libktorrent/torrent/statsfile.h index 9f7a145..c37018f 100644 --- a/libktorrent/torrent/statsfile.h +++ b/libktorrent/torrent/statsfile.h @@ -20,9 +20,9 @@ #ifndef BTSTATSFILE_H #define BTSTATSFILE_H -#include <qstring.h> -#include <qfile.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqmap.h> #include <util/constants.h> @@ -40,32 +40,32 @@ namespace bt * @brief A constructor. * Constructs StatsFile object and calls readSync(). */ - StatsFile(QString filename); + StatsFile(TQString filename); ~StatsFile(); - ///Closes QFile + ///Closes TQFile void close(); /** * @brief Main read function. - * @return QString value that correspodents to key. - * @param key - QString stats key. + * @return TQString value that correspodents to key. + * @param key - TQString stats key. */ - QString readString(QString key); + TQString readString(TQString key); - Uint64 readUint64(QString key); - bool readBoolean(QString key); - int readInt(QString key); - unsigned long readULong(QString key); - float readFloat(QString key); + Uint64 readUint64(TQString key); + bool readBoolean(TQString key); + int readInt(TQString key); + unsigned long readULong(TQString key); + float readFloat(TQString key); /** * @brief Writes key and value. * It only inserts pair of key/value to the m_values. To make changes to file call writeSync(). - * @param key - QString key - * @param value - QString value. + * @param key - TQString key + * @param value - TQString value. */ - void write(QString key, QString value); + void write(TQString key, TQString value); ///Reads data from stats file to m_values. void readSync(); @@ -78,13 +78,13 @@ namespace bt * @param key The key * @return true if key is in the stats file */ - bool hasKey(const QString & key) const {return m_values.contains(key);} + bool hasKey(const TQString & key) const {return m_values.tqcontains(key);} private: - QString m_filename; - QFile m_file; + TQString m_filename; + TQFile m_file; - QMap<QString, QString> m_values; + TQMap<TQString, TQString> m_values; }; } diff --git a/libktorrent/torrent/torrent.cpp b/libktorrent/torrent/torrent.cpp index 6b8739b..e02af51 100644 --- a/libktorrent/torrent/torrent.cpp +++ b/libktorrent/torrent/torrent.cpp @@ -18,9 +18,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qdatastream.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqdatastream.h> +#include <tqstringlist.h> #include <util/log.h> #include <util/functions.h> #include <util/error.h> @@ -50,7 +50,7 @@ namespace bt } - void Torrent::load(const QByteArray & data,bool verbose) + void Torrent::load(const TQByteArray & data,bool verbose) { BNode* node = 0; @@ -81,7 +81,7 @@ namespace bt if (nodes) // DHT torrrents have a node key loadNodes(nodes); - loadInfo(dict->getDict("info")); + loadInfo(dict->getDict(TQString("info"))); loadAnnounceList(dict->getData("announce-list")); BNode* n = dict->getData("info"); SHA1HashGen hg; @@ -96,14 +96,14 @@ namespace bt } } - void Torrent::load(const QString & file,bool verbose) + void Torrent::load(const TQString & file,bool verbose) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_ReadOnly)) throw Error(i18n(" Unable to open torrent file %1 : %2") - .arg(file).arg(fptr.errorString())); + .tqarg(file).tqarg(fptr.errorString())); - QByteArray data(fptr.size()); + TQByteArray data(fptr.size()); // Out() << "File size = " << fptr.size() << endl; fptr.readBlock(data.data(),fptr.size()); @@ -157,14 +157,14 @@ namespace bt if (!ln) throw Error(i18n("Corrupted torrent!")); - QString path; + TQString path; for (Uint32 j = 0;j < ln->getNumChildren();j++) { BValueNode* v = ln->getValue(j); if (!v || v->data().getType() != Value::STRING) throw Error(i18n("Corrupted torrent!")); - QString sd = v->data().toString(encoding); + TQString sd = v->data().toString(encoding); path += sd; if (j + 1 < ln->getNumChildren()) path += bt::DirSeparator(); @@ -242,7 +242,7 @@ namespace bt throw Error(i18n("Corrupted torrent!")); - QByteArray hash_string = node->data().toByteArray(); + TQByteArray hash_string = node->data().toByteArray(); for (unsigned int i = 0;i < hash_string.size();i+=20) { Uint8 h[20]; @@ -366,7 +366,7 @@ namespace bt const SHA1Hash & Torrent::getHash(Uint32 idx) const { if (idx >= hash_pieces.count()) - throw Error(QString("Torrent::getHash %1 is out of bounds").arg(idx)); + throw Error(TQString("Torrent::getHash %1 is out of bounds").tqarg(idx)); return hash_pieces[idx]; } @@ -399,7 +399,7 @@ namespace bt return count; } - void Torrent::calcChunkPos(Uint32 chunk,QValueList<Uint32> & file_list) const + void Torrent::calcChunkPos(Uint32 chunk,TQValueList<Uint32> & file_list) const { file_list.clear(); if (chunk >= hash_pieces.size() || files.empty()) @@ -429,10 +429,10 @@ namespace bt void Torrent::updateFilePercentage(Uint32 chunk,const BitSet & bs) { - QValueList<Uint32> cfiles; + TQValueList<Uint32> cfiles; calcChunkPos(chunk,cfiles); - QValueList<Uint32>::iterator i = cfiles.begin(); + TQValueList<Uint32>::iterator i = cfiles.begin(); while (i != cfiles.end()) { TorrentFile & f = getFile(*i); @@ -441,9 +441,9 @@ namespace bt } } - bool Torrent::checkPathForDirectoryTraversal(const QString & p) + bool Torrent::checkPathForDirectoryTraversal(const TQString & p) { - QStringList sl = QStringList::split(bt::DirSeparator(),p); - return !sl.contains(".."); + TQStringList sl = TQStringList::split(bt::DirSeparator(),p); + return !sl.tqcontains(".."); } } diff --git a/libktorrent/torrent/torrent.h b/libktorrent/torrent/torrent.h index 04c45cd..05c28cc 100644 --- a/libktorrent/torrent/torrent.h +++ b/libktorrent/torrent/torrent.h @@ -22,7 +22,7 @@ #define BTTORRENT_H #include <kurl.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <util/sha1hash.h> #include <util/constants.h> #include <interfaces/torrentinterface.h> @@ -74,7 +74,7 @@ namespace bt * @param verbose Wether to print information to the log * @throw Error if something goes wrong */ - void load(const QString & file,bool verbose); + void load(const TQString & file,bool verbose); /** * Load a .torrent file. @@ -82,7 +82,7 @@ namespace bt * @param verbose Wether to print information to the log * @throw Error if something goes wrong */ - void load(const QByteArray & data,bool verbose); + void load(const TQByteArray & data,bool verbose); void debugPrintInfo(); @@ -102,7 +102,7 @@ namespace bt Uint64 getFileLength() const {return file_length;} /// Get the suggested name. - QString getNameSuggestion() const {return name_suggestion;} + TQString getNameSuggestion() const {return name_suggestion;} /** * Verify wether a hash matches the hash @@ -155,7 +155,7 @@ namespace bt * @param chunk The index of the chunk * @param file_list This list will be filled with all the indices */ - void calcChunkPos(Uint32 chunk,QValueList<Uint32> & file_list) const; + void calcChunkPos(Uint32 chunk,TQValueList<Uint32> & file_list) const; /** * Checks if torrent file is audio or video. @@ -197,19 +197,19 @@ namespace bt void loadFiles(BListNode* node); void loadNodes(BListNode* node); void loadAnnounceList(BNode* node); - bool checkPathForDirectoryTraversal(const QString & p); + bool checkPathForDirectoryTraversal(const TQString & p); private: TrackerTier* trackers; - QString name_suggestion; + TQString name_suggestion; Uint64 piece_length; Uint64 file_length; SHA1Hash info_hash; PeerID peer_id; - QValueVector<SHA1Hash> hash_pieces; - QValueVector<TorrentFile> files; - QValueVector<kt::DHTNode> nodes; - QString encoding; + TQValueVector<SHA1Hash> hash_pieces; + TQValueVector<TorrentFile> files; + TQValueVector<kt::DHTNode> nodes; + TQString encoding; bool priv_torrent; }; diff --git a/libktorrent/torrent/torrentcontrol.cpp b/libktorrent/torrent/torrentcontrol.cpp index 71b4e64..ba51092 100644 --- a/libktorrent/torrent/torrentcontrol.cpp +++ b/libktorrent/torrent/torrentcontrol.cpp @@ -18,12 +18,12 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <klocale.h> #include <kmessagebox.h> #include <kfiledialog.h> -#include <qtextstream.h> +#include <tqtextstream.h> #include <util/log.h> #include <util/error.h> #include <util/bitset.h> @@ -90,7 +90,7 @@ namespace bt stats.session_bytes_downloaded = 0; stats.session_bytes_uploaded = 0; istats.session_bytes_uploaded = 0; - old_datadir = QString::null; + old_datadir = TQString(); stats.status = NOT_STARTED; stats.autostart = true; stats.user_controlled = false; @@ -200,7 +200,7 @@ namespace bt if (stats.completed && !comp) { pman->killSeeders(); - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); istats.running_time_dl += istats.time_started_dl.secsTo(now); updateStatusMsg(); updateStats(); @@ -228,7 +228,7 @@ namespace bt else psman->manualUpdate(); istats.last_announce = bt::GetCurrentTime(); - istats.time_started_dl = QDateTime::currentDateTime(); + istats.time_started_dl = TQDateTime::tqcurrentDateTime(); } updateStatusMsg(); @@ -296,7 +296,7 @@ namespace bt //Move completed files if needed: if (moveCompleted) { - QString outdir = Settings::completedDir(); + TQString outdir = Settings::completedDir(); if(!outdir.endsWith(bt::DirSeparator())) outdir += bt::DirSeparator(); @@ -309,7 +309,7 @@ namespace bt } } - void TorrentControl::onIOError(const QString & msg) + void TorrentControl::onIOError(const TQString & msg) { Out(SYS_DIO|LOG_IMPORTANT) << "Error : " << msg << endl; stats.stopped_by_error = true; @@ -351,7 +351,7 @@ namespace bt throw; } - istats.time_started_ul = istats.time_started_dl = QDateTime::currentDateTime(); + istats.time_started_ul = istats.time_started_dl = TQDateTime::tqcurrentDateTime(); resetTrackerStats(); if (prealloc) @@ -408,7 +408,7 @@ namespace bt void TorrentControl::stop(bool user,WaitJob* wjob) { - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); if(!stats.completed) istats.running_time_dl += istats.time_started_dl.secsTo(now); istats.running_time_ul += istats.time_started_ul.secsTo(now); @@ -490,10 +490,10 @@ namespace bt void TorrentControl::init(QueueManager* qman, - const QString & torrent, - const QString & tmpdir, - const QString & ddir, - const QString & default_save_dir) + const TQString & torrent, + const TQString & tmpdir, + const TQString & ddir, + const TQString & default_save_dir) { // first load the torrent file tor = new Torrent(); @@ -506,13 +506,13 @@ namespace bt delete tor; tor = 0; throw Error(i18n("An error occurred while loading the torrent." - " The torrent is probably corrupt or is not a torrent file.\n%1").arg(torrent)); + " The torrent is probably corrupt or is not a torrent file.\n%1").tqarg(torrent)); } initInternal(qman,tmpdir,ddir,default_save_dir,torrent.startsWith(tmpdir)); // copy torrent in tor dir - QString tor_copy = datadir + "torrent"; + TQString tor_copy = datadir + "torrent"; if (tor_copy != torrent) { bt::CopyFile(torrent,tor_copy); @@ -521,8 +521,8 @@ namespace bt } - void TorrentControl::init(QueueManager* qman, const QByteArray & data,const QString & tmpdir, - const QString & ddir,const QString & default_save_dir) + void TorrentControl::init(QueueManager* qman, const TQByteArray & data,const TQString & tmpdir, + const TQString & ddir,const TQString & default_save_dir) { // first load the torrent file tor = new Torrent(); @@ -540,11 +540,11 @@ namespace bt initInternal(qman,tmpdir,ddir,default_save_dir,true); // copy data into torrent file - QString tor_copy = datadir + "torrent"; - QFile fptr(tor_copy); + TQString tor_copy = datadir + "torrent"; + TQFile fptr(tor_copy); if (!fptr.open(IO_WriteOnly)) throw Error(i18n("Unable to create %1 : %2") - .arg(tor_copy).arg(fptr.errorString())); + .tqarg(tor_copy).tqarg(fptr.errorString())); fptr.writeBlock(data.data(),data.size()); } @@ -559,17 +559,17 @@ namespace bt { qman->mergeAnnounceList(tor->getInfoHash(),tor->getTrackerList()); - throw Error(i18n("You are already downloading this torrent %1, the list of trackers of both torrents has been merged.").arg(tor->getNameSuggestion())); + throw Error(i18n("You are already downloading this torrent %1, the list of trackers of both torrents has been merged.").tqarg(tor->getNameSuggestion())); } else { throw Error(i18n("You are already downloading the torrent %1") - .arg(tor->getNameSuggestion())); + .tqarg(tor->getNameSuggestion())); } } } - void TorrentControl::setupDirs(const QString & tmpdir,const QString & ddir) + void TorrentControl::setupDirs(const TQString & tmpdir,const TQString & ddir) { datadir = tmpdir; @@ -607,14 +607,14 @@ namespace bt loadOutputDir(); } - void TorrentControl::setupData(const QString & ddir) + void TorrentControl::setupData(const TQString & ddir) { // create PeerManager and Tracker pman = new PeerManager(*tor); //Out() << "Tracker url " << url << " " << url.protocol() << " " << url.prettyURL() << endl; psman = new PeerSourceManager(this,pman); - connect(psman,SIGNAL(statusChanged( const QString& )), - this,SLOT(trackerStatusChanged( const QString& ))); + connect(psman,TQT_SIGNAL(statusChanged( const TQString& )), + this,TQT_SLOT(trackerStatusChanged( const TQString& ))); // Create chunkmanager, load the index file if it exists @@ -626,7 +626,7 @@ namespace bt // store the outputdir into the output_path variable, so others can access it - connect(cman,SIGNAL(updateStats()),this,SLOT(updateStats())); + connect(cman,TQT_SIGNAL(updateStats()),this,TQT_SLOT(updateStats())); if (bt::Exists(datadir + "index")) cman->loadIndexFile(); @@ -634,23 +634,23 @@ namespace bt // create downloader,uploader and choker down = new Downloader(*tor,*pman,*cman); - connect(down,SIGNAL(ioError(const QString& )), - this,SLOT(onIOError(const QString& ))); + connect(down,TQT_SIGNAL(ioError(const TQString& )), + this,TQT_SLOT(onIOError(const TQString& ))); up = new Uploader(*cman,*pman); choke = new Choker(*pman,*cman); - connect(pman,SIGNAL(newPeer(Peer* )),this,SLOT(onNewPeer(Peer* ))); - connect(pman,SIGNAL(peerKilled(Peer* )),this,SLOT(onPeerRemoved(Peer* ))); - connect(cman,SIGNAL(excluded(Uint32, Uint32 )),down,SLOT(onExcluded(Uint32, Uint32 ))); - connect(cman,SIGNAL(included( Uint32, Uint32 )),down,SLOT(onIncluded( Uint32, Uint32 ))); - connect(cman,SIGNAL(corrupted( Uint32 )),this,SLOT(corrupted( Uint32 ))); + connect(pman,TQT_SIGNAL(newPeer(Peer* )),this,TQT_SLOT(onNewPeer(Peer* ))); + connect(pman,TQT_SIGNAL(peerKilled(Peer* )),this,TQT_SLOT(onPeerRemoved(Peer* ))); + connect(cman,TQT_SIGNAL(excluded(Uint32, Uint32 )),down,TQT_SLOT(onExcluded(Uint32, Uint32 ))); + connect(cman,TQT_SIGNAL(included( Uint32, Uint32 )),down,TQT_SLOT(onIncluded( Uint32, Uint32 ))); + connect(cman,TQT_SIGNAL(corrupted( Uint32 )),this,TQT_SLOT(corrupted( Uint32 ))); } void TorrentControl::initInternal(QueueManager* qman, - const QString & tmpdir, - const QString & ddir, - const QString & default_save_dir, + const TQString & tmpdir, + const TQString & ddir, + const TQString & default_save_dir, bool first_time) { checkExisting(qman); @@ -670,7 +670,7 @@ namespace bt throw Error( i18n("Cannot migrate %1 : %2") - .arg(tor->getNameSuggestion()).arg(err.toString())); + .tqarg(tor->getNameSuggestion()).tqarg(err.toString())); } } setupData(ddir); @@ -731,8 +731,8 @@ namespace bt void TorrentControl::onNewPeer(Peer* p) { - connect(p,SIGNAL(gotPortPacket( const QString&, Uint16 )), - this,SLOT(onPortPacket( const QString&, Uint16 ))); + connect(p,TQT_SIGNAL(gotPortPacket( const TQString&, Uint16 )), + this,TQT_SLOT(onPortPacket( const TQString&, Uint16 ))); if (p->getStats().fast_extensions) { @@ -772,8 +772,8 @@ namespace bt void TorrentControl::onPeerRemoved(Peer* p) { - disconnect(p,SIGNAL(gotPortPacket( const QString&, Uint16 )), - this,SLOT(onPortPacket( const QString&, Uint16 ))); + disconnect(p,TQT_SIGNAL(gotPortPacket( const TQString&, Uint16 )), + this,TQT_SLOT(onPortPacket( const TQString&, Uint16 ))); if (tmon) tmon->peerRemoved(p); } @@ -783,16 +783,16 @@ namespace bt choke->update(stats.completed,stats); } - bool TorrentControl::changeDataDir(const QString & new_dir) + bool TorrentControl::changeDataDir(const TQString & new_dir) { - int pos = datadir.findRev(bt::DirSeparator(),-2); + int pos = datadir.tqfindRev(bt::DirSeparator(),-2); if (pos == -1) { Out(SYS_GEN|LOG_DEBUG) << "Could not find torX part in " << datadir << endl; return false; } - QString ndatadir = new_dir + datadir.mid(pos + 1); + TQString ndatadir = new_dir + datadir.mid(pos + 1); Out(SYS_GEN|LOG_DEBUG) << datadir << " -> " << ndatadir << endl; try @@ -811,7 +811,7 @@ namespace bt return true; } - bool TorrentControl::changeOutputDir(const QString & new_dir, bool moveFiles) + bool TorrentControl::changeOutputDir(const TQString & new_dir, bool moveFiles) { if (moving_files) return false; @@ -830,10 +830,10 @@ namespace bt moving_files = true; try { - QString nd; + TQString nd; if (istats.custom_output_name) { - int slash_pos = stats.output_path.findRev(bt::DirSeparator(),-2); + int slash_pos = stats.output_path.tqfindRev(bt::DirSeparator(),-2); nd = new_dir + stats.output_path.mid(slash_pos + 1); } else @@ -855,7 +855,7 @@ namespace bt move_data_files_destination_path = nd; if (j) { - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(moveDataFilesJobDone(KIO::Job*))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveDataFilesJobDone(KIO::Job*))); return true; } else @@ -932,7 +932,7 @@ namespace bt else if (!stats.started) stats.status = kt::NOT_STARTED; else if(!stats.running && !stats.user_controlled) - stats.status = kt::QUEUED; + stats.status = kt::TQUEUED; else if (!stats.running && stats.completed && (overMaxRatio() || overMaxSeedTime())) stats.status = kt::SEEDING_COMPLETE; else if (!stats.running && stats.completed) @@ -988,26 +988,26 @@ namespace bt if (cman->getDataDir() != outputdir) outputdir = cman->getDataDir(); - st.write("UPLOADED", QString::number(up->bytesUploaded())); + st.write("UPLOADED", TQString::number(up->bytesUploaded())); if (stats.running) { - QDateTime now = QDateTime::currentDateTime(); - st.write("RUNNING_TIME_DL",QString("%1").arg(istats.running_time_dl + istats.time_started_dl.secsTo(now))); - st.write("RUNNING_TIME_UL",QString("%1").arg(istats.running_time_ul + istats.time_started_ul.secsTo(now))); + TQDateTime now = TQDateTime::tqcurrentDateTime(); + st.write("RUNNING_TIME_DL",TQString("%1").tqarg(istats.running_time_dl + istats.time_started_dl.secsTo(now))); + st.write("RUNNING_TIME_UL",TQString("%1").tqarg(istats.running_time_ul + istats.time_started_ul.secsTo(now))); } else { - st.write("RUNNING_TIME_DL", QString("%1").arg(istats.running_time_dl)); - st.write("RUNNING_TIME_UL", QString("%1").arg(istats.running_time_ul)); + st.write("RUNNING_TIME_DL", TQString("%1").tqarg(istats.running_time_dl)); + st.write("RUNNING_TIME_UL", TQString("%1").tqarg(istats.running_time_ul)); } - st.write("PRIORITY", QString("%1").arg(istats.priority)); - st.write("AUTOSTART", QString("%1").arg(stats.autostart)); - st.write("IMPORTED", QString("%1").arg(stats.imported_bytes)); + st.write("PRIORITY", TQString("%1").tqarg(istats.priority)); + st.write("AUTOSTART", TQString("%1").tqarg(stats.autostart)); + st.write("IMPORTED", TQString("%1").tqarg(stats.imported_bytes)); st.write("CUSTOM_OUTPUT_NAME",istats.custom_output_name ? "1" : "0"); - st.write("MAX_RATIO", QString("%1").arg(stats.max_share_ratio,0,'f',2)); - st.write("MAX_SEED_TIME",QString::number(stats.max_seed_time)); + st.write("MAX_RATIO", TQString("%1").tqarg(stats.max_share_ratio,0,'f',2)); + st.write("MAX_SEED_TIME",TQString::number(stats.max_seed_time)); st.write("RESTART_DISK_PREALLOCATION",prealloc ? "1" : "0"); if(!stats.priv_torrent) @@ -1017,8 +1017,8 @@ namespace bt st.write("UT_PEX", isFeatureEnabled(kt::UT_PEX_FEATURE) ? "1" : "0"); } - st.write("UPLOAD_LIMIT",QString::number(upload_limit)); - st.write("DOWNLOAD_LIMIT",QString::number(download_limit)); + st.write("UPLOAD_LIMIT",TQString::number(upload_limit)); + st.write("DOWNLOAD_LIMIT",TQString::number(download_limit)); st.writeSync(); } @@ -1222,7 +1222,7 @@ namespace bt if (!stats.running || stats.completed) return istats.running_time_dl; else - return istats.running_time_dl + istats.time_started_dl.secsTo(QDateTime::currentDateTime()); + return istats.running_time_dl + istats.time_started_dl.secsTo(TQDateTime::tqcurrentDateTime()); } Uint32 TorrentControl::getRunningTimeUL() const @@ -1230,7 +1230,7 @@ namespace bt if (!stats.running) return istats.running_time_ul; else - return istats.running_time_ul + istats.time_started_ul.secsTo(QDateTime::currentDateTime()); + return istats.running_time_ul + istats.time_started_ul.secsTo(TQDateTime::tqcurrentDateTime()); } Uint32 TorrentControl::getNumFiles() const @@ -1249,16 +1249,16 @@ namespace bt return TorrentFile::null; } - void TorrentControl::migrateTorrent(const QString & default_save_dir) + void TorrentControl::migrateTorrent(const TQString & default_save_dir) { if (bt::Exists(datadir + "current_chunks") && bt::IsPreMMap(datadir + "current_chunks")) { // in case of error copy torX dir to migrate-failed-tor - QString dd = datadir; - int pos = dd.findRev("tor"); + TQString dd = datadir; + int pos = dd.tqfindRev("tor"); if (pos != - 1) { - dd = dd.replace(pos,3,"migrate-failed-tor"); + dd = dd.tqreplace(pos,3,"migrate-failed-tor"); Out() << "Copying " << datadir << " to " << dd << endl; bt::CopyDir(datadir,dd,true); } @@ -1274,10 +1274,10 @@ namespace bt " To make sure this torrent still works with this version of KTorrent, " "we will migrate this torrent. You will be asked for a location to save " "the torrent to. If you press cancel, we will select your home directory.") - .arg(tor->getNameSuggestion())); - outputdir = KFileDialog::getExistingDirectory(QString::null, 0,i18n("Select Folder to Save To")); + .tqarg(tor->getNameSuggestion())); + outputdir = KFileDialog::getExistingDirectory(TQString(), 0,i18n("Select Folder to Save To")); if (outputdir.isNull()) - outputdir = QDir::homeDirPath(); + outputdir = TQDir::homeDirPath(); } else { @@ -1301,7 +1301,7 @@ namespace bt istats.priority = p; stats.user_controlled = p == 0 ? true : false; if(p) - stats.status = kt::QUEUED; + stats.status = kt::TQUEUED; else updateStatusMsg(); @@ -1356,7 +1356,7 @@ namespace bt } - QString TorrentControl::statusToString() const + TQString TorrentControl::statusToString() const { switch (stats.status) { @@ -1378,14 +1378,14 @@ namespace bt return i18n("Error: ") + getShortErrorMessage(); case kt::ALLOCATING_DISKSPACE: return i18n("Allocating diskspace"); - case kt::QUEUED: + case kt::TQUEUED: return i18n("Queued"); case kt::CHECKING_DATA: return i18n("Checking data"); case kt::NO_SPACE_LEFT: return i18n("Stopped. No space left on device."); } - return QString::null; + return TQString(); } TrackersList* TorrentControl::getTrackersList() @@ -1398,7 +1398,7 @@ namespace bt return psman; } - void TorrentControl::onPortPacket(const QString & ip,Uint16 port) + void TorrentControl::onPortPacket(const TQString & ip,Uint16 port) { if (Globals::instance().getDHT().isRunning() && !stats.priv_torrent) Globals::instance().getDHT().portRecieved(ip,port); @@ -1489,7 +1489,7 @@ namespace bt return cman->hasExistingFiles(); } - bool TorrentControl::hasMissingFiles(QStringList & sl) + bool TorrentControl::hasMissingFiles(TQStringList & sl) { return cman->hasMissingFiles(sl); } @@ -1525,7 +1525,7 @@ namespace bt } } - void TorrentControl::handleError(const QString & err) + void TorrentControl::handleError(const TQString & err) { onIOError(err); } @@ -1558,7 +1558,7 @@ namespace bt stats.trk_bytes_uploaded = 0; } - void TorrentControl::trackerStatusChanged(const QString & ns) + void TorrentControl::trackerStatusChanged(const TQString & ns) { stats.trackerstatus = ns; } diff --git a/libktorrent/torrent/torrentcontrol.h b/libktorrent/torrent/torrentcontrol.h index 33610de..c017728 100644 --- a/libktorrent/torrent/torrentcontrol.h +++ b/libktorrent/torrent/torrentcontrol.h @@ -21,9 +21,9 @@ #ifndef BTTORRENTCONTROL_H #define BTTORRENTCONTROL_H -#include <qobject.h> -#include <qcstring.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqcstring.h> +#include <tqtimer.h> #include <kurl.h> #include "globals.h" #include <util/timer.h> @@ -31,8 +31,8 @@ #include <interfaces/monitorinterface.h> #include <interfaces/trackerslist.h> -class QStringList; -class QString; +class TQStringList; +class TQString; namespace KIO { @@ -68,6 +68,7 @@ namespace bt class TorrentControl : public kt::TorrentInterface { Q_OBJECT + TQ_OBJECT public: TorrentControl(); virtual ~TorrentControl(); @@ -103,10 +104,10 @@ namespace bt * @throw Error when something goes wrong */ void init(QueueManager* qman, - const QString & torrent, - const QString & tmpdir, - const QString & datadir, - const QString & default_save_dir); + const TQString & torrent, + const TQString & tmpdir, + const TQString & datadir, + const TQString & default_save_dir); /** * Initialize the TorrentControl. @@ -119,10 +120,10 @@ namespace bt * @throw Error when something goes wrong */ void init(QueueManager* qman, - const QByteArray & data, - const QString & tmpdir, - const QString & datadir, - const QString & default_save_dir); + const TQByteArray & data, + const TQString & tmpdir, + const TQString & datadir, + const TQString & default_save_dir); /** * Change to a new data dir. If this fails @@ -130,7 +131,7 @@ namespace bt * @param new_dir The new directory * @return true upon succes */ - bool changeDataDir(const QString & new_dir); + bool changeDataDir(const TQString & new_dir); /** @@ -139,7 +140,7 @@ namespace bt * @param moveFiles Wheather to actually move the files or just change the directory without moving them. * @return true upon success. */ - bool changeOutputDir(const QString& new_dir, bool moveFiles = true); + bool changeOutputDir(const TQString& new_dir, bool moveFiles = true); /** * Roll back the previous changeDataDir call. @@ -154,10 +155,10 @@ namespace bt const kt::TrackersList* getTrackersList() const; /// Get the data directory of this torrent - QString getDataDir() const {return outputdir;} + TQString getDataDir() const {return outputdir;} /// Get the torX dir. - QString getTorDir() const {return datadir;} + TQString getTorDir() const {return datadir;} /// Set the monitor void setMonitor(kt::MonitorInterface* tmo); @@ -189,7 +190,7 @@ namespace bt Uint32 getTimeToNextTrackerUpdate() const; /// Get a short error message - QString getShortErrorMessage() const {return error_msg;} + TQString getShortErrorMessage() const {return error_msg;} virtual Uint32 getNumFiles() const; virtual kt::TorrentFileInterface & getTorrentFile(Uint32 index); @@ -213,7 +214,7 @@ namespace bt void setPreallocateDiskSpace(bool pa) {prealloc = pa;} /// Make a string out of the status message - virtual QString statusToString() const; + virtual TQString statusToString() const; /// Checks if tracker announce is allowed (minimum interval 60 seconds) bool announceAllowed(); @@ -227,7 +228,7 @@ namespace bt * Test all files and see if they are not missing. * If so put them in a list */ - bool hasMissingFiles(QStringList & sl); + bool hasMissingFiles(TQStringList & sl); virtual Uint32 getNumDHTNodes() const; @@ -296,38 +297,38 @@ namespace bt * The tracker status has changed. * @param ns New status */ - void trackerStatusChanged(const QString & ns); + void trackerStatusChanged(const TQString & ns); private slots: void onNewPeer(Peer* p); void onPeerRemoved(Peer* p); void doChoking(); - void onIOError(const QString & msg); - void onPortPacket(const QString & ip,Uint16 port); + void onIOError(const TQString & msg); + void onPortPacket(const TQString & ip,Uint16 port); /// Update the stats of the torrent. void updateStats(); void corrupted(Uint32 chunk); void moveDataFilesJobDone(KIO::Job* job); private: - void updateTracker(const QString & ev,bool last_succes = true); + void updateTracker(const TQString & ev,bool last_succes = true); void updateStatusMsg(); void saveStats(); void loadStats(); void loadOutputDir(); void getSeederInfo(Uint32 & total,Uint32 & connected_to) const; void getLeecherInfo(Uint32 & total,Uint32 & connected_to) const; - void migrateTorrent(const QString & default_save_dir); + void migrateTorrent(const TQString & default_save_dir); void continueStart(); - virtual void handleError(const QString & err); + virtual void handleError(const TQString & err); - void initInternal(QueueManager* qman,const QString & tmpdir, - const QString & ddir,const QString & default_save_dir,bool first_time); + void initInternal(QueueManager* qman,const TQString & tmpdir, + const TQString & ddir,const TQString & default_save_dir,bool first_time); void checkExisting(QueueManager* qman); - void setupDirs(const QString & tmpdir,const QString & ddir); + void setupDirs(const TQString & tmpdir,const TQString & ddir); void setupStats(); - void setupData(const QString & ddir); + void setupData(const TQString & ddir); virtual void afterDataCheck(); virtual bool isCheckingData(bool & finished) const; @@ -346,12 +347,12 @@ namespace bt Timer stats_save_timer; Timer stalled_timer; - QString datadir; - QString old_datadir; - QString outputdir; - QString error_msg; + TQString datadir; + TQString old_datadir; + TQString outputdir; + TQString error_msg; - QString move_data_files_destination_path; + TQString move_data_files_destination_path; bool restart_torrent_after_move_data_files; bool prealloc; @@ -362,8 +363,8 @@ namespace bt struct InternalStats { - QDateTime time_started_dl; - QDateTime time_started_ul; + TQDateTime time_started_dl; + TQDateTime time_started_ul; Uint32 running_time_dl; Uint32 running_time_ul; Uint64 prev_bytes_dl; diff --git a/libktorrent/torrent/torrentcreator.cpp b/libktorrent/torrent/torrentcreator.cpp index 7b132b8..6ccbd63 100644 --- a/libktorrent/torrent/torrentcreator.cpp +++ b/libktorrent/torrent/torrentcreator.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #include <klocale.h> #include <time.h> #include <util/error.h> @@ -39,16 +39,16 @@ namespace bt { - TorrentCreator::TorrentCreator(const QString & tar, - const QStringList & track, + TorrentCreator::TorrentCreator(const TQString & tar, + const TQStringList & track, Uint32 cs, - const QString & name, - const QString & comments,bool priv, bool decentralized) + const TQString & name, + const TQString & comments,bool priv, bool decentralized) : target(tar),trackers(track),chunk_size(cs), name(name),comments(comments),cur_chunk(0),priv(priv),tot_size(0), decentralized(decentralized) { this->chunk_size *= 1024; - QFileInfo fi(target); + TQFileInfo fi(target); if (fi.isDir()) { if (!this->target.endsWith(bt::DirSeparator())) @@ -84,13 +84,13 @@ namespace bt TorrentCreator::~TorrentCreator() {} - void TorrentCreator::buildFileList(const QString & dir) + void TorrentCreator::buildFileList(const TQString & dir) { - QDir d(target + dir); + TQDir d(target + dir); // first get all files (we ignore symlinks) - QStringList dfiles = d.entryList(QDir::Files|QDir::NoSymLinks); + TQStringList dfiles = d.entryList(TQDir::Files|TQDir::NoSymLinks); Uint32 cnt = 0; // counter to keep track of file index - for (QStringList::iterator i = dfiles.begin();i != dfiles.end();++i) + for (TQStringList::iterator i = dfiles.begin();i != dfiles.end();++i) { // add a TorrentFile to the list Uint64 fs = bt::FileSize(target + dir + *i); @@ -102,13 +102,13 @@ namespace bt } // now for each subdir do a buildFileList - QStringList subdirs = d.entryList(QDir::Dirs|QDir::NoSymLinks); - for (QStringList::iterator i = subdirs.begin();i != subdirs.end();++i) + TQStringList subdirs = d.entryList(TQDir::Dirs|TQDir::NoSymLinks); + for (TQStringList::iterator i = subdirs.begin();i != subdirs.end();++i) { if (*i == "." || *i == "..") continue; - QString sd = dir + *i; + TQString sd = dir + *i; if (!sd.endsWith(bt::DirSeparator())) sd += bt::DirSeparator(); buildFileList(sd); @@ -116,21 +116,21 @@ namespace bt } - void TorrentCreator::saveTorrent(const QString & url) + void TorrentCreator::saveTorrent(const TQString & url) { File fptr; if (!fptr.open(url,"wb")) - throw Error(i18n("Cannot open file %1: %2").arg(url).arg(fptr.errorString())); + throw Error(i18n("Cannot open file %1: %2").tqarg(url).tqarg(fptr.errorString())); BEncoder enc(&fptr); enc.beginDict(); // top dict if(!decentralized) { - enc.write("announce"); enc.write(trackers[0]); + enc.write(TQString("announce")); enc.write(trackers[0]); if (trackers.count() > 1) { - enc.write("announce-list"); + enc.write(TQString("announce-list")); enc.beginList(); enc.beginList(); for (Uint32 i = 0;i < trackers.count();i++) @@ -144,23 +144,23 @@ namespace bt if (comments.length() > 0) { - enc.write("comments"); + enc.write(TQString("comments")); enc.write(comments); } - enc.write("created by");enc.write(QString("KTorrent %1").arg(kt::VERSION_STRING)); - enc.write("creation date");enc.write((Uint64)time(0)); - enc.write("info"); + enc.write(TQString("created by"));enc.write(TQString("KTorrent %1").tqarg(kt::VERSION_STRING)); + enc.write(TQString("creation date"));enc.write((Uint64)time(0)); + enc.write(TQString("info")); saveInfo(enc); // save the nodes list after the info hash, keys must be sorted ! if (decentralized) { //DHT torrent - enc.write("nodes"); + enc.write(TQString("nodes")); enc.beginList(); for(int i=0; i < trackers.count(); ++i) { - QString t = trackers[i]; + TQString t = trackers[i]; enc.beginList(); enc.write(t.section(',',0,0)); enc.write((Uint32)t.section(',',1,1).toInt()); @@ -176,12 +176,12 @@ namespace bt { enc.beginDict(); - QFileInfo fi(target); + TQFileInfo fi(target); if (fi.isDir()) { - enc.write("files"); + enc.write(TQString("files")); enc.beginList(); - QValueList<TorrentFile>::iterator i = files.begin(); + TQValueList<TorrentFile>::iterator i = files.begin(); while (i != files.end()) { saveFile(enc,*i); @@ -191,14 +191,14 @@ namespace bt } else { - enc.write("length"); enc.write(bt::FileSize(target)); + enc.write(TQString("length")); enc.write(bt::FileSize(target)); } - enc.write("name"); enc.write(name); - enc.write("piece length"); enc.write((Uint64)chunk_size); - enc.write("pieces"); savePieces(enc); + enc.write(TQString("name")); enc.write(name); + enc.write(TQString("piece length")); enc.write((Uint64)chunk_size); + enc.write(TQString("pieces")); savePieces(enc); if (priv) { - enc.write("private"); + enc.write(TQString("private")); enc.write((Uint64)1); } enc.end(); @@ -207,11 +207,11 @@ namespace bt void TorrentCreator::saveFile(BEncoder & enc,const TorrentFile & file) { enc.beginDict(); - enc.write("length");enc.write(file.getSize()); - enc.write("path"); + enc.write(TQString("length"));enc.write(file.getSize()); + enc.write(TQString("path")); enc.beginList(); - QStringList sl = QStringList::split(bt::DirSeparator(),file.getPath()); - for (QStringList::iterator i = sl.begin();i != sl.end();i++) + TQStringList sl = TQStringList::split(bt::DirSeparator(),file.getPath()); + for (TQStringList::iterator i = sl.begin();i != sl.end();i++) enc.write(*i); enc.end(); enc.end(); @@ -237,7 +237,7 @@ namespace bt File fptr; if (!fptr.open(target,"rb")) throw Error(i18n("Cannot open file %1: %2") - .arg(target).arg(fptr.errorString())); + .tqarg(target).tqarg(fptr.errorString())); Uint32 s = cur_chunk != num_chunks - 1 ? chunk_size : last_size; fptr.seek(File::BEGIN,(Int64)cur_chunk*chunk_size); @@ -254,7 +254,7 @@ namespace bt Uint32 s = cur_chunk != num_chunks - 1 ? chunk_size : last_size; // first find the file(s) the chunk lies in Array<Uint8> buf(s); - QValueList<TorrentFile> file_list; + TQValueList<TorrentFile> file_list; Uint32 i = 0; while (i < files.size()) { @@ -275,7 +275,7 @@ namespace bt if (!fptr.open(target + f.getPath(),"rb")) { throw Error(i18n("Cannot open file %1: %2") - .arg(f.getPath()).arg(fptr.errorString())); + .tqarg(f.getPath()).tqarg(fptr.errorString())); } // first calculate offset into file @@ -321,9 +321,9 @@ namespace bt return calcHashMulti(); } - TorrentControl* TorrentCreator::makeTC(const QString & data_dir) + TorrentControl* TorrentCreator::makeTC(const TQString & data_dir) { - QString dd = data_dir; + TQString dd = data_dir; if (!dd.endsWith(bt::DirSeparator())) dd += bt::DirSeparator(); @@ -336,7 +336,7 @@ namespace bt // write full index file File fptr; if (!fptr.open(dd + "index","wb")) - throw Error(i18n("Cannot create index file: %1").arg(fptr.errorString())); + throw Error(i18n("Cannot create index file: %1").tqarg(fptr.errorString())); for (Uint32 i = 0;i < num_chunks;i++) { @@ -350,10 +350,10 @@ namespace bt TorrentControl* tc = new TorrentControl(); try { - // get the parent dir of target - QFileInfo fi = QFileInfo(target); + // get the tqparent dir of target + TQFileInfo fi = TQFileInfo(target); - QString odir; + TQString odir; StatsFile st(dd + "stats"); if (fi.fileName() == name) { @@ -371,10 +371,10 @@ namespace bt st.write("RUNNING_TIME_UL","0"); st.write("PRIORITY", "0"); st.write("AUTOSTART", "1"); - st.write("IMPORTED", QString::number(tot_size)); + st.write("IMPORTED", TQString::number(tot_size)); st.writeSync(); - tc->init(0,dd + "torrent",dd,odir,QString::null); + tc->init(0,dd + "torrent",dd,odir,TQString()); tc->createFiles(); } catch (...) diff --git a/libktorrent/torrent/torrentcreator.h b/libktorrent/torrent/torrentcreator.h index c7057e2..e1e2545 100644 --- a/libktorrent/torrent/torrentcreator.h +++ b/libktorrent/torrent/torrentcreator.h @@ -20,7 +20,7 @@ #ifndef BTTORRENTCREATOR_H #define BTTORRENTCREATOR_H -#include <qstringlist.h> +#include <tqstringlist.h> #include "torrent.h" #include <util/sha1hash.h> @@ -40,15 +40,15 @@ namespace bt class TorrentCreator { // input values - QString target; - QStringList trackers; + TQString target; + TQStringList trackers; int chunk_size; - QString name,comments; + TQString name,comments; // calculated values Uint32 num_chunks; Uint64 last_size; - QValueList<TorrentFile> files; - QValueList<SHA1Hash> hashes; + TQValueList<TorrentFile> files; + TQValueList<SHA1Hash> hashes; // Uint32 cur_chunk; bool priv; @@ -64,9 +64,9 @@ namespace bt * @param comments The comments field of the torrent * @param priv Private torrent or not */ - TorrentCreator(const QString & target,const QStringList & trackers, - Uint32 chunk_size,const QString & name, - const QString & comments,bool priv,bool decentralized); + TorrentCreator(const TQString & target,const TQStringList & trackers, + Uint32 chunk_size,const TQString & name, + const TQString & comments,bool priv,bool decentralized); virtual ~TorrentCreator(); @@ -86,7 +86,7 @@ namespace bt * @param url Filename * @throw Error if something goes wrong */ - void saveTorrent(const QString & url); + void saveTorrent(const TQString & url); /** * Make a TorrentControl object for this torrent. @@ -98,13 +98,13 @@ namespace bt * @throw Error if something goes wrong * @return The newly created object */ - TorrentControl* makeTC(const QString & data_dir); + TorrentControl* makeTC(const TQString & data_dir); private: void saveInfo(BEncoder & enc); void saveFile(BEncoder & enc,const TorrentFile & file); void savePieces(BEncoder & enc); - void buildFileList(const QString & dir); + void buildFileList(const TQString & dir); bool calcHashSingle(); bool calcHashMulti(); }; diff --git a/libktorrent/torrent/torrentfile.cpp b/libktorrent/torrent/torrentfile.cpp index 9c21a4a..106e66f 100644 --- a/libktorrent/torrent/torrentfile.cpp +++ b/libktorrent/torrent/torrentfile.cpp @@ -28,10 +28,10 @@ namespace bt { - TorrentFile::TorrentFile() : TorrentFileInterface(QString::null,0),missing(false),filetype(UNKNOWN) + TorrentFile::TorrentFile() : TorrentFileInterface(TQString(),0),missing(false),filetype(UNKNOWN) {} - TorrentFile::TorrentFile(Uint32 index,const QString & path, + TorrentFile::TorrentFile(Uint32 index,const TQString & path, Uint64 off,Uint64 size,Uint64 chunk_size) : TorrentFileInterface(path,size),index(index),cache_offset(off),missing(false),filetype(UNKNOWN) { @@ -46,7 +46,7 @@ namespace bt } TorrentFile::TorrentFile(const TorrentFile & tf) - : TorrentFileInterface(QString::null,0) + : TorrentFileInterface(TQString(),0) { index = tf.getIndex(); path = tf.getPath(); diff --git a/libktorrent/torrent/torrentfile.h b/libktorrent/torrent/torrentfile.h index 9e0c397..9a1d494 100644 --- a/libktorrent/torrent/torrentfile.h +++ b/libktorrent/torrent/torrentfile.h @@ -21,7 +21,7 @@ #ifndef BTTORRENTFILE_H #define BTTORRENTFILE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> #include <interfaces/torrentfileinterface.h> @@ -38,6 +38,7 @@ namespace bt class TorrentFile : public kt::TorrentFileInterface { Q_OBJECT + TQ_OBJECT Uint32 index; Uint64 cache_offset; @@ -68,7 +69,7 @@ namespace bt * @param size Size of the file * @param chunk_size Size of each chunk */ - TorrentFile(Uint32 index,const QString & path,Uint64 off,Uint64 size,Uint64 chunk_size); + TorrentFile(Uint32 index,const TQString & path,Uint64 off,Uint64 size,Uint64 chunk_size); /** * Copy constructor. diff --git a/libktorrent/torrent/tracker.cpp b/libktorrent/torrent/tracker.cpp index 261169c..4878a16 100644 --- a/libktorrent/torrent/tracker.cpp +++ b/libktorrent/torrent/tracker.cpp @@ -36,8 +36,8 @@ using namespace KNetwork; namespace bt { - static QString custom_ip; - static QString custom_ip_resolved; + static TQString custom_ip; + static TQString custom_ip_resolved; Tracker::Tracker(const KURL & url,kt::TorrentInterface* tor,const PeerID & id,int tier) : url(url),tier(tier),peer_id(id),tor(tor) @@ -54,21 +54,21 @@ namespace bt { } - void Tracker::setCustomIP(const QString & ip) + void Tracker::setCustomIP(const TQString & ip) { if (custom_ip == ip) return; Out(SYS_TRK|LOG_NOTICE) << "Setting custom ip to " << ip << endl; custom_ip = ip; - custom_ip_resolved = QString::null; + custom_ip_resolved = TQString(); if (ip.isNull()) return; - KResolverResults res = KResolver::resolve(ip,QString::null); + KResolverResults res = KResolver::resolve(ip,TQString()); if (res.error() || res.empty()) { - custom_ip = custom_ip_resolved = QString::null; + custom_ip = custom_ip_resolved = TQString(); } else { @@ -77,15 +77,15 @@ namespace bt } } - QString Tracker::getCustomIP() + TQString Tracker::getCustomIP() { return custom_ip_resolved; } void Tracker::timedDelete(int ms) { - QTimer::singleShot(ms,this,SLOT(deleteLater())); - connect(this,SIGNAL(stopDone()),this,SLOT(deleteLater())); + TQTimer::singleShot(ms,this,TQT_SLOT(deleteLater())); + connect(this,TQT_SIGNAL(stopDone()),this,TQT_SLOT(deleteLater())); } } diff --git a/libktorrent/torrent/tracker.h b/libktorrent/torrent/tracker.h index d254b63..a017f9e 100644 --- a/libktorrent/torrent/tracker.h +++ b/libktorrent/torrent/tracker.h @@ -44,6 +44,7 @@ namespace bt class Tracker : public kt::PeerSource { Q_OBJECT + TQ_OBJECT public: Tracker(const KURL & url,kt::TorrentInterface* tor,const PeerID & id,int tier); virtual ~Tracker(); @@ -55,7 +56,7 @@ namespace bt * Set the custom IP * @param str */ - static void setCustomIP(const QString & str); + static void setCustomIP(const TQString & str); /// get the tracker url KURL trackerURL() const {return url;} @@ -97,13 +98,13 @@ namespace bt Uint32 getNumLeechers() const {return leechers;} /// Get the custom ip to use, null if none is set - static QString getCustomIP(); + static TQString getCustomIP(); signals: /** * Emitted when an error happens. * @param failure_reason The reason why we couldn't reach the tracker */ - void requestFailed(const QString & failure_reason); + void requestFailed(const TQString & failure_reason); /** * Emitted when a stop is done. @@ -128,7 +129,7 @@ namespace bt Uint32 interval,seeders,leechers,key; bool started; private: - //static QString custom_ip,custom_ip_resolved; + //static TQString custom_ip,custom_ip_resolved; }; } diff --git a/libktorrent/torrent/udptracker.cpp b/libktorrent/torrent/udptracker.cpp index 2dd4a01..6597349 100644 --- a/libktorrent/torrent/udptracker.cpp +++ b/libktorrent/torrent/udptracker.cpp @@ -51,16 +51,16 @@ namespace bt transaction_id = 0; interval = 0; - connect(&conn_timer,SIGNAL(timeout()),this,SLOT(onConnTimeout())); - connect(socket,SIGNAL(announceRecieved(Int32, const QByteArray &)), - this,SLOT(announceRecieved(Int32, const QByteArray& ))); - connect(socket,SIGNAL(connectRecieved(Int32, Int64 )), - this,SLOT(connectRecieved(Int32, Int64 ))); - connect(socket,SIGNAL(error(Int32, const QString& )), - this,SLOT(onError(Int32, const QString& ))); + connect(&conn_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onConnTimeout())); + connect(socket,TQT_SIGNAL(announceRecieved(Int32, const TQByteArray &)), + this,TQT_SLOT(announceRecieved(Int32, const TQByteArray& ))); + connect(socket,TQT_SIGNAL(connectRecieved(Int32, Int64 )), + this,TQT_SLOT(connectRecieved(Int32, Int64 ))); + connect(socket,TQT_SIGNAL(error(Int32, const TQString& )), + this,TQT_SLOT(onError(Int32, const TQString& ))); - KResolver::resolveAsync(this,SLOT(onResolverResults(KResolverResults )), - url.host(),QString::number(url.port())); + KResolver::resolveAsync(this,TQT_SLOT(onResolverResults(KResolverResults )), + url.host(),TQString::number(url.port())); } @@ -117,7 +117,7 @@ namespace bt sendAnnounce(); } - void UDPTracker::announceRecieved(Int32 tid,const QByteArray & data) + void UDPTracker::announceRecieved(Int32 tid,const TQByteArray & data) { if (tid != transaction_id) return; @@ -143,11 +143,11 @@ namespace bt for (Uint32 i = 20;i < data.size() && j < nip;i+=6,j++) { Uint32 ip = ReadUint32(buf,i); - addPeer(QString("%1.%2.%3.%4") - .arg((ip & (0xFF000000)) >> 24) - .arg((ip & (0x00FF0000)) >> 16) - .arg((ip & (0x0000FF00)) >> 8) - .arg(ip & 0x000000FF), + addPeer(TQString("%1.%2.%3.%4") + .tqarg((ip & (0xFF000000)) >> 24) + .tqarg((ip & (0x00FF0000)) >> 16) + .tqarg((ip & (0x0000FF00)) >> 8) + .tqarg(ip & 0x000000FF), ReadUint16(buf,i+4)); } @@ -168,7 +168,7 @@ namespace bt } } - void UDPTracker::onError(Int32 tid,const QString & error_string) + void UDPTracker::onError(Int32 tid,const TQString & error_string) { if (tid != transaction_id) return; @@ -245,7 +245,7 @@ namespace bt WriteInt64(buf,64,s.bytes_left); WriteInt64(buf,72,s.trk_bytes_uploaded); WriteInt32(buf,80,ev); - QString cip = Tracker::getCustomIP(); + TQString cip = Tracker::getCustomIP(); if (cip.isNull()) { WriteUint32(buf,84,0); diff --git a/libktorrent/torrent/udptracker.h b/libktorrent/torrent/udptracker.h index 5107fb9..24dab97 100644 --- a/libktorrent/torrent/udptracker.h +++ b/libktorrent/torrent/udptracker.h @@ -21,9 +21,9 @@ #define BTUDPTRACKER_H #include <kurl.h> -#include <qvaluelist.h> -#include <qcstring.h> -#include <qtimer.h> +#include <tqvaluelist.h> +#include <tqcstring.h> +#include <tqtimer.h> #include <ksocketaddress.h> #include "tracker.h" #include "globals.h" @@ -62,6 +62,7 @@ namespace bt class UDPTracker : public Tracker { Q_OBJECT + TQ_OBJECT public: UDPTracker(const KURL & url,kt::TorrentInterface* tor,const PeerID & id,int tier); virtual ~UDPTracker(); @@ -76,8 +77,8 @@ namespace bt private slots: void onConnTimeout(); void connectRecieved(Int32 tid,Int64 connection_id); - void announceRecieved(Int32 tid,const QByteArray & buf); - void onError(Int32 tid,const QString & error_string); + void announceRecieved(Int32 tid,const TQByteArray & buf); + void onError(Int32 tid,const TQString & error_string); void onResolverResults(KResolverResults res); private: @@ -93,7 +94,7 @@ namespace bt Uint32 data_read; int n; - QTimer conn_timer; + TQTimer conn_timer; Event event; static UDPTrackerSocket* socket; diff --git a/libktorrent/torrent/udptrackersocket.cpp b/libktorrent/torrent/udptrackersocket.cpp index 43ef2b6..79e9c5c 100644 --- a/libktorrent/torrent/udptrackersocket.cpp +++ b/libktorrent/torrent/udptrackersocket.cpp @@ -42,14 +42,14 @@ namespace bt { sock = new KNetwork::KDatagramSocket(this); sock->setAddressReuseable(true); - connect(sock,SIGNAL(readyRead()),this,SLOT(dataReceived())); + connect(sock,TQT_SIGNAL(readyRead()),this,TQT_SLOT(dataReceived())); int i = 0; if (port == 0) port = 4444; bool bound = false; - while (!(bound = sock->bind(QString::null,QString::number(port + i))) && i < 10) + while (!(bound = sock->bind(TQString(),TQString::number(port + i))) && i < 10) { Out() << "Failed to bind socket to port " << (port+i) << endl; i++; @@ -59,7 +59,7 @@ namespace bt if (!bound) { KMessageBox::error(0, - i18n("Cannot bind to udp port %1 or the 10 following ports.").arg(port)); + i18n("Cannot bind to udp port %1 or the 10 following ports.").tqarg(port)); } else { @@ -99,13 +99,13 @@ namespace bt transactions.remove(tid); } - void UDPTrackerSocket::handleConnect(const QByteArray & data) + void UDPTrackerSocket::handleConnect(const TQByteArray & data) { const Uint8* buf = (const Uint8*)data.data(); // Read the transaction_id and check it Int32 tid = ReadInt32(buf,4); - QMap<Int32,Action>::iterator i = transactions.find(tid); + TQMap<Int32,Action>::iterator i = transactions.tqfind(tid); // if we can't find the transaction, just return if (i == transactions.end()) { @@ -116,7 +116,7 @@ namespace bt if (i.data() != CONNECT) { transactions.erase(i); - error(tid,QString::null); + error(tid,TQString()); return; } @@ -125,13 +125,13 @@ namespace bt connectRecieved(tid,ReadInt64(buf,8)); } - void UDPTrackerSocket::handleAnnounce(const QByteArray & data) + void UDPTrackerSocket::handleAnnounce(const TQByteArray & data) { const Uint8* buf = (const Uint8*)data.data(); // Read the transaction_id and check it Int32 tid = ReadInt32(buf,4); - QMap<Int32,Action>::iterator i = transactions.find(tid); + TQMap<Int32,Action>::iterator i = transactions.tqfind(tid); // if we can't find the transaction, just return if (i == transactions.end()) return; @@ -140,7 +140,7 @@ namespace bt if (i.data() != ANNOUNCE) { transactions.erase(i); - error(tid,QString::null); + error(tid,TQString()); return; } @@ -149,19 +149,19 @@ namespace bt announceRecieved(tid,data); } - void UDPTrackerSocket::handleError(const QByteArray & data) + void UDPTrackerSocket::handleError(const TQByteArray & data) { const Uint8* buf = (const Uint8*)data.data(); // Read the transaction_id and check it Int32 tid = ReadInt32(buf,4); - QMap<Int32,Action>::iterator it = transactions.find(tid); + TQMap<Int32,Action>::iterator it = transactions.tqfind(tid); // if we can't find the transaction, just return if (it == transactions.end()) return; // extract error message transactions.erase(it); - QString msg; + TQString msg; for (Uint32 i = 8;i < data.size();i++) msg += (char)buf[i]; @@ -183,7 +183,7 @@ namespace bt } KDatagramPacket pck = sock->receive(); - const QByteArray & data = pck.data(); + const TQByteArray & data = pck.data(); const Uint8* buf = (const Uint8*)data.data(); Uint32 type = ReadUint32(buf,0); switch (type) @@ -203,7 +203,7 @@ namespace bt Int32 UDPTrackerSocket::newTransactionID() { Int32 transaction_id = rand() * time(0); - while (transactions.contains(transaction_id)) + while (transactions.tqcontains(transaction_id)) transaction_id++; return transaction_id; } diff --git a/libktorrent/torrent/udptrackersocket.h b/libktorrent/torrent/udptrackersocket.h index 1537598..7992cdd 100644 --- a/libktorrent/torrent/udptrackersocket.h +++ b/libktorrent/torrent/udptrackersocket.h @@ -20,9 +20,9 @@ #ifndef BTUDPTRACKERSOCKET_H #define BTUDPTRACKERSOCKET_H -#include <qobject.h> -#include <qmap.h> -#include <qcstring.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqcstring.h> #include <util/constants.h> @@ -51,9 +51,10 @@ namespace bt * * Class which handles communication with one or more UDP trackers. */ - class UDPTrackerSocket : public QObject + class UDPTrackerSocket : public TQObject { Q_OBJECT + TQ_OBJECT public: UDPTrackerSocket(); virtual ~UDPTrackerSocket(); @@ -114,24 +115,24 @@ namespace bt * @param tid The transaction_id * @param buf The data */ - void announceRecieved(Int32 tid,const QByteArray & buf); + void announceRecieved(Int32 tid,const TQByteArray & buf); /** * Signal emitted, when an error occurs during a transaction. * @param tid The transaction_id * @param error_string Potential error string */ - void error(Int32 tid,const QString & error_string); + void error(Int32 tid,const TQString & error_string); private: - void handleConnect(const QByteArray & buf); - void handleAnnounce(const QByteArray & buf); - void handleError(const QByteArray & buf); + void handleConnect(const TQByteArray & buf); + void handleAnnounce(const TQByteArray & buf); + void handleError(const TQByteArray & buf); private: Uint16 udp_port; KNetwork::KDatagramSocket* sock; - QMap<Int32,Action> transactions; + TQMap<Int32,Action> transactions; static Uint16 port; }; } diff --git a/libktorrent/torrent/uploader.h b/libktorrent/torrent/uploader.h index 4370d69..0950780 100644 --- a/libktorrent/torrent/uploader.h +++ b/libktorrent/torrent/uploader.h @@ -20,7 +20,7 @@ #ifndef BTUPLOADER_H #define BTUPLOADER_H -#include <qobject.h> +#include <tqobject.h> #include "globals.h" namespace bt @@ -38,9 +38,10 @@ namespace bt * Class which manages the uploading of data. It has a PeerUploader for * each Peer. */ - class Uploader : public QObject + class Uploader : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Constructor, sets the ChunkManager. diff --git a/libktorrent/torrent/upspeedestimater.cpp b/libktorrent/torrent/upspeedestimater.cpp index 0d6c544..08137f5 100644 --- a/libktorrent/torrent/upspeedestimater.cpp +++ b/libktorrent/torrent/upspeedestimater.cpp @@ -50,7 +50,7 @@ namespace bt void UpSpeedEstimater::bytesWritten(Uint32 bytes) { - QValueList<Entry>::iterator i = outstanding_bytes.begin(); + TQValueList<Entry>::iterator i = outstanding_bytes.begin(); TimeStamp now = GetCurrentTime(); while (bytes > 0 && i != outstanding_bytes.end()) { @@ -84,7 +84,7 @@ namespace bt } } - double UpSpeedEstimater::rate(QValueList<Entry> & el) + double UpSpeedEstimater::rate(TQValueList<Entry> & el) { TimeStamp now = GetCurrentTime(); const Uint32 INTERVAL = 3000; @@ -92,7 +92,7 @@ namespace bt Uint32 tot_bytes = 0; Uint32 oldest_time = now; - QValueList<Entry>::iterator i = el.begin(); + TQValueList<Entry>::iterator i = el.begin(); while (i != el.end()) { Entry & e = *i; diff --git a/libktorrent/torrent/upspeedestimater.h b/libktorrent/torrent/upspeedestimater.h index 6503499..27c0c06 100644 --- a/libktorrent/torrent/upspeedestimater.h +++ b/libktorrent/torrent/upspeedestimater.h @@ -20,7 +20,7 @@ #ifndef BTUPSPEEDESTIMATER_H #define BTUPSPEEDESTIMATER_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/constants.h> namespace bt @@ -68,16 +68,16 @@ namespace bt /// Get the protocol overhead double protocollOverhead() const {return proto_upload_rate;} private: - double rate(QValueList<Entry> & el); + double rate(TQValueList<Entry> & el); private: double upload_rate; double proto_upload_rate; Uint32 accumulated_bytes; - QValueList<Entry> outstanding_bytes; - QValueList<Entry> written_bytes; + TQValueList<Entry> outstanding_bytes; + TQValueList<Entry> written_bytes; #ifdef MEASURE_PROTO_OVERHEAD - QValueList<Entry> proto_bytes; + TQValueList<Entry> proto_bytes; #endif }; diff --git a/libktorrent/torrent/utpex.cpp b/libktorrent/torrent/utpex.cpp index 4933218..68361e0 100644 --- a/libktorrent/torrent/utpex.cpp +++ b/libktorrent/torrent/utpex.cpp @@ -46,7 +46,7 @@ namespace bt if (size <= 2 || packet[1] != 1) return; - QByteArray tmp; + TQByteArray tmp; tmp.setRawData((const char*)packet,size); BNode* node = 0; try @@ -61,7 +61,7 @@ namespace bt BValueNode* val = dict->getValue("added"); if (val) { - QByteArray data = val->data().toByteArray(); + TQByteArray data = val->data().toByteArray(); peer->emitPex(data); } } @@ -111,14 +111,14 @@ namespace bt if (!(peers.size() == 0 && added.size() == 0)) { // encode the whole lot - QByteArray data; + TQByteArray data; BEncoder enc(new BEncoderBufferOutput(data)); enc.beginDict(); - enc.write("added"); + enc.write(TQString("added")); encode(enc,added); - enc.write("added.f"); // no idea what this added.f thing means - enc.write(""); - enc.write("dropped"); + enc.write(TQString("added.f")); // no idea what this added.f thing means + enc.write(TQString("")); + enc.write(TQString("dropped")); encode(enc,peers); enc.end(); @@ -132,7 +132,7 @@ namespace bt { if (ps.size() == 0) { - enc.write(""); + enc.write(TQString("")); return; } diff --git a/libktorrent/torrent/value.cpp b/libktorrent/torrent/value.cpp index df063ab..4d8641c 100644 --- a/libktorrent/torrent/value.cpp +++ b/libktorrent/torrent/value.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "value.h" namespace bt @@ -32,7 +32,7 @@ namespace bt Value::Value(Int64 val) : type(INT64),big_ival(val) {} - Value::Value(const QByteArray & val) : type(STRING),ival(0),strval(val),big_ival(0) + Value::Value(const TQByteArray & val) : type(STRING),ival(0),strval(val),big_ival(0) {} Value::Value(const Value & val) @@ -43,12 +43,12 @@ namespace bt {} - QString Value::toString(const QString & encoding) const + TQString Value::toString(const TQString & encoding) const { if (encoding.isNull() || encoding.isEmpty()) return toString(); - QTextCodec* tc = QTextCodec::codecForName(encoding.ascii()); + TQTextCodec* tc = TQTextCodec::codecForName(encoding.ascii()); if (!tc) return toString(); @@ -80,7 +80,7 @@ namespace bt return *this; } - Value & Value::operator = (const QByteArray & val) + Value & Value::operator = (const TQByteArray & val) { type = STRING; strval = val; diff --git a/libktorrent/torrent/value.h b/libktorrent/torrent/value.h index cd7c879..7926af4 100644 --- a/libktorrent/torrent/value.h +++ b/libktorrent/torrent/value.h @@ -20,7 +20,7 @@ #ifndef BTVALUE_H #define BTVALUE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace bt @@ -41,25 +41,25 @@ namespace bt Value(); Value(int val); Value(Int64 val); - Value(const QByteArray & val); + Value(const TQByteArray & val); Value(const Value & val); ~Value(); Value & operator = (const Value & val); Value & operator = (Int32 val); Value & operator = (Int64 val); - Value & operator = (const QByteArray & val); + Value & operator = (const TQByteArray & val); Type getType() const {return type;} Int32 toInt() const {return ival;} Int64 toInt64() const {return big_ival;} - QString toString() const {return QString(strval);} - QString toString(const QString & encoding) const; - QByteArray toByteArray() const {return strval;} + TQString toString() const {return TQString(strval);} + TQString toString(const TQString & encoding) const; + TQByteArray toByteArray() const {return strval;} private: Type type; Int32 ival; - QByteArray strval; + TQByteArray strval; Int64 big_ival; }; } diff --git a/libktorrent/util/autorotatelogjob.cpp b/libktorrent/util/autorotatelogjob.cpp index c43e304..d3a2d8a 100644 --- a/libktorrent/util/autorotatelogjob.cpp +++ b/libktorrent/util/autorotatelogjob.cpp @@ -26,7 +26,7 @@ namespace bt { - AutoRotateLogJob::AutoRotateLogJob(const QString & file,Log* lg) + AutoRotateLogJob::AutoRotateLogJob(const TQString & file,Log* lg) : KIO::Job(false),file(file),cnt(10),lg(lg) { update(); @@ -46,12 +46,12 @@ namespace bt { while (cnt > 1) { - QString prev = QString("%1-%2.gz").arg(file).arg(cnt - 1); - QString curr = QString("%1-%2.gz").arg(file).arg(cnt); + TQString prev = TQString("%1-%2.gz").tqarg(file).tqarg(cnt - 1); + TQString curr = TQString("%1-%2.gz").tqarg(file).tqarg(cnt); if (bt::Exists(prev)) // if file exists start the move job { KIO::Job* sj = KIO::file_move(KURL::fromPathOrURL(prev),KURL::fromPathOrURL(curr),-1,true,false,false); - connect(sj,SIGNAL(result(KIO::Job*)),this,SLOT(moveJobDone(KIO::Job* ))); + connect(sj,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveJobDone(KIO::Job* ))); return; } else @@ -65,12 +65,12 @@ namespace bt // move current log to 1 and zip it bt::Move(file,file + "-1",true); KIO::Job* sj = KIO::file_move(KURL::fromPathOrURL(file),KURL::fromPathOrURL(file + "-1"),-1,true,false,false); - connect(sj,SIGNAL(result(KIO::Job*)),this,SLOT(moveJobDone(KIO::Job* ))); + connect(sj,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(moveJobDone(KIO::Job* ))); } else { // final log file is moved, now zip it and end the job - std::system(QString("gzip " + KProcess::quote(file + "-1")).local8Bit()); + std::system(TQString("gzip " + KProcess::quote(file + "-1")).local8Bit()); m_error = 0; lg->logRotateDone(); emitResult(); diff --git a/libktorrent/util/autorotatelogjob.h b/libktorrent/util/autorotatelogjob.h index 11cf06a..ae850b3 100644 --- a/libktorrent/util/autorotatelogjob.h +++ b/libktorrent/util/autorotatelogjob.h @@ -36,8 +36,9 @@ namespace bt class AutoRotateLogJob : public KIO::Job { Q_OBJECT + TQ_OBJECT public: - AutoRotateLogJob(const QString & file,Log* lg); + AutoRotateLogJob(const TQString & file,Log* lg); virtual ~AutoRotateLogJob(); virtual void kill(bool quietly=true); @@ -49,7 +50,7 @@ namespace bt void update(); private: - QString file; + TQString file; int cnt; Log* lg; }; diff --git a/libktorrent/util/constants.h b/libktorrent/util/constants.h index e663978..0551f60 100644 --- a/libktorrent/util/constants.h +++ b/libktorrent/util/constants.h @@ -20,19 +20,19 @@ #ifndef BTCONSTANTS_H #define BTCONSTANTS_H -#include <qglobal.h> +#include <tqglobal.h> namespace bt { - typedef Q_UINT64 Uint64; - typedef Q_UINT32 Uint32; - typedef Q_UINT16 Uint16; - typedef Q_UINT8 Uint8; + typedef TQ_UINT64 Uint64; + typedef TQ_UINT32 Uint32; + typedef TQ_UINT16 Uint16; + typedef TQ_UINT8 Uint8; - typedef Q_INT64 Int64; - typedef Q_INT32 Int32; - typedef Q_INT16 Int16; - typedef Q_INT8 Int8; + typedef TQ_INT64 Int64; + typedef TQ_INT32 Int32; + typedef TQ_INT16 Int16; + typedef TQ_INT8 Int8; typedef Uint64 TimeStamp; diff --git a/libktorrent/util/error.cpp b/libktorrent/util/error.cpp index bb981db..dd3e15d 100644 --- a/libktorrent/util/error.cpp +++ b/libktorrent/util/error.cpp @@ -22,7 +22,7 @@ namespace bt { - Error::Error(const QString & msg) : msg(msg) + Error::Error(const TQString & msg) : msg(msg) {} diff --git a/libktorrent/util/error.h b/libktorrent/util/error.h index 8b089e4..49aa95d 100644 --- a/libktorrent/util/error.h +++ b/libktorrent/util/error.h @@ -20,7 +20,7 @@ #ifndef BTERROR_H #define BTERROR_H -#include <qstring.h> +#include <tqstring.h> namespace bt { @@ -30,12 +30,12 @@ namespace bt */ class Error { - QString msg; + TQString msg; public: - Error(const QString & msg); + Error(const TQString & msg); virtual ~Error(); - QString toString() const {return msg;} + TQString toString() const {return msg;} }; diff --git a/libktorrent/util/file.cpp b/libktorrent/util/file.cpp index b898e07..f757142 100644 --- a/libktorrent/util/file.cpp +++ b/libktorrent/util/file.cpp @@ -22,7 +22,7 @@ #include <config.h> #endif -#include <qfile.h> +#include <tqfile.h> #include "config.h" #include <klocale.h> #include <string.h> @@ -45,15 +45,15 @@ namespace bt close(); } - bool File::open(const QString & file,const QString & mode) + bool File::open(const TQString & file,const TQString & mode) { this->file = file; if (fptr) close(); #if HAVE_FOPEN64 - fptr = fopen64(QFile::encodeName(file),mode.ascii()); + fptr = fopen64(TQFile::encodeName(file),mode.ascii()); #else - fptr = fopen(QFile::encodeName(file),mode.ascii()); + fptr = fopen(TQFile::encodeName(file),mode.ascii()); #endif return fptr != 0; } @@ -84,7 +84,7 @@ namespace bt if (errno == ENOSPC) Out() << "Disk full !" << endl; - throw Error(i18n("Cannot write to %1 : %2").arg(file).arg(strerror(errno))); + throw Error(i18n("Cannot write to %1 : %2").tqarg(file).tqarg(strerror(errno))); } return ret; } @@ -98,7 +98,7 @@ namespace bt if (ferror(fptr)) { clearerr(fptr); - throw Error(i18n("Cannot read from %1").arg(file)); + throw Error(i18n("Cannot read from %1").tqarg(file)); } return ret; } @@ -143,8 +143,8 @@ namespace bt return ftello(fptr); } - QString File::errorString() const + TQString File::errorString() const { - return QString(strerror(errno)); + return TQString(strerror(errno)); } } diff --git a/libktorrent/util/file.h b/libktorrent/util/file.h index 323a3a7..c6567f8 100644 --- a/libktorrent/util/file.h +++ b/libktorrent/util/file.h @@ -21,7 +21,7 @@ #define BTFILE_H #include <stdio.h> -#include <qstring.h> +#include <tqstring.h> #include "constants.h" namespace bt @@ -36,7 +36,7 @@ namespace bt class File { FILE* fptr; - QString file; + TQString file; public: /** * Constructor. @@ -54,7 +54,7 @@ namespace bt * @param mode Mode * @return true upon succes */ - bool open(const QString & file,const QString & mode); + bool open(const TQString & file,const TQString & mode); /** * Close the file. @@ -106,7 +106,7 @@ namespace bt Uint64 tell() const; /// Get the error string. - QString errorString() const; + TQString errorString() const; }; } diff --git a/libktorrent/util/fileops.cpp b/libktorrent/util/fileops.cpp index 3fcf03d..a83134a 100644 --- a/libktorrent/util/fileops.cpp +++ b/libktorrent/util/fileops.cpp @@ -30,9 +30,9 @@ #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> -#include <qdir.h> -#include <qfile.h> -#include <qstringlist.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqstringlist.h> #include "fileops.h" #include "error.h" #include "log.h" @@ -70,88 +70,88 @@ typedef int64_t __s64; namespace bt { - void MakeDir(const QString & dir,bool nothrow) + void MakeDir(const TQString & dir,bool nothrow) { - if (mkdir(QFile::encodeName(dir),0777) < -1) + if (mkdir(TQFile::encodeName(dir),0777) < -1) { if (!nothrow) throw Error(i18n("Cannot create directory %1: %2") - .arg(dir).arg(strerror(errno))); + .tqarg(dir).tqarg(strerror(errno))); else { - Out() << QString("Error : Cannot create directory %1 : %2").arg(dir).arg(strerror(errno))<< endl; + Out() << TQString("Error : Cannot create directory %1 : %2").tqarg(dir).tqarg(strerror(errno))<< endl; } } } - void SymLink(const QString & link_to,const QString & link_url,bool nothrow) + void SymLink(const TQString & link_to,const TQString & link_url,bool nothrow) { - if (symlink(QFile::encodeName(link_to),QFile::encodeName(link_url)) != 0) + if (symlink(TQFile::encodeName(link_to),TQFile::encodeName(link_url)) != 0) { if (!nothrow) throw Error(i18n("Cannot symlink %1 to %2: %3") - .arg(link_url.utf8()).arg(link_to.utf8()) - .arg(strerror(errno))); + .tqarg(link_url.utf8().data()).tqarg(link_to.utf8().data()) + .tqarg(strerror(errno))); else - Out() << QString("Error : Cannot symlink %1 to %2: %3") - .arg(link_url.utf8()).arg(link_to.utf8()) - .arg(strerror(errno)) << endl; + Out() << TQString("Error : Cannot symlink %1 to %2: %3") + .tqarg(link_url.utf8().data()).tqarg(link_to.utf8().data()) + .tqarg(strerror(errno)) << endl; } } - void Move(const QString & src,const QString & dst,bool nothrow) + void Move(const TQString & src,const TQString & dst,bool nothrow) { // Out() << "Moving " << src << " -> " << dst << endl; if (!KIO::NetAccess::move(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0)) { if (!nothrow) throw Error(i18n("Cannot move %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString())); + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString())); else - Out() << QString("Error : Cannot move %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString()) << endl; + Out() << TQString("Error : Cannot move %1 to %2: %3") + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString()) << endl; } } - void CopyFile(const QString & src,const QString & dst,bool nothrow) + void CopyFile(const TQString & src,const TQString & dst,bool nothrow) { if (!KIO::NetAccess::file_copy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst))) { if (!nothrow) throw Error(i18n("Cannot copy %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString())); + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString())); else - Out() << QString("Error : Cannot copy %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString()) << endl; + Out() << TQString("Error : Cannot copy %1 to %2: %3") + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString()) << endl; } } - void CopyDir(const QString & src,const QString & dst,bool nothrow) + void CopyDir(const TQString & src,const TQString & dst,bool nothrow) { if (!KIO::NetAccess::dircopy(KURL::fromPathOrURL(src),KURL::fromPathOrURL(dst),0)) { if (!nothrow) throw Error(i18n("Cannot copy %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString())); + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString())); else - Out() << QString("Error : Cannot copy %1 to %2: %3") - .arg(src).arg(dst) - .arg(KIO::NetAccess::lastErrorString()) << endl; + Out() << TQString("Error : Cannot copy %1 to %2: %3") + .tqarg(src).tqarg(dst) + .tqarg(KIO::NetAccess::lastErrorString()) << endl; } } - bool Exists(const QString & url) + bool Exists(const TQString & url) { // Out() << "Testing if " << url << " exists " << endl; - if (access(QFile::encodeName(url),F_OK) < 0) + if (access(TQFile::encodeName(url),F_OK) < 0) { // Out() << "No " << endl; return false; @@ -163,14 +163,14 @@ namespace bt } } - static bool DelDir(const QString & fn) + static bool DelDir(const TQString & fn) { - QDir d(fn); - QStringList subdirs = d.entryList(QDir::Dirs); + TQDir d(fn); + TQStringList subdirs = d.entryList(TQDir::Dirs); - for (QStringList::iterator i = subdirs.begin(); i != subdirs.end();i++) + for (TQStringList::iterator i = subdirs.begin(); i != subdirs.end();i++) { - QString entry = *i; + TQString entry = *i; if (entry == ".." || entry == ".") continue; @@ -182,12 +182,12 @@ namespace bt } } - QStringList files = d.entryList(QDir::Files | QDir::System | QDir::Hidden); - for (QStringList::iterator i = files.begin(); i != files.end();i++) + TQStringList files = d.entryList(TQDir::Files | TQDir::System | TQDir::Hidden); + for (TQStringList::iterator i = files.begin(); i != files.end();i++) { - QString entry = *i; + TQString entry = *i; - if (remove(QFile::encodeName(d.absFilePath(entry))) < 0) + if (remove(TQFile::encodeName(d.absFilePath(entry))) < 0) { Out(SYS_GEN|LOG_DEBUG) << "Delete of " << fn << "/" << entry << " failed !" << endl; return false; @@ -203,9 +203,9 @@ namespace bt return true; } - void Delete(const QString & url,bool nothrow) + void Delete(const TQString & url,bool nothrow) { - QCString fn = QFile::encodeName(url); + TQCString fn = TQFile::encodeName(url); #if HAVE_STAT64 struct stat64 statbuf; if (lstat64(fn, &statbuf) < 0) @@ -229,9 +229,9 @@ namespace bt if (!ok) { - QString err = i18n("Cannot delete %1: %2") - .arg(url) - .arg(strerror(errno)); + TQString err = i18n("Cannot delete %1: %2") + .tqarg(url) + .tqarg(strerror(errno)); if (!nothrow) throw Error(err); else @@ -239,7 +239,7 @@ namespace bt } } - void Touch(const QString & url,bool nothrow) + void Touch(const TQString & url,bool nothrow) { if (Exists(url)) return; @@ -249,8 +249,8 @@ namespace bt { if (!nothrow) throw Error(i18n("Cannot create %1: %2") - .arg(url) - .arg(fptr.errorString())); + .tqarg(url) + .tqarg(fptr.errorString())); else Out() << "Error : Cannot create " << url << " : " << fptr.errorString() << endl; @@ -258,19 +258,19 @@ namespace bt } } - Uint64 FileSize(const QString & url) + Uint64 FileSize(const TQString & url) { int ret = 0; #if HAVE_STAT64 struct stat64 sb; - ret = stat64(QFile::encodeName(url),&sb); + ret = stat64(TQFile::encodeName(url),&sb); #else struct stat sb; - ret = stat(QFile::encodeName(url),&sb); + ret = stat(TQFile::encodeName(url),&sb); #endif if (ret < 0) throw Error(i18n("Cannot calculate the filesize of %1: %2") - .arg(url).arg(strerror(errno))); + .tqarg(url).tqarg(strerror(errno))); return (Uint64)sb.st_size; } @@ -286,7 +286,7 @@ namespace bt ret = fstat(fd,&sb); #endif if (ret < 0) - throw Error(i18n("Cannot calculate the filesize : %2").arg(strerror(errno))); + throw Error(i18n("Cannot calculate the filesize : %2").tqarg(strerror(errno))); return (Uint64)sb.st_size; } @@ -310,11 +310,11 @@ namespace bt return true; } - bool FatPreallocate(const QString & path,Uint64 size) + bool FatPreallocate(const TQString & path,Uint64 size) { - int fd = ::open(QFile::encodeName(path),O_RDWR | O_LARGEFILE); + int fd = ::open(TQFile::encodeName(path),O_RDWR | O_LARGEFILE); if (fd < 0) - throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno))); bool ret = FatPreallocate(fd,size); close(fd); @@ -339,11 +339,11 @@ namespace bt } - bool XfsPreallocate(const QString & path, Uint64 size) + bool XfsPreallocate(const TQString & path, Uint64 size) { - int fd = ::open(QFile::encodeName(path), O_RDWR | O_LARGEFILE); + int fd = ::open(TQFile::encodeName(path), O_RDWR | O_LARGEFILE); if (fd < 0) - throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno))); bool ret = XfsPreallocate(fd,size); close(fd); @@ -364,16 +364,16 @@ namespace bt #else if (ftruncate(fd,size) == -1) #endif - throw Error(i18n("Cannot expand file : %1").arg(strerror(errno))); + throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno))); } else { #if HAVE_POSIX_FALLOCATE64 if (posix_fallocate64(fd,0,size) != 0) - throw Error(i18n("Cannot expand file : %1").arg(strerror(errno))); + throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno))); #elif HAVE_POSIX_FALLOCATE if (posix_fallocate(fd,0,size) != 0) - throw Error(i18n("Cannot expand file : %1").arg(strerror(errno))); + throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno))); #else SeekFile(fd,0,SEEK_SET); bt::Array<Uint8> buf(4096); @@ -388,9 +388,9 @@ namespace bt int ret = write(fd,buf,to_write); if (ret < 0) - throw Error(i18n("Cannot expand file : %1").arg(strerror(errno))); + throw Error(i18n("Cannot expand file : %1").tqarg(strerror(errno))); else if (ret == 0 || ret != (int)to_write) - throw Error(i18n("Cannot expand file").arg(strerror(errno))); + throw Error(i18n("Cannot expand file").tqarg(strerror(errno))); else written += to_write; } @@ -398,11 +398,11 @@ namespace bt } } - void TruncateFile(const QString & path,Uint64 size) + void TruncateFile(const TQString & path,Uint64 size) { - int fd = ::open(QFile::encodeName(path),O_RDWR | O_LARGEFILE); + int fd = ::open(TQFile::encodeName(path),O_RDWR | O_LARGEFILE); if (fd < 0) - throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno))); + throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno))); try { @@ -423,10 +423,10 @@ namespace bt #else if (lseek(fd,off,whence) == -1) #endif - throw Error(i18n("Cannot seek in file : %1").arg(strerror(errno))); + throw Error(i18n("Cannot seek in file : %1").tqarg(strerror(errno))); } - bool FreeDiskSpace(const QString & path,Uint64 & bytes_free) + bool FreeDiskSpace(const TQString & path,Uint64 & bytes_free) { #if HAVE_STATVFS #if HAVE_STATVFS64 @@ -443,7 +443,7 @@ namespace bt else { Out(SYS_GEN|LOG_DEBUG) << "Error : statvfs for " << path << " failed : " - << QString(strerror(errno)) << endl; + << TQString(strerror(errno)) << endl; return false; } @@ -457,7 +457,7 @@ namespace bt else { Out(SYS_GEN|LOG_DEBUG) << "Error : statfs for " << path << " failed : " - << QString(strerror(errno)) << endl; + << TQString(strerror(errno)) << endl; return false; } diff --git a/libktorrent/util/fileops.h b/libktorrent/util/fileops.h index 253ee96..067bd03 100644 --- a/libktorrent/util/fileops.h +++ b/libktorrent/util/fileops.h @@ -25,7 +25,7 @@ #endif #include <util/constants.h> -class QString; +class TQString; namespace bt { @@ -37,7 +37,7 @@ namespace bt * @param nothrow wether or not we shouldn't throw an Error upon failure * @throw Error upon error */ - void MakeDir(const QString & dir,bool nothrow = false); + void MakeDir(const TQString & dir,bool nothrow = false); /** * Create a symbolic link @a link_url which links to @a link_to @@ -45,7 +45,7 @@ namespace bt * @param link_url The link url * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void SymLink(const QString & link_to,const QString & link_url,bool nothrow = false); + void SymLink(const TQString & link_to,const TQString & link_url,bool nothrow = false); /** * Move a file/dir from one location to another @@ -53,7 +53,7 @@ namespace bt * @param dst The destination file / directory * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Move(const QString & src,const QString & dst,bool nothrow = false); + void Move(const TQString & src,const TQString & dst,bool nothrow = false); /** * Copy a file. @@ -61,7 +61,7 @@ namespace bt * @param dst The destination dir/file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void CopyFile(const QString & src,const QString & dst,bool nothrow = false); + void CopyFile(const TQString & src,const TQString & dst,bool nothrow = false); /** * Copy a file or directory @@ -69,21 +69,21 @@ namespace bt * @param dst The destination dir/file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void CopyDir(const QString & src,const QString & dst,bool nothrow = false); + void CopyDir(const TQString & src,const TQString & dst,bool nothrow = false); /** * Check wether a file/dir exists * @param url The file/dir * @return true if it exits */ - bool Exists(const QString & url); + bool Exists(const TQString & url); /** * Delete a file or directory. * @param url The url of the file/dir * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Delete(const QString & url,bool nothrow = false); + void Delete(const TQString & url,bool nothrow = false); /** * Try to create a file. Doesn't do anything if the file @@ -91,7 +91,7 @@ namespace bt * @param url The url of the file * @param nothrow wether or not we shouldn't throw an Error upon failure */ - void Touch(const QString & url,bool nothrow = false); + void Touch(const TQString & url,bool nothrow = false); /** * Calculates the size of a file @@ -99,7 +99,7 @@ namespace bt * @return The size of the file * @throw Error if the file doesn't exist, or something else goes wrong */ - Uint64 FileSize(const QString & url); + Uint64 FileSize(const TQString & url); /** * Get the size of a file. @@ -124,7 +124,7 @@ namespace bt * @param quick Use the quick way (doesn't prevent fragmentationt) * @throw Error if the file doesn't exist, or something else goes wrong */ - void TruncateFile(const QString & path,Uint64 size); + void TruncateFile(const TQString & path,Uint64 size); /** * Special truncate for FAT file systems. @@ -134,7 +134,7 @@ namespace bt /** * Special truncate for FAT file systems. */ - bool FatPreallocate(const QString & path,Uint64 size); + bool FatPreallocate(const TQString & path,Uint64 size); #ifdef HAVE_XFS_XFS_H /** @@ -145,7 +145,7 @@ namespace bt /** * Special truncate for XFS file systems. */ - bool XfsPreallocate(const QString & path,Uint64 size); + bool XfsPreallocate(const TQString & path,Uint64 size); #endif @@ -159,7 +159,7 @@ namespace bt void SeekFile(int fd,Int64 off,int whence); /// Calculate the number of bytes free on the filesystem path is located - bool FreeDiskSpace(const QString & path,Uint64 & bytes_free); + bool FreeDiskSpace(const TQString & path,Uint64 & bytes_free); } #endif diff --git a/libktorrent/util/functions.cpp b/libktorrent/util/functions.cpp index 744bf43..3c73f36 100644 --- a/libktorrent/util/functions.cpp +++ b/libktorrent/util/functions.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdir.h> -#include <qhostaddress.h> +#include <tqdir.h> +#include <tqhostaddress.h> #include <errno.h> #include <sys/time.h> #include <sys/types.h> @@ -39,17 +39,17 @@ namespace bt { - bool IsMultimediaFile(const QString & filename) + bool IsMultimediaFile(const TQString & filename) { KMimeType::Ptr ptr = KMimeType::findByPath(filename); - QString name = ptr->name(); + TQString name = ptr->name(); return name.startsWith("audio") || name.startsWith("video") || name == "application/ogg"; } - QHostAddress LookUpHost(const QString & host) + TQHostAddress LookUpHost(const TQString & host) { struct hostent * he = gethostbyname(host.ascii()); - QHostAddress addr; + TQHostAddress addr; if (he) { addr.setAddress(inet_ntoa(*((struct in_addr *)he->h_addr))); @@ -57,10 +57,10 @@ namespace bt return addr; } - QString DirSeparator() + TQString DirSeparator() { - QString tmp; - tmp.append(QDir::separator()); + TQString tmp; + tmp.append(TQDir::separator()); return tmp; } @@ -203,7 +203,7 @@ namespace bt if (setrlimit(RLIMIT_NOFILE,&lim) < 0) { Out(SYS_GEN|LOG_DEBUG) << "Failed to maximize file limit : " - << QString(strerror(errno)) << endl; + << TQString(strerror(errno)) << endl; return false; } } @@ -221,7 +221,7 @@ namespace bt if (setrlimit(RLIMIT_DATA,&lim) < 0) { Out(SYS_GEN|LOG_DEBUG) << "Failed to maximize data limit : " - << QString(strerror(errno)) << endl; + << TQString(strerror(errno)) << endl; return false; } } diff --git a/libktorrent/util/functions.h b/libktorrent/util/functions.h index 4ace51b..9295b83 100644 --- a/libktorrent/util/functions.h +++ b/libktorrent/util/functions.h @@ -22,8 +22,8 @@ #include "constants.h" -class QString; -class QHostAddress; +class TQString; +class TQHostAddress; class KURL; namespace bt @@ -56,9 +56,9 @@ namespace bt TimeStamp Now(); - QHostAddress LookUpHost(const QString & host); - QString DirSeparator(); - bool IsMultimediaFile(const QString & filename); + TQHostAddress LookUpHost(const TQString & host); + TQString DirSeparator(); + bool IsMultimediaFile(const TQString & filename); /** * Maximize the file and memory limits using setrlimit. diff --git a/libktorrent/util/httprequest.cpp b/libktorrent/util/httprequest.cpp index d0652bc..ed7d980 100644 --- a/libktorrent/util/httprequest.cpp +++ b/libktorrent/util/httprequest.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qstringlist.h> +#include <tqstringlist.h> #include <torrent/globals.h> #include "httprequest.h" #include "array.h" @@ -27,18 +27,18 @@ namespace bt { - HTTPRequest::HTTPRequest(const QString & hdr,const QString & payload,const QString & host,Uint16 port,bool verbose) : hdr(hdr),payload(payload),verbose(verbose) + HTTPRequest::HTTPRequest(const TQString & hdr,const TQString & payload,const TQString & host,Uint16 port,bool verbose) : hdr(hdr),payload(payload),verbose(verbose) { - sock = new KNetwork::KStreamSocket(host,QString::number(port),this,0); + sock = new KNetwork::KStreamSocket(host,TQString::number(port),this,0); sock->enableRead(true); sock->enableWrite(true); sock->setTimeout(30000); sock->setBlocking(false); - connect(sock,SIGNAL(readyRead()),this,SLOT(onReadyRead())); - connect(sock,SIGNAL(gotError(int)),this,SLOT(onError(int ))); - connect(sock,SIGNAL(timedOut()),this,SLOT(onTimeout())); - connect(sock,SIGNAL(connected(const KResolverEntry&)), - this, SLOT(onConnect( const KResolverEntry& ))); + connect(sock,TQT_SIGNAL(readyRead()),this,TQT_SLOT(onReadyRead())); + connect(sock,TQT_SIGNAL(gotError(int)),this,TQT_SLOT(onError(int ))); + connect(sock,TQT_SIGNAL(timedOut()),this,TQT_SLOT(onTimeout())); + connect(sock,TQT_SIGNAL(connected(const KResolverEntry&)), + this, TQT_SLOT(onConnect( const KResolverEntry& ))); } @@ -55,10 +55,10 @@ namespace bt void HTTPRequest::onConnect(const KResolverEntry&) { - payload = payload.replace("$LOCAL_IP",sock->localAddress().nodeName()); - hdr = hdr.replace("$CONTENT_LENGTH",QString::number(payload.length())); + payload = payload.tqreplace("$LOCAL_IP",sock->localAddress().nodeName()); + hdr = hdr.tqreplace("$CONTENT_LENGTH",TQString::number(payload.length())); - QString req = hdr + payload; + TQString req = hdr + payload; if (verbose) { Out(SYS_PNP|LOG_DEBUG) << "Sending " << endl; @@ -79,8 +79,8 @@ namespace bt Array<char> data(ba); ba = sock->readBlock(data,ba); - QString strdata((const char*)data); - QStringList sl = QStringList::split("\r\n",strdata,false); + TQString strdata((const char*)data); + TQStringList sl = TQStringList::split("\r\n",strdata,false); if (verbose) { @@ -88,7 +88,7 @@ namespace bt Out(SYS_PNP|LOG_DEBUG) << strdata << endl; } - if (sl.first().contains("HTTP") && sl.first().contains("200")) + if (sl.first().tqcontains("HTTP") && sl.first().tqcontains("200")) { // emit reply OK replyOK(this,sl.last()); @@ -103,7 +103,7 @@ namespace bt void HTTPRequest::onError(int) { - Out() << "HTTPRequest error : " << sock->errorString() << endl; + Out() << "HTTPRequest error : " << sock->KSocketBase::errorString() << endl; error(this,false); sock->close(); operationFinished(this); diff --git a/libktorrent/util/httprequest.h b/libktorrent/util/httprequest.h index 348a84e..524b3b2 100644 --- a/libktorrent/util/httprequest.h +++ b/libktorrent/util/httprequest.h @@ -20,7 +20,7 @@ #ifndef BTHTTPREQUEST_H #define BTHTTPREQUEST_H -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> #include <kstreamsocket.h> #include <interfaces/exitoperation.h> @@ -41,6 +41,7 @@ namespace bt class HTTPRequest : public kt::ExitOperation { Q_OBJECT + TQ_OBJECT public: /** * Constructor, set the url and the request header. @@ -50,7 +51,7 @@ namespace bt * @param port THe port * @param verbose Print traffic to the log */ - HTTPRequest(const QString & hdr,const QString & payload,const QString & host, + HTTPRequest(const TQString & hdr,const TQString & payload,const TQString & host, Uint16 port,bool verbose); virtual ~HTTPRequest(); @@ -65,14 +66,14 @@ namespace bt * @param r The sender of the request * @param data The data of the reply */ - void replyOK(bt::HTTPRequest* r,const QString & data); + void replyOK(bt::HTTPRequest* r,const TQString & data); /** * Anything else but an 200 OK was sent. * @param r The sender of the request * @param data The data of the reply */ - void replyError(bt::HTTPRequest* r,const QString & data); + void replyError(bt::HTTPRequest* r,const TQString & data); /** * No reply was sent and an error or timeout occurred. @@ -89,7 +90,7 @@ namespace bt private: KNetwork::KStreamSocket* sock; - QString hdr,payload; + TQString hdr,payload; bool verbose; }; diff --git a/libktorrent/util/log.cpp b/libktorrent/util/log.cpp index 05682a8..6935a45 100644 --- a/libktorrent/util/log.cpp +++ b/libktorrent/util/log.cpp @@ -21,15 +21,15 @@ #include <kurl.h> #include <kprocess.h> #include <klocale.h> -#include <qdatetime.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqptrlist.h> #include <iostream> #include <stdlib.h> #include <torrent/globals.h> #include <interfaces/logmonitorinterface.h> -#include <qmutex.h> +#include <tqmutex.h> #include <util/fileops.h> #include <stdlib.h> #include "log.h" @@ -45,19 +45,19 @@ namespace bt class Log::Private { public: - Log* parent; - QTextStream* out; - QFile fptr; + Log* tqparent; + TQTextStream* out; + TQFile fptr; bool to_cout; - QPtrList<LogMonitorInterface> monitors; - QString tmp; - QMutex mutex; + TQPtrList<LogMonitorInterface> monitors; + TQString tmp; + TQMutex mutex; unsigned int m_filter; AutoRotateLogJob* rotate_job; public: - Private(Log* parent) : parent(parent),out(0),to_cout(false),rotate_job(0) + Private(Log* tqparent) : tqparent(tqparent),out(0),to_cout(false),rotate_job(0) { - out = new QTextStream(); + out = new TQTextStream(); } ~Private() @@ -71,7 +71,7 @@ namespace bt m_filter = filter; } - void rotateLogs(const QString & file) + void rotateLogs(const TQString & file) { if (bt::Exists(file + "-10.gz")) bt::Delete(file + "-10.gz",true); @@ -79,18 +79,18 @@ namespace bt // move all log files one up for (Uint32 i = 10;i > 1;i--) { - QString prev = QString("%1-%2.gz").arg(file).arg(i - 1); - QString curr = QString("%1-%2.gz").arg(file).arg(i); + TQString prev = TQString("%1-%2.gz").tqarg(file).tqarg(i - 1); + TQString curr = TQString("%1-%2.gz").tqarg(file).tqarg(i); if (bt::Exists(prev)) bt::Move(prev,curr,true); } // move current log to 1 and zip it bt::Move(file,file + "-1",true); - system(QString("gzip " + KProcess::quote(file + "-1")).local8Bit()); + system(TQString("gzip " + KProcess::quote(file + "-1")).local8Bit()); } - void setOutputFile(const QString & file) + void setOutputFile(const TQString & file) { if (fptr.isOpen()) fptr.close(); @@ -100,12 +100,12 @@ namespace bt fptr.setName(file); if (!fptr.open(IO_WriteOnly)) - throw Error(i18n("Cannot open log file %1 : %2").arg(file).arg(fptr.errorString())); + throw Error(i18n("Cannot open log file %1 : %2").tqarg(file).tqarg(fptr.errorString())); - out->setDevice(&fptr); + out->setDevice(TQT_TQIODEVICE(&fptr)); } - void write(const QString & line) + void write(const TQString & line) { tmp += line; } @@ -116,14 +116,14 @@ namespace bt // this could result in the loss of some messages if (!rotate_job) { - *out << QDateTime::currentDateTime().toString() << ": " << tmp << ::endl; + *out << TQDateTime::tqcurrentDateTime().toString() << ": " << tmp << ::endl; fptr.flush(); if (to_cout) - std::cout << tmp.local8Bit() << std::endl; + std::cout << TQString(tmp.local8Bit()) << std::endl; if (monitors.count() > 0) { - QPtrList<LogMonitorInterface>::iterator i = monitors.begin(); + TQPtrList<LogMonitorInterface>::iterator i = monitors.begin(); while (i != monitors.end()) { kt::LogMonitorInterface* lmi = *i; @@ -142,18 +142,18 @@ namespace bt { tmp = "Log larger then 10 MB, rotating"; finishLine(); - QString file = fptr.name(); + TQString file = fptr.name(); fptr.close(); // close the log file out->setDevice(0); // start the rotate job - rotate_job = new AutoRotateLogJob(file,parent); + rotate_job = new AutoRotateLogJob(file,tqparent); } } void logRotateDone() { fptr.open(IO_WriteOnly); - out->setDevice(&fptr); + out->setDevice(TQT_TQIODEVICE(&fptr)); rotate_job = 0; } }; @@ -170,7 +170,7 @@ namespace bt } - void Log::setOutputFile(const QString & file) + void Log::setOutputFile(const TQString & file) { priv->setOutputFile(file); } @@ -203,7 +203,7 @@ namespace bt return *this; } - Log & Log::operator << (const QString & s) + Log & Log::operator << (const TQString & s) { priv->write(s); return *this; @@ -217,12 +217,12 @@ namespace bt Log & Log::operator << (Uint64 v) { - return operator << (QString::number(v)); + return operator << (TQString::number(v)); } Log & Log::operator << (Int64 v) { - return operator << (QString::number(v)); + return operator << (TQString::number(v)); } void Log::setFilter(unsigned int filter) diff --git a/libktorrent/util/log.h b/libktorrent/util/log.h index 2fe0ba6..742b753 100644 --- a/libktorrent/util/log.h +++ b/libktorrent/util/log.h @@ -23,7 +23,7 @@ #include "constants.h" -#include <qstring.h> +#include <tqstring.h> // LOG MESSAGES CONSTANTS #define LOG_NONE 0x00 @@ -115,18 +115,18 @@ namespace bt * @param file The name of the file * @throw Exception if the file can't be opened */ - void setOutputFile(const QString & file); + void setOutputFile(const TQString & file); /** * Write a number to the log file. - * Anything which can be passed to QString::number will do. + * Anything which can be passed to TQString::number will do. * @param val The value * @return This Log */ template <class T> Log & operator << (T val) { - return operator << (QString::number(val)); + return operator << (TQString::number(val)); } /** @@ -141,18 +141,18 @@ namespace bt /** - * Output a QString to the log. - * @param s The QString + * Output a TQString to the log. + * @param s The TQString * @return This Log */ Log & operator << (const char* s); /** - * Output a QString to the log. - * @param s The QString + * Output a TQString to the log. + * @param s The TQString * @return This Log */ - Log & operator << (const QString & s); + Log & operator << (const TQString & s); /** * Output a 64 bit integer to the log. diff --git a/libktorrent/util/mmapfile.cpp b/libktorrent/util/mmapfile.cpp index 579c67a..811acd7 100644 --- a/libktorrent/util/mmapfile.cpp +++ b/libktorrent/util/mmapfile.cpp @@ -29,7 +29,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <errno.h> -#include <qfile.h> +#include <tqfile.h> #include <kfileitem.h> #include <kio/netaccess.h> #include <klocale.h> @@ -51,20 +51,20 @@ namespace bt close(); } - bool MMapFile::open(const QString & file,Mode mode) + bool MMapFile::open(const TQString & file,Mode mode) { #if HAVE_STAT64 struct stat64 sb; - stat64(QFile::encodeName(file),&sb); + stat64(TQFile::encodeName(file),&sb); #else struct stat sb; - stat(QFile::encodeName(file),&sb); + stat(TQFile::encodeName(file),&sb); #endif return open(file,mode,(Uint64)sb.st_size); } - bool MMapFile::open(const QString & file,Mode mode,Uint64 size) + bool MMapFile::open(const TQString & file,Mode mode,Uint64 size) { // close already open file if (fd > 0) @@ -97,7 +97,7 @@ namespace bt #endif // open the file - fd = ::open(QFile::encodeName(file) , flag);//(int)flag); + fd = ::open(TQFile::encodeName(file) , flag);//(int)flag); if (fd == -1) return false; @@ -107,10 +107,10 @@ namespace bt #if HAVE_STAT64 struct stat64 sb; - stat64(QFile::encodeName(file),&sb); + stat64(TQFile::encodeName(file),&sb); #else struct stat sb; - stat(QFile::encodeName(file),&sb); + stat(TQFile::encodeName(file),&sb); #endif file_size = (Uint64)sb.st_size; filename = file; @@ -146,7 +146,7 @@ namespace bt ptr = size = 0; data = 0; fd = -1; - filename = QString::null; + filename = TQString(); } } @@ -274,7 +274,7 @@ namespace bt return ptr; } - QString MMapFile::errorString() const + TQString MMapFile::errorString() const { return strerror(errno); } diff --git a/libktorrent/util/mmapfile.h b/libktorrent/util/mmapfile.h index ca0d782..4d68fd2 100644 --- a/libktorrent/util/mmapfile.h +++ b/libktorrent/util/mmapfile.h @@ -21,7 +21,7 @@ #define BTMMAPFILE_H -#include <qstring.h> +#include <tqstring.h> #include <util/constants.h> namespace bt @@ -52,7 +52,7 @@ namespace bt * @param mode Mode (READ, WRITE or RW) * @return true upon succes */ - bool open(const QString & file,Mode mode); + bool open(const TQString & file,Mode mode); /** * Open the file. If mode is write and the file doesn't exist, it will @@ -62,7 +62,7 @@ namespace bt * @param size Size of the memory mapping (the file will be enlarged to this value) * @return true upon succes */ - bool open(const QString & file,Mode mode,Uint64 size); + bool open(const TQString & file,Mode mode,Uint64 size); /** * Close the file. Undoes the memory mapping. @@ -112,7 +112,7 @@ namespace bt Uint64 tell() const; /// Get the error string. - QString errorString() const; + TQString errorString() const; /// Get the file size Uint64 getSize() const; @@ -136,7 +136,7 @@ namespace bt Uint64 size; // size of mmapping Uint64 file_size; // size of file Uint64 ptr; - QString filename; + TQString filename; Mode mode; }; diff --git a/libktorrent/util/profiler.cpp b/libktorrent/util/profiler.cpp index 05c53bd..766012d 100644 --- a/libktorrent/util/profiler.cpp +++ b/libktorrent/util/profiler.cpp @@ -18,19 +18,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifdef KT_PROFILE -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <sys/time.h> #include "profiler.h" namespace bt { - Profile::Profile(Profile* parent,const QString & name) : parent(parent),name(name) + Profile::Profile(Profile* tqparent,const TQString & name) : tqparent(tqparent),name(name) { min = max = avg = 0.0; count = 0; start_time = 0.0; - children.setAutoDelete(true); + tqchildren.setAutoDelete(true); } Profile::~Profile() @@ -61,10 +61,10 @@ namespace bt count++; } - Profile* Profile::child(const QString & name) + Profile* Profile::child(const TQString & name) { - QPtrList<Profile>::iterator i = children.begin(); - while (i != children.end()) + TQPtrList<Profile>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { Profile* p = *i; if (p->name == name) @@ -73,19 +73,19 @@ namespace bt } Profile* p = new Profile(this,name); - children.append(p); + tqchildren.append(p); return p; } - void Profile::save(QTextStream & out,const QString & base) + void Profile::save(TQTextStream & out,const TQString & base) { - QString nb = base + "/" + name; + TQString nb = base + "/" + name; out.precision(5); out << qSetW(60) << nb << qSetW(10) << min << qSetW(10) << max << qSetW(10) << avg << qSetW(10) << count << endl; - QPtrList<Profile>::iterator i = children.begin(); - while (i != children.end()) + TQPtrList<Profile>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { Profile* p = *i; p->save(out,nb); @@ -109,7 +109,7 @@ namespace bt delete root; } - void Profiler::start(const QString & s) + void Profiler::start(const TQString & s) { curr = curr->child(s); curr->start(); @@ -121,18 +121,18 @@ namespace bt curr = curr->getParent(); } - void Profiler::saveToFile(const QString & fn) + void Profiler::saveToFile(const TQString & fn) { - QFile fptr(fn); + TQFile fptr(fn); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << qSetW(60) << "code" << qSetW(10) << "min" << qSetW(10) << "max" << qSetW(10) << "avg" << qSetW(10) << "count" << endl; out << endl; - root->save(out,QString::null); + root->save(out,TQString()); } } #endif diff --git a/libktorrent/util/profiler.h b/libktorrent/util/profiler.h index 6ab06e7..836f4ba 100644 --- a/libktorrent/util/profiler.h +++ b/libktorrent/util/profiler.h @@ -21,10 +21,10 @@ #define BTPROFILER_H #ifdef KT_PROFILE -#include <qptrlist.h> +#include <tqptrlist.h> #include <util/constants.h> -class QTextStream; +class TQTextStream; namespace bt @@ -34,15 +34,15 @@ namespace bt */ class Profile { - Profile* parent; - QPtrList<Profile> children; + Profile* tqparent; + TQPtrList<Profile> tqchildren; - QString name; + TQString name; double min,max,avg; Uint32 count; double start_time; public: - Profile(Profile* parent,const QString & name); + Profile(Profile* tqparent,const TQString & name); virtual ~Profile(); /** @@ -60,19 +60,19 @@ namespace bt * @param name The name of the child * @return The child */ - Profile* child(const QString & name); + Profile* child(const TQString & name); /** - * Get the parent of the current profile. + * Get the tqparent of the current profile. */ - Profile* getParent() const {return parent;} + Profile* getParent() const {return tqparent;} /** * Save profile information to a file. * @param out Text stream to write to * @param base Base path of the profiles */ - void save(QTextStream & out,const QString & base); + void save(TQTextStream & out,const TQString & base); }; /** @@ -91,9 +91,9 @@ namespace bt public: virtual ~Profiler(); - void start(const QString & s); + void start(const TQString & s); void end(); - void saveToFile(const QString & fn); + void saveToFile(const TQString & fn); static Profiler & instance() {return inst;} }; diff --git a/libktorrent/util/ptrmap.h b/libktorrent/util/ptrmap.h index 36e1c20..9474db1 100644 --- a/libktorrent/util/ptrmap.h +++ b/libktorrent/util/ptrmap.h @@ -129,7 +129,7 @@ namespace bt * @param k The key * @return The data of the key, 0 if the key isn't in the map */ - Data* find(const Key & k) + Data* tqfind(const Key & k) { iterator i = pmap.find(k); return (i == pmap.end()) ? 0 : i->second; @@ -140,7 +140,7 @@ namespace bt * @param k The key * @return The data of the key, 0 if the key isn't in the map */ - const Data* find(const Key & k) const + const Data* tqfind(const Key & k) const { const_iterator i = pmap.find(k); return (i == pmap.end()) ? 0 : i->second; @@ -151,7 +151,7 @@ namespace bt * @param k The key * @return true if it is part of the map */ - bool contains(const Key & k) const + bool tqcontains(const Key & k) const { const_iterator i = pmap.find(k); return i != pmap.end(); diff --git a/libktorrent/util/sha1hash.cpp b/libktorrent/util/sha1hash.cpp index c7b151c..6cdbbc4 100644 --- a/libktorrent/util/sha1hash.cpp +++ b/libktorrent/util/sha1hash.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qurl.h> +#include <tqurl.h> #include <string.h> #include <algorithm> #include "log.h" @@ -72,10 +72,10 @@ namespace bt return hg.generate(data,len); } - QString SHA1Hash::toString() const + TQString SHA1Hash::toString() const { char tmp[41]; - QString fmt; + TQString fmt; for (int i = 0;i < 20;i++) fmt += "%02x"; tmp[40] = '\0'; @@ -84,17 +84,17 @@ namespace bt hash[5],hash[6],hash[7],hash[8],hash[9], hash[10],hash[11],hash[12],hash[13],hash[14], hash[15],hash[16],hash[17],hash[18],hash[19]); - return QString(tmp); + return TQString(tmp); } - QByteArray SHA1Hash::toByteArray() const + TQByteArray SHA1Hash::toByteArray() const { - QByteArray arr(20); + TQByteArray arr(20); arr.duplicate((const char*)hash,20); return arr; } - QString SHA1Hash::toURLString() const + TQString SHA1Hash::toURLString() const { return URLEncoder::encode((const char*)hash,20); } diff --git a/libktorrent/util/sha1hash.h b/libktorrent/util/sha1hash.h index a831d2d..dba66c9 100644 --- a/libktorrent/util/sha1hash.h +++ b/libktorrent/util/sha1hash.h @@ -20,10 +20,10 @@ #ifndef BTSHA1HASH_H #define BTSHA1HASH_H -#include <qcstring.h> +#include <tqcstring.h> #include "constants.h" -class QString; +class TQString; namespace bt { @@ -98,13 +98,13 @@ namespace bt * Convert the hash to a printable string. * @return The string */ - QString toString() const; + TQString toString() const; /** * Convert the hash to a string, usable in http get requests. * @return The string */ - QString toURLString() const; + TQString toURLString() const; /** * Directly get pointer to the data. @@ -140,7 +140,7 @@ namespace bt /** * Convert the hash to a byte array. */ - QByteArray toByteArray() const; + TQByteArray toByteArray() const; }; } diff --git a/libktorrent/util/timer.cpp b/libktorrent/util/timer.cpp index c06b728..a35ffc0 100644 --- a/libktorrent/util/timer.cpp +++ b/libktorrent/util/timer.cpp @@ -25,7 +25,7 @@ namespace bt Timer::Timer() : elapsed(0) { - last = QTime::currentTime(); + last = TQTime::currentTime(); } Timer::Timer(const Timer & t) : last(t.last),elapsed(t.elapsed) @@ -37,7 +37,7 @@ namespace bt void Timer::update() { - QTime now = QTime::currentTime(); + TQTime now = TQTime::currentTime(); int d = last.msecsTo(now); if (d < 0) @@ -48,7 +48,7 @@ namespace bt Uint32 Timer::getElapsedSinceUpdate() const { - QTime now = QTime::currentTime(); + TQTime now = TQTime::currentTime(); int d = last.msecsTo(now); if (d < 0) d = 0; diff --git a/libktorrent/util/timer.h b/libktorrent/util/timer.h index 3277185..edef755 100644 --- a/libktorrent/util/timer.h +++ b/libktorrent/util/timer.h @@ -20,7 +20,7 @@ #ifndef BTTIMER_H #define BTTIMER_H -#include <qdatetime.h> +#include <tqdatetime.h> #include "constants.h" namespace bt @@ -31,7 +31,7 @@ namespace bt */ class Timer { - QTime last; + TQTime last; Uint32 elapsed; public: Timer(); diff --git a/libktorrent/util/urlencoder.cpp b/libktorrent/util/urlencoder.cpp index c1776de..9d2b92b 100644 --- a/libktorrent/util/urlencoder.cpp +++ b/libktorrent/util/urlencoder.cpp @@ -22,7 +22,7 @@ namespace bt { - QString hex[] = { + TQString hex[] = { "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", "%0f", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", @@ -58,9 +58,9 @@ namespace bt }; - QString URLEncoder::encode(const char* buf,Uint32 size) + TQString URLEncoder::encode(const char* buf,Uint32 size) { - QString res = ""; + TQString res = ""; for (Uint32 i = 0; i < size; i++) { diff --git a/libktorrent/util/urlencoder.h b/libktorrent/util/urlencoder.h index edac33a..c6fd3ec 100644 --- a/libktorrent/util/urlencoder.h +++ b/libktorrent/util/urlencoder.h @@ -20,7 +20,7 @@ #ifndef BTURLENCODER_H #define BTURLENCODER_H -#include <qstring.h> +#include <tqstring.h> #include "constants.h" namespace bt @@ -32,7 +32,7 @@ namespace bt class URLEncoder { public: - static QString encode(const char* buf,Uint32 size); + static TQString encode(const char* buf,Uint32 size); }; } diff --git a/libktorrent/util/waitjob.cpp b/libktorrent/util/waitjob.cpp index d11fa14..9fec771 100644 --- a/libktorrent/util/waitjob.cpp +++ b/libktorrent/util/waitjob.cpp @@ -27,7 +27,7 @@ namespace bt WaitJob::WaitJob(Uint32 millis) : KIO::Job(false) { - connect(&timer,SIGNAL(timeout()),this,SLOT(timerDone())); + connect(&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(timerDone())); timer.start(millis,true); } @@ -51,8 +51,8 @@ namespace bt void WaitJob::addExitOperation(kt::ExitOperation* op) { exit_ops.append(op); - connect(op,SIGNAL(operationFinished( kt::ExitOperation* )), - this,SLOT(operationFinished( kt::ExitOperation* ))); + connect(op,TQT_SIGNAL(operationFinished( kt::ExitOperation* )), + this,TQT_SLOT(operationFinished( kt::ExitOperation* ))); } void WaitJob::operationFinished(kt::ExitOperation* op) diff --git a/libktorrent/util/waitjob.h b/libktorrent/util/waitjob.h index a85ba63..33b73f5 100644 --- a/libktorrent/util/waitjob.h +++ b/libktorrent/util/waitjob.h @@ -20,9 +20,9 @@ #ifndef BTWAITJOB_H #define BTWAITJOB_H -#include <qtimer.h> +#include <tqtimer.h> #include <kio/job.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <interfaces/exitoperation.h> #include "constants.h" @@ -38,6 +38,7 @@ namespace bt class WaitJob : public KIO::Job { Q_OBJECT + TQ_OBJECT public: WaitJob(Uint32 millis); virtual ~WaitJob(); @@ -65,8 +66,8 @@ namespace bt void operationFinished(kt::ExitOperation* op); private: - QTimer timer; - QValueList<kt::ExitOperation*> exit_ops; + TQTimer timer; + TQValueList<kt::ExitOperation*> exit_ops; }; void SynchronousWait(Uint32 millis); diff --git a/plugins/infowidget/GeoIP.c b/plugins/infowidget/GeoIP.c index f71f830..81a9d80 100644 --- a/plugins/infowidget/GeoIP.c +++ b/plugins/infowidget/GeoIP.c @@ -65,10 +65,10 @@ const char GeoIP_country_code[247][3] = { "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN","AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","FX","GA","GB","GD","GE","GF","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TM","TN","TO","TP","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","CS","ZA","ZM","ZR","ZW","A1","A2","O1"}; -const char GeoIP_country_code3[247][4] = { "--","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","AQ","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL","BRA","BHS","BTN","BV","BWA","BLR","BLZ","CAN","CC","COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV","CX","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD","GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","GS","GTM","GUM","GNB","GUY","HKG","HM","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IO","IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU","LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT","REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","TF","TGO","THA","TJK","TKL","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA","UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","YT","SCG","ZAF","ZMB","ZR","ZWE","A1","A2","O1"}; +const char GeoIP_country_code3[247][4] = { "--","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","AQ","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL","BRA","BHS","BTN","BV","BWA","BLR","BLZ","CAN","CC","COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV","CX","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD","GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","GS","GTM","GUM","GNB","GUY","HKG","HM","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IO","IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU","LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","TQAT","REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","TF","TGO","THA","TJK","TKL","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA","UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","YT","SCG","ZAF","ZMB","ZR","ZWE","A1","A2","O1"}; -const char * GeoIP_country_name[247] = {"N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Netherlands Antilles","Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia","Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the","Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji","Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom","Grenada","Georgia","French Guiana","Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala","Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis", -"Korea, Democratic People's Republic of","Korea, Republic of","Kuwait","Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania","Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali","Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua","Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau","Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname","Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand","Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","East Timor","Turkey","Trinidad and Tobago","Tuvalu","Taiwan","Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela","Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia and Montenegro","South Africa","Zambia","Zaire","Zimbabwe", +const char * GeoIP_country_name[247] = {"N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Netherlands Antilles","Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia","Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Detqmocratic Republic of the","Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji","Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom","Grenada","Georgia","French Guiana","Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala","Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis", +"Korea, Detqmocratic People's Republic of","Korea, Republic of","Kuwait","Cayman Islands","Kazakhstan","Lao People's Detqmocratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania","Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali","Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua","Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau","Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname","Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand","Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","East Timor","Turkey","Trinidad and Tobago","Tuvalu","Taiwan","Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela","Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia and Montenegro","South Africa","Zambia","Zaire","Zimbabwe", "Anonymous Proxy","Satellite Provider","Other"}; const char GeoIP_country_continent[247][3] = {"--","AS","EU","EU","AS","AS","SA","SA","EU","AS","SA","AF","AN","SA","OC","EU","OC","SA","AS","EU","SA","AS","EU","AF","EU","AS","AF","AF","SA","AS","SA","SA","SA","AS","AF","AF","EU","SA","NA","AS","AF","AF","AF","EU","AF","OC","SA","AF","AS","SA","SA","SA","AF","AS","AS","EU","EU","AF","EU","SA","SA","AF","SA","EU","AF","AF","AF","EU","AF","EU","OC","SA","OC","EU","EU","EU","AF","EU","SA","AS","SA","AF","EU","SA","AF","AF","SA","AF","EU","SA","SA","OC","AF","SA","AS","AF","SA","EU","SA","EU","AS","EU","AS","AS","AS","AS","AS","EU","EU","SA","AS","AS","AF","AS","AS","OC","AF","SA","AS","AS","AS","SA","AS","AS","AS","SA","EU","AS","AF","AF","EU","EU","EU","AF","AF","EU","EU","AF","OC","EU","AF","AS","AS","AS","OC","SA","AF","SA","EU","AF","AS","AF","NA","AS","AF","AF","OC","AF","OC","AF","SA","EU","EU","AS","OC","OC","OC","AS","SA","SA","OC","OC","AS","AS","EU","SA","OC","SA","AS","EU","OC","SA","AS","AF","EU","AS","AF","AS","OC","AF","AF","EU","AS","AF","EU","EU","EU","AF","EU","AF","AF","SA","AF","SA","AS","AF","SA","AF","AF","AF","AS","AS","OC","AS","AF","OC","AS","AS","SA","OC","AS","AF","EU","AF","OC","NA","SA","AS","EU","SA","SA","SA","SA","AS","OC","OC","OC","AS","AF","EU","AF","AF","AF","AF"}; diff --git a/plugins/infowidget/availabilitychunkbar.cpp b/plugins/infowidget/availabilitychunkbar.cpp index 9d96268..23c4dba 100644 --- a/plugins/infowidget/availabilitychunkbar.cpp +++ b/plugins/infowidget/availabilitychunkbar.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qtooltip.h> +#include <tqtooltip.h> #include <klocale.h> #include <util/bitset.h> @@ -27,9 +27,9 @@ namespace kt { -AvailabilityChunkBar::AvailabilityChunkBar(QWidget* parent, const char* name): ChunkBar(parent, name) +AvailabilityChunkBar::AvailabilityChunkBar(TQWidget* tqparent, const char* name): ChunkBar(tqparent, name) { - QToolTip::add(this, i18n("<img src=\"available_color\"> - Available Chunks<br><img src=\"unavailable_color\"> - Unavailable Chunks<br><img src=\"excluded_color\"> - Excluded Chunks")); + TQToolTip::add(this, i18n("<img src=\"available_color\"> - Available Chunks<br><img src=\"unavailable_color\"> - Unavailable Chunks<br><img src=\"excluded_color\"> - Excluded Chunks")); } diff --git a/plugins/infowidget/availabilitychunkbar.h b/plugins/infowidget/availabilitychunkbar.h index a5ae625..31a5b65 100644 --- a/plugins/infowidget/availabilitychunkbar.h +++ b/plugins/infowidget/availabilitychunkbar.h @@ -31,8 +31,9 @@ namespace kt class AvailabilityChunkBar : public ChunkBar { Q_OBJECT + TQ_OBJECT public: - AvailabilityChunkBar(QWidget* parent, const char* name); + AvailabilityChunkBar(TQWidget* tqparent, const char* name); virtual ~AvailabilityChunkBar(); virtual const bt::BitSet & getBitSet() const; diff --git a/plugins/infowidget/chunkbar.cpp b/plugins/infowidget/chunkbar.cpp index a30571a..48f0aac 100644 --- a/plugins/infowidget/chunkbar.cpp +++ b/plugins/infowidget/chunkbar.cpp @@ -18,16 +18,16 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qpainter.h> -#include <qpen.h> -#include <qbrush.h> -#include <qvaluelist.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqbrush.h> +#include <tqvaluelist.h> +#include <tqpixmap.h> #include <math.h> -#include <qtooltip.h> +#include <tqtooltip.h> #include <klocale.h> -#include <qmime.h> -#include <qimage.h> +#include <tqmime.h> +#include <tqimage.h> #include <util/log.h> #include <interfaces/torrentinterface.h> #include <util/bitset.h> @@ -47,7 +47,7 @@ namespace kt }; - static void FillAndFrameBlack(QImage* image, uint color, int size) + static void FillAndFrameBlack(TQImage* image, uint color, int size) { image->fill(color); for (int i = 0; i < size; i++) @@ -68,23 +68,23 @@ namespace kt return; images_initialized = true; - QMimeSourceFactory* factory = QMimeSourceFactory::defaultFactory(); + TQMimeSourceFactory* factory = TQMimeSourceFactory::defaultFactory(); - QImage excluded(16, 16, 32); - FillAndFrameBlack(&excluded, bar->colorGroup().color(QColorGroup::Mid).pixel(), 16); + TQImage excluded(16, 16, 32); + FillAndFrameBlack(&excluded, TQColor(bar->tqcolorGroup().color(TQColorGroup::Mid)).pixel(), 16); factory->setImage("excluded_color", excluded); - QImage available(16, 16, 32); - FillAndFrameBlack(&available, bar->colorGroup().highlight().pixel(), 16); + TQImage available(16, 16, 32); + FillAndFrameBlack(&available, bar->tqcolorGroup().highlight().pixel(), 16); factory->setImage("available_color", available); - QImage unavailable(16, 16, 32); - FillAndFrameBlack(&unavailable, bar->colorGroup().base().pixel(), 16); + TQImage unavailable(16, 16, 32); + FillAndFrameBlack(&unavailable, bar->tqcolorGroup().base().pixel(), 16); factory->setImage("unavailable_color", unavailable); } - ChunkBar::ChunkBar(QWidget *parent, const char *name) - : QFrame(parent, name),curr_tc(0) + ChunkBar::ChunkBar(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name),curr_tc(0) { setFrameShape(StyledPanel); setFrameShadow(Sunken); @@ -95,7 +95,7 @@ namespace kt InitializeToolTipImages(this); - QToolTip::add(this, i18n("<img src=\"available_color\"> - Downloaded Chunks<br><img src=\"unavailable_color\"> - Chunks to Download<br><img src=\"excluded_color\"> - Excluded Chunks")); + TQToolTip::add(this, i18n("<img src=\"available_color\"> - Downloaded Chunks<br><img src=\"unavailable_color\"> - Chunks to Download<br><img src=\"excluded_color\"> - Excluded Chunks")); } @@ -106,7 +106,7 @@ namespace kt void ChunkBar::updateBar() { const BitSet & bs = getBitSet(); - QSize s = contentsRect().size(); + TQSize s = contentsRect().size(); bool changed = !(curr == bs); if (show_excluded && curr_tc) { @@ -121,22 +121,22 @@ namespace kt // PROFILE("ChunkBar::updateBar"); // Out() << "Pixmap : " << s.width() << " " << s.height() << endl; pixmap.resize(s); - pixmap.fill(colorGroup().color(QColorGroup::Base)); - QPainter painter(&pixmap); + pixmap.fill(tqcolorGroup().color(TQColorGroup::Base)); + TQPainter painter(&pixmap); drawBarContents(&painter); update(); } } - void ChunkBar::drawContents(QPainter *p) + void ChunkBar::drawContents(TQPainter *p) { // first draw background if (isEnabled()) - p->setBrush(colorGroup().base()); + p->setBrush(tqcolorGroup().base()); else - p->setBrush(colorGroup().background()); + p->setBrush(tqcolorGroup().background()); - p->setPen(Qt::NoPen); + p->setPen(TQt::NoPen); p->drawRect(contentsRect()); if (isEnabled()) p->drawPixmap(contentsRect(),pixmap); @@ -145,16 +145,16 @@ namespace kt void ChunkBar::setTC(kt::TorrentInterface* tc) { curr_tc = tc; - QSize s = contentsRect().size(); + TQSize s = contentsRect().size(); //Out() << "Pixmap : " << s.width() << " " << s.height() << endl; pixmap.resize(s); - pixmap.fill(colorGroup().color(QColorGroup::Base)); - QPainter painter(&pixmap); + pixmap.fill(tqcolorGroup().color(TQColorGroup::Base)); + TQPainter painter(&pixmap); drawBarContents(&painter); update(); } - void ChunkBar::drawBarContents(QPainter *p) + void ChunkBar::drawBarContents(TQPainter *p) { p->saveWorldMatrix(); if (curr_tc) @@ -164,15 +164,15 @@ namespace kt const BitSet & bs = getBitSet(); curr = bs; if (bs.allOn()) - drawAllOn(p,colorGroup().highlight()); + drawAllOn(p,tqcolorGroup().highlight()); else if (s.total_chunks > w) - drawMoreChunksThenPixels(p,bs,colorGroup().highlight()); + drawMoreChunksThenPixels(p,bs,tqcolorGroup().highlight()); else - drawEqual(p,bs,colorGroup().highlight()); + drawEqual(p,bs,tqcolorGroup().highlight()); if (show_excluded && s.num_chunks_excluded > 0) { - QColor c = colorGroup().color(QColorGroup::Mid); + TQColor c = tqcolorGroup().color(TQColorGroup::Mid); if (curr_ebs.allOn()) drawAllOn(p,c); else if (s.total_chunks > w) @@ -184,10 +184,10 @@ namespace kt p->restoreWorldMatrix(); } - void ChunkBar::drawEqual(QPainter *p,const BitSet & bs,const QColor & color) + void ChunkBar::drawEqual(TQPainter *p,const BitSet & bs,const TQColor & color) { - //p->setPen(QPen(colorGroup().highlight(),1,Qt::SolidLine)); - QColor c = color; + //p->setPen(TQPen(tqcolorGroup().highlight(),1,TQt::SolidLine)); + TQColor c = color; Uint32 w = contentsRect().width(); double scale = 1.0; @@ -195,10 +195,10 @@ namespace kt if (curr_tc->getStats().total_chunks != w) scale = (double)w / total_chunks; - p->setPen(QPen(c,1,Qt::SolidLine)); + p->setPen(TQPen(c,1,TQt::SolidLine)); p->setBrush(c); - QValueList<Range> rs; + TQValueList<Range> rs; for (Uint32 i = 0;i < bs.getNumBits();i++) { @@ -225,9 +225,9 @@ namespace kt } } - QRect r = contentsRect(); + TQRect r = contentsRect(); - for (QValueList<Range>::iterator i = rs.begin();i != rs.end();++i) + for (TQValueList<Range>::iterator i = rs.begin();i != rs.end();++i) { Range & ra = *i; int rw = ra.last - ra.first + 1; @@ -235,11 +235,11 @@ namespace kt } } - void ChunkBar::drawMoreChunksThenPixels(QPainter *p,const BitSet & bs,const QColor & color) + void ChunkBar::drawMoreChunksThenPixels(TQPainter *p,const BitSet & bs,const TQColor & color) { Uint32 w = contentsRect().width(); double chunks_per_pixel = (double)bs.getNumBits() / w; - QValueList<Range> rs; + TQValueList<Range> rs; for (Uint32 i = 0;i < w;i++) { @@ -274,14 +274,14 @@ namespace kt } } - QRect r = contentsRect(); + TQRect r = contentsRect(); - for (QValueList<Range>::iterator i = rs.begin();i != rs.end();++i) + for (TQValueList<Range>::iterator i = rs.begin();i != rs.end();++i) { Range & ra = *i; int rw = ra.last - ra.first + 1; int fac = ra.fac; - QColor c = color; + TQColor c = color; if (fac < 100) { // do some rounding off @@ -293,18 +293,18 @@ namespace kt fac = 65; c = color.light(200-fac); } - p->setPen(QPen(c,1,Qt::SolidLine)); + p->setPen(TQPen(c,1,TQt::SolidLine)); p->setBrush(c); p->drawRect(ra.first,0,rw,r.height()); } } - void ChunkBar::drawAllOn(QPainter *p,const QColor & color) + void ChunkBar::drawAllOn(TQPainter *p,const TQColor & color) { - p->setPen(QPen(color,1,Qt::SolidLine)); + p->setPen(TQPen(color,1,TQt::SolidLine)); p->setBrush(color); - QSize s = contentsRect().size(); + TQSize s = contentsRect().size(); p->drawRect(0,0,s.width(),s.height()); } } diff --git a/plugins/infowidget/chunkbar.h b/plugins/infowidget/chunkbar.h index 6cf0d6a..32366c3 100644 --- a/plugins/infowidget/chunkbar.h +++ b/plugins/infowidget/chunkbar.h @@ -21,11 +21,11 @@ #ifndef CHUNKBAR_H #define CHUNKBAR_H -#include <qlabel.h> +#include <tqlabel.h> #include <util/bitset.h> -#include <qpixmap.h> +#include <tqpixmap.h> -class QPainter; +class TQPainter; namespace kt { @@ -47,30 +47,31 @@ namespace kt * BitSets can represent which chunks are downloaded, which chunks are available * and which chunks are excluded. */ - class ChunkBar : public QFrame + class ChunkBar : public TQFrame { Q_OBJECT + TQ_OBJECT public: - ChunkBar(QWidget *parent = 0, const char *name = 0); + ChunkBar(TQWidget *tqparent = 0, const char *name = 0); virtual ~ChunkBar(); void setTC(kt::TorrentInterface* tc); virtual const bt::BitSet & getBitSet() const = 0; - virtual void drawContents(QPainter *p); + virtual void drawContents(TQPainter *p); virtual void updateBar(); private: - void drawEqual(QPainter *p,const bt::BitSet & bs,const QColor & color); - void drawMoreChunksThenPixels(QPainter *p,const bt::BitSet & bs,const QColor & color); - void drawAllOn(QPainter *p,const QColor & color); - void drawBarContents(QPainter *p); + void drawEqual(TQPainter *p,const bt::BitSet & bs,const TQColor & color); + void drawMoreChunksThenPixels(TQPainter *p,const bt::BitSet & bs,const TQColor & color); + void drawAllOn(TQPainter *p,const TQColor & color); + void drawBarContents(TQPainter *p); protected: kt::TorrentInterface* curr_tc; bool show_excluded; bt::BitSet curr,curr_ebs; - QPixmap pixmap; + TQPixmap pixmap; }; } diff --git a/plugins/infowidget/chunkdownloadview.cpp b/plugins/infowidget/chunkdownloadview.cpp index 276a311..3258441 100644 --- a/plugins/infowidget/chunkdownloadview.cpp +++ b/plugins/infowidget/chunkdownloadview.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <klocale.h> -#include <qlabel.h> +#include <tqlabel.h> #include <interfaces/chunkdownloadinterface.h> #include <interfaces/functions.h> #include <interfaces/torrentinterface.h> @@ -42,14 +42,14 @@ namespace kt ChunkDownloadInterface::Stats s; cd->getStats(s); - setText(0,QString::number(s.chunk_index)); - setText(1,QString("%1 / %2").arg(s.pieces_downloaded).arg(s.total_pieces)); + setText(0,TQString::number(s.chunk_index)); + setText(1,TQString("%1 / %2").tqarg(s.pieces_downloaded).tqarg(s.total_pieces)); setText(2,s.current_peer_id); setText(3,KBytesPerSecToString(s.download_speed / 1024.0)); - setText(4,QString::number(s.num_downloaders)); + setText(4,TQString::number(s.num_downloaders)); } - int ChunkDownloadViewItem::compare(QListViewItem * i,int col,bool) const + int ChunkDownloadViewItem::compare(TQListViewItem * i,int col,bool) const { ChunkDownloadViewItem* it = (ChunkDownloadViewItem*)i; kt::ChunkDownloadInterface* ocd = it->cd; @@ -61,7 +61,7 @@ namespace kt { case 0: return CompareVal(s.chunk_index,os.chunk_index); case 1: return CompareVal(s.pieces_downloaded,os.pieces_downloaded); - case 2: return QString::compare(s.current_peer_id,os.current_peer_id); + case 2: return TQString::compare(s.current_peer_id,os.current_peer_id); case 3: return CompareVal(s.download_speed,os.download_speed); case 4: return CompareVal(s.num_downloaders,os.num_downloaders); } @@ -69,16 +69,16 @@ namespace kt } - ChunkDownloadView::ChunkDownloadView(QWidget *parent, const char *name) - : ChunkDownloadViewBase(parent, name) + ChunkDownloadView::ChunkDownloadView(TQWidget *tqparent, const char *name) + : ChunkDownloadViewBase(tqparent, name) { m_list_view->setShowSortIndicator(true); m_list_view->setAllColumnsShowFocus(true); - m_list_view->setColumnAlignment(0,Qt::AlignLeft); - m_list_view->setColumnAlignment(1,Qt::AlignCenter); - m_list_view->setColumnAlignment(3,Qt::AlignRight); - m_list_view->setColumnAlignment(4,Qt::AlignRight); + m_list_view->setColumnAlignment(0,TQt::AlignLeft); + m_list_view->setColumnAlignment(1,TQt::AlignCenter); + m_list_view->setColumnAlignment(3,TQt::AlignRight); + m_list_view->setColumnAlignment(4,TQt::AlignRight); curr_tc = 0; } @@ -95,7 +95,7 @@ namespace kt void ChunkDownloadView::removeDownload(kt::ChunkDownloadInterface* cd) { - if (!items.contains(cd)) + if (!items.tqcontains(cd)) return; ChunkDownloadViewItem* it = items[cd]; @@ -121,7 +121,7 @@ namespace kt if (!curr_tc) return; - QMap<ChunkDownloadInterface*,ChunkDownloadViewItem*>::iterator i = items.begin(); + TQMap<ChunkDownloadInterface*,ChunkDownloadViewItem*>::iterator i = items.begin(); while (i != items.end()) { ChunkDownloadViewItem* it = i.data(); @@ -131,24 +131,24 @@ namespace kt m_list_view->sort(); const TorrentStats & s = curr_tc->getStats(); - m_chunks_downloading->setText(QString::number(s.num_chunks_downloading)); - m_chunks_downloaded->setText(QString::number(s.num_chunks_downloaded)); - m_total_chunks->setText(QString::number(s.total_chunks)); - m_excluded_chunks->setText(QString::number(s.num_chunks_excluded)); - m_chunks_left->setText(QString::number(s.num_chunks_left)); + m_chunks_downloading->setText(TQString::number(s.num_chunks_downloading)); + m_chunks_downloaded->setText(TQString::number(s.num_chunks_downloaded)); + m_total_chunks->setText(TQString::number(s.total_chunks)); + m_excluded_chunks->setText(TQString::number(s.num_chunks_excluded)); + m_chunks_left->setText(TQString::number(s.num_chunks_left)); if( s.chunk_size / 1024 < 1024 ) - m_size_chunks->setText(QString::number(s.chunk_size / 1024) + "." + QString::number((s.chunk_size % 1024) / 100) + " KB"); + m_size_chunks->setText(TQString::number(s.chunk_size / 1024) + "." + TQString::number((s.chunk_size % 1024) / 100) + " KB"); else - m_size_chunks->setText(QString::number(s.chunk_size / 1024 / 1024) + "." + QString::number(((s.chunk_size / 1024) % 1024) / 100) + " MB"); + m_size_chunks->setText(TQString::number(s.chunk_size / 1024 / 1024) + "." + TQString::number(((s.chunk_size / 1024) % 1024) / 100) + " MB"); } - void ChunkDownloadView::saveLayout(KConfig* cfg,const QString & group_name) + void ChunkDownloadView::saveLayout(KConfig* cfg,const TQString & group_name) { m_list_view->saveLayout(cfg,group_name); } - void ChunkDownloadView::restoreLayout(KConfig* cfg,const QString & group_name) + void ChunkDownloadView::restoreLayout(KConfig* cfg,const TQString & group_name) { m_list_view->restoreLayout(cfg,group_name); } diff --git a/plugins/infowidget/chunkdownloadview.h b/plugins/infowidget/chunkdownloadview.h index a00a746..860052d 100644 --- a/plugins/infowidget/chunkdownloadview.h +++ b/plugins/infowidget/chunkdownloadview.h @@ -21,7 +21,7 @@ #define BTCHUNKDOWNLOADVIEW_H #include <klistview.h> -#include <qmap.h> +#include <tqmap.h> #include "chunkdownloadviewbase.h" namespace kt @@ -36,7 +36,7 @@ namespace kt ChunkDownloadViewItem(KListView* cdv,kt::ChunkDownloadInterface* cd); void update(); - int compare(QListViewItem * i,int col,bool) const; + int compare(TQListViewItem * i,int col,bool) const; }; @@ -46,15 +46,16 @@ namespace kt class ChunkDownloadView : public ChunkDownloadViewBase { Q_OBJECT + TQ_OBJECT - QMap<kt::ChunkDownloadInterface*,ChunkDownloadViewItem*> items; + TQMap<kt::ChunkDownloadInterface*,ChunkDownloadViewItem*> items; kt::TorrentInterface* curr_tc; public: - ChunkDownloadView(QWidget *parent = 0, const char *name = 0); + ChunkDownloadView(TQWidget *tqparent = 0, const char *name = 0); virtual ~ChunkDownloadView(); - void saveLayout(KConfig* cfg,const QString & group_name); - void restoreLayout(KConfig* cfg,const QString & group_name); + void saveLayout(KConfig* cfg,const TQString & group_name); + void restoreLayout(KConfig* cfg,const TQString & group_name); void clear(); void update(); void changeTC(kt::TorrentInterface* tc); diff --git a/plugins/infowidget/chunkdownloadviewbase.ui b/plugins/infowidget/chunkdownloadviewbase.ui index 24a6e18..d4426b5 100644 --- a/plugins/infowidget/chunkdownloadviewbase.ui +++ b/plugins/infowidget/chunkdownloadviewbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ChunkDownloadViewBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ChunkDownloadViewBase</cstring> </property> @@ -19,23 +19,23 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -43,11 +43,11 @@ <string>Total:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_total_chunks</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -59,21 +59,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -81,11 +81,11 @@ <string>Currently downloading:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_downloading</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -97,21 +97,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -119,11 +119,11 @@ <string>Downloaded:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_downloaded</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -135,21 +135,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout38</cstring> + <cstring>tqlayout38</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -157,11 +157,11 @@ <string>Excluded:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_excluded_chunks</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -173,21 +173,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout38_2</cstring> + <cstring>tqlayout38_2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4_2</cstring> </property> @@ -195,11 +195,11 @@ <string>Left:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_left</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -211,21 +211,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout24</cstring> + <cstring>tqlayout24</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_8</cstring> </property> @@ -233,11 +233,11 @@ <string>Size:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_size_chunks</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>80</width> <height>0</height> @@ -249,7 +249,7 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -265,7 +265,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -338,7 +338,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> </includehints> diff --git a/plugins/infowidget/downloadedchunkbar.cpp b/plugins/infowidget/downloadedchunkbar.cpp index ab87ff7..6e6fe9a 100644 --- a/plugins/infowidget/downloadedchunkbar.cpp +++ b/plugins/infowidget/downloadedchunkbar.cpp @@ -24,8 +24,8 @@ namespace kt { - DownloadedChunkBar::DownloadedChunkBar(QWidget* parent, const char* name) - : ChunkBar(parent,name) + DownloadedChunkBar::DownloadedChunkBar(TQWidget* tqparent, const char* name) + : ChunkBar(tqparent,name) { show_excluded = true; } diff --git a/plugins/infowidget/downloadedchunkbar.h b/plugins/infowidget/downloadedchunkbar.h index 996634f..2b9fce1 100644 --- a/plugins/infowidget/downloadedchunkbar.h +++ b/plugins/infowidget/downloadedchunkbar.h @@ -30,8 +30,9 @@ namespace kt class DownloadedChunkBar : public ChunkBar { Q_OBJECT + TQ_OBJECT public: - DownloadedChunkBar(QWidget* parent, const char* name); + DownloadedChunkBar(TQWidget* tqparent, const char* name); virtual ~DownloadedChunkBar(); virtual const bt::BitSet & getBitSet() const; diff --git a/plugins/infowidget/fileview.cpp b/plugins/infowidget/fileview.cpp index 7fb56a6..9c64960 100644 --- a/plugins/infowidget/fileview.cpp +++ b/plugins/infowidget/fileview.cpp @@ -29,7 +29,7 @@ #include <interfaces/functions.h> #include <interfaces/torrentinterface.h> #include <interfaces/torrentfileinterface.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include "functions.h" #include "iwfiletreeitem.h" #include "iwfiletreediritem.h" @@ -40,10 +40,10 @@ using namespace bt; namespace kt { - FileView::FileView(QWidget *parent, const char *name) - : KListView(parent, name),curr_tc(0),multi_root(0),pending_fill(0),next_fill_item(0) + FileView::FileView(TQWidget *tqparent, const char *name) + : KListView(tqparent, name),curr_tc(0),multi_root(0),pending_fill(0),next_fill_item(0) { - setFrameShape(QFrame::NoFrame); + setFrameShape(TQFrame::NoFrame); addColumn( i18n( "File" ) ); addColumn( i18n( "Size" ) ); addColumn( i18n( "Download" ) ); @@ -69,17 +69,17 @@ namespace kt context_menu->setItemEnabled(dnd_keep_id, false); context_menu->setItemEnabled(dnd_throw_away_id, false); - connect(this,SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint& )), - this,SLOT(showContextMenu(KListView*, QListViewItem*, const QPoint& ))); - connect(context_menu, SIGNAL ( activated ( int ) ), this, SLOT ( contextItem ( int ) ) ); - connect(this,SIGNAL(doubleClicked( QListViewItem*, const QPoint&, int )), - this,SLOT(onDoubleClicked(QListViewItem*, const QPoint&, int))); + connect(this,TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint& )), + this,TQT_SLOT(showContextMenu(KListView*, TQListViewItem*, const TQPoint& ))); + connect(context_menu, TQT_SIGNAL ( activated ( int ) ), this, TQT_SLOT ( contextItem ( int ) ) ); + connect(this,TQT_SIGNAL(doubleClicked( TQListViewItem*, const TQPoint&, int )), + this,TQT_SLOT(onDoubleClicked(TQListViewItem*, const TQPoint&, int))); - connect(&fill_timer, SIGNAL(timeout()), this, SLOT( fillTreePartial() ) ); + connect(&fill_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT( fillTreePartial() ) ); setEnabled(false); - setSelectionMode(QListView::Extended); + setSelectionMode(TQListView::Extended); } @@ -108,8 +108,8 @@ namespace kt multi_root->updatePercentageInformation(); multi_root->updatePreviewInformation(curr_tc); fill_timer.stop(); - connect(curr_tc,SIGNAL(missingFilesMarkedDND( kt::TorrentInterface* )), - this,SLOT(refreshFileTree( kt::TorrentInterface* ))); + connect(curr_tc,TQT_SIGNAL(missingFilesMarkedDND( kt::TorrentInterface* )), + this,TQT_SLOT(refreshFileTree( kt::TorrentInterface* ))); } else fill_timer.start(0,true); @@ -141,8 +141,8 @@ namespace kt item->setPixmap(0,KMimeType::findByPath(s.torrent_name)->pixmap(KIcon::Small)); setEnabled(true); - connect(curr_tc,SIGNAL(missingFilesMarkedDND( kt::TorrentInterface* )), - this,SLOT(refreshFileTree( kt::TorrentInterface* ))); + connect(curr_tc,TQT_SIGNAL(missingFilesMarkedDND( kt::TorrentInterface* )), + this,TQT_SLOT(refreshFileTree( kt::TorrentInterface* ))); } } @@ -173,7 +173,7 @@ namespace kt { if (curr_tc && !curr_tc->getStats().multi_file_torrent) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); if (!it.current()) return; @@ -186,7 +186,7 @@ namespace kt else if (percent > 100.0) percent = 100.0; KLocale* loc = KGlobal::locale(); - it.current()->setText(4,i18n("%1 %").arg(loc->formatNumber(percent,2))); + it.current()->setText(4,i18n("%1 %").tqarg(loc->formatNumber(percent,2))); } } @@ -194,7 +194,7 @@ namespace kt { if (curr_tc && !curr_tc->getStats().multi_file_torrent) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); if (!it.current()) return; @@ -211,14 +211,14 @@ namespace kt } } - void FileView::showContextMenu(KListView* ,QListViewItem*,const QPoint & p) + void FileView::showContextMenu(KListView* ,TQListViewItem*,const TQPoint & p) { const TorrentStats & s = curr_tc->getStats(); // don't show a menu if item is 0 or if it is a directory - QPtrList<QListViewItem> sel = selectedItems(); + TQPtrList<TQListViewItem> sel = selectedItems(); switch(sel.count()) { case 0: @@ -237,7 +237,7 @@ namespace kt return; break; } - QListViewItem* item = sel.getFirst(); + TQListViewItem* item = sel.getFirst(); context_menu->setItemEnabled(first_id, false); context_menu->setItemEnabled(normal_id, false); @@ -321,7 +321,7 @@ namespace kt void FileView::contextItem(int id) { - QPtrList<QListViewItem> sel = selectedItems(); + TQPtrList<TQListViewItem> sel = selectedItems(); Priority newpriority = NORMAL_PRIORITY; if(id == this->preview_id) @@ -338,7 +338,7 @@ namespace kt n = (*sel.begin())->childCount() == 0 ? 1 : 666; } - QString msg = i18n( + TQString msg = i18n( "You will lose all data in this file, are you sure you want to do this ?", "You will lose all data in these files, are you sure you want to do this ?",n); @@ -365,17 +365,17 @@ namespace kt - QPtrList<QListViewItem>::Iterator i = sel.begin(); + TQPtrList<TQListViewItem>::Iterator i = sel.begin(); while(i != sel.end()) { - QListViewItem* item = *i; + TQListViewItem* item = *i; changePriority(item, newpriority); multi_root->updatePriorityInformation(curr_tc); i++; } } - void FileView::changePriority(QListViewItem* item, Priority newpriority) + void FileView::changePriority(TQListViewItem* item, Priority newpriority) { if(item->childCount() == 0) { @@ -396,7 +396,7 @@ namespace kt } return; } - QListViewItem* myChild = item->firstChild(); + TQListViewItem* myChild = item->firstChild(); while( myChild ) { changePriority(myChild, newpriority); @@ -413,7 +413,7 @@ namespace kt multi_root->updateDNDInformation(); } - void FileView::onDoubleClicked(QListViewItem* item,const QPoint & ,int ) + void FileView::onDoubleClicked(TQListViewItem* item,const TQPoint & ,int ) { if (!curr_tc) return; @@ -426,7 +426,7 @@ namespace kt { // file FileTreeItem* file = (FileTreeItem*)item; - QString path = "cache" + bt::DirSeparator() + file->getTorrentFile().getPath(); + TQString path = "cache" + bt::DirSeparator() + file->getTorrentFile().getPath(); new KRun(KURL::fromPathOrURL(curr_tc->getTorDir() + path), 0, true, true); } else @@ -438,7 +438,7 @@ namespace kt } else { - QFileInfo fi(curr_tc->getTorDir()+"cache"); + TQFileInfo fi(curr_tc->getTorDir()+"cache"); new KRun(KURL::fromPathOrURL(fi.readLink()), 0, true, true); } } diff --git a/plugins/infowidget/fileview.h b/plugins/infowidget/fileview.h index 6a827dc..0e06eba 100644 --- a/plugins/infowidget/fileview.h +++ b/plugins/infowidget/fileview.h @@ -22,7 +22,7 @@ #include <klistview.h> #include <util/constants.h> -#include <qtimer.h> +#include <tqtimer.h> namespace kt { @@ -35,32 +35,33 @@ namespace kt class FileView : public KListView { Q_OBJECT + TQ_OBJECT public: - FileView(QWidget *parent = 0, const char *name = 0); + FileView(TQWidget *tqparent = 0, const char *name = 0); virtual ~FileView(); void update(); void changeTC(kt::TorrentInterface* tc); private slots: void contextItem(int id); - void showContextMenu(KListView* ,QListViewItem* item,const QPoint & p); + void showContextMenu(KListView* ,TQListViewItem* item,const TQPoint & p); void refreshFileTree(kt::TorrentInterface* tc); - void onDoubleClicked(QListViewItem* item,const QPoint & ,int ); + void onDoubleClicked(TQListViewItem* item,const TQPoint & ,int ); void fillTreePartial(); private: void fillFileTree(); void readyPreview(); void readyPercentage(); - void changePriority(QListViewItem* item, bt::Priority newpriority); + void changePriority(TQListViewItem* item, bt::Priority newpriority); private: kt::TorrentInterface* curr_tc; IWFileTreeDirItem* multi_root; bool pending_fill; KPopupMenu* context_menu; - QString preview_path; - QTimer fill_timer; + TQString preview_path; + TQTimer fill_timer; int preview_id; int first_id; int normal_id; diff --git a/plugins/infowidget/flagdb.cpp b/plugins/infowidget/flagdb.cpp index 140a3b7..ceea6fc 100644 --- a/plugins/infowidget/flagdb.cpp +++ b/plugins/infowidget/flagdb.cpp @@ -17,17 +17,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qimage.h> +#include <tqfile.h> +#include <tqimage.h> #include <kstandarddirs.h> #include "flagdb.h" -kt::FlagDBSource::FlagDBSource(const char* type, const QString& pathPattern) +kt::FlagDBSource::FlagDBSource(const char* type, const TQString& pathPattern) : type(type), pathPattern(pathPattern) { } -kt::FlagDBSource::FlagDBSource(const QString& pathPattern) +kt::FlagDBSource::FlagDBSource(const TQString& pathPattern) : type(NULL), pathPattern(pathPattern) { } @@ -37,16 +37,16 @@ kt::FlagDBSource::FlagDBSource() { } -QString kt::FlagDBSource::FlagDBSource::getPath(const QString& country) const +TQString kt::FlagDBSource::FlagDBSource::getPath(const TQString& country) const { if (type) { - return locate(type, pathPattern.arg(country)); + return locate(type, pathPattern.tqarg(country)); } else { - return pathPattern.arg(country); + return pathPattern.tqarg(country); } } -const QPixmap& kt::FlagDB::nullPixmap = QPixmap(); +const TQPixmap& kt::FlagDB::nullPixmap = TQPixmap(); kt::FlagDB::FlagDB(int preferredWidth, int preferredHeight) : preferredWidth(preferredWidth), @@ -74,33 +74,33 @@ void kt::FlagDB::addFlagSource(const FlagDBSource& source) sources.append(source); } -void kt::FlagDB::addFlagSource(const char* type, const QString& pathPattern) +void kt::FlagDB::addFlagSource(const char* type, const TQString& pathPattern) { addFlagSource(FlagDBSource(type, pathPattern)); } -const QValueList<kt::FlagDBSource>& kt::FlagDB::listSources() const +const TQValueList<kt::FlagDBSource>& kt::FlagDB::listSources() const { return sources; } -bool kt::FlagDB::isFlagAvailable(const QString& country) +bool kt::FlagDB::isFlagAvailable(const TQString& country) { return getFlag(country).isNull(); } -const QPixmap& kt::FlagDB::getFlag(const QString& country) +const TQPixmap& kt::FlagDB::getFlag(const TQString& country) { - const QString& c = country.lower(); - if (!db.contains(c)) { - QImage img; - QPixmap pixmap; - for (QValueList<FlagDBSource>::const_iterator it = sources.constBegin(); it != sources.constEnd(); it++) { - const QString& path = (*it).getPath(c); - if (QFile::exists(path)) { + const TQString& c = country.lower(); + if (!db.tqcontains(c)) { + TQImage img; + TQPixmap pixmap; + for (TQValueList<FlagDBSource>::const_iterator it = sources.constBegin(); it != sources.constEnd(); it++) { + const TQString& path = (*it).getPath(c); + if (TQFile::exists(path)) { if (img.load(path)) { if (img.width() != preferredWidth || img.height() != preferredHeight) { - const QImage& imgScaled = img.smoothScale(preferredWidth, preferredHeight, QImage::ScaleMin); + const TQImage& imgScaled = img.smoothScale(preferredWidth, preferredHeight, TQ_ScaleMin); if (!imgScaled.isNull()) { pixmap.convertFromImage(imgScaled); break; diff --git a/plugins/infowidget/flagdb.h b/plugins/infowidget/flagdb.h index f2524ab..9002671 100644 --- a/plugins/infowidget/flagdb.h +++ b/plugins/infowidget/flagdb.h @@ -19,10 +19,10 @@ #ifndef FLAGDB_H #define FLAGDB_H -#include <qpixmap.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> namespace kt { @@ -30,16 +30,16 @@ namespace kt { public: FlagDBSource(); - FlagDBSource(const char* type, const QString& pathPattern); - FlagDBSource(const QString& pathPattern); - QString getPath(const QString& country) const; + FlagDBSource(const char* type, const TQString& pathPattern); + FlagDBSource(const TQString& pathPattern); + TQString getPath(const TQString& country) const; const char* getType() { return type; }; - const QString& getPathPattern() { return pathPattern; }; + const TQString& getPathPattern() { return pathPattern; }; private: const char* type; - const QString pathPattern; + const TQString pathPattern; }; /** @@ -53,15 +53,15 @@ namespace kt ~FlagDB(); void addFlagSource(const FlagDBSource& source); - void addFlagSource(const char* type, const QString& pathPattern); - const QValueList<FlagDBSource>& listSources() const; - bool isFlagAvailable(const QString& country); - const QPixmap& getFlag(const QString& country); + void addFlagSource(const char* type, const TQString& pathPattern); + const TQValueList<FlagDBSource>& listSources() const; + bool isFlagAvailable(const TQString& country); + const TQPixmap& getFlag(const TQString& country); private: - static const QPixmap& nullPixmap; + static const TQPixmap& nullPixmap; int preferredWidth, preferredHeight; - QValueList<FlagDBSource> sources; - QMap<QString,QPixmap> db; + TQValueList<FlagDBSource> sources; + TQMap<TQString,TQPixmap> db; }; } diff --git a/plugins/infowidget/floatspinbox.cpp b/plugins/infowidget/floatspinbox.cpp index 8b78981..d498d7d 100644 --- a/plugins/infowidget/floatspinbox.cpp +++ b/plugins/infowidget/floatspinbox.cpp @@ -22,16 +22,16 @@ #include <kglobal.h> #include <klocale.h> -#include <qlineedit.h> +#include <tqlineedit.h> #include "floatspinbox.h" #include "localefloatvalidator.h" kt::FloatSpinBox::FloatSpinBox( - QWidget * parent, + TQWidget * tqparent, const char * name ) - :QSpinBox( -100, 100, 1, parent, name), + :TQSpinBox( -100, 100, 1, tqparent, name), m_precision_digits( 2 ), m_value(0.0f), m_minValue(0.0f), @@ -39,19 +39,19 @@ kt::FloatSpinBox::FloatSpinBox( m_useRange(false), m_oldIntVal(0) { - QSpinBox::setValue(0); + TQSpinBox::setValue(0); setStep( 0.25f ); - connect(this, SIGNAL(valueChanged ( int )), this, SLOT(internalValueChanged( int ))); - setValidator( new LocaleFloatValidator( dynamic_cast<QSpinBox * > (this) )); - editor()->setAlignment(Qt::AlignRight); + connect(this, TQT_SIGNAL(valueChanged ( int )), this, TQT_SLOT(internalValueChanged( int ))); + setValidator( new LocaleFloatValidator( TQT_TQOBJECT(dynamic_cast<TQSpinBox * > (this)) )); + editor()->tqsetAlignment(TQt::AlignRight); } kt::FloatSpinBox::FloatSpinBox( int precision, - QWidget * parent, + TQWidget * tqparent, const char * name ) - :QSpinBox( -100, 100, 1, parent, name), + :TQSpinBox( -100, 100, 1, tqparent, name), m_precision_digits( precision ), m_value(0.0f), m_minValue(0.0f), @@ -59,10 +59,10 @@ kt::FloatSpinBox::FloatSpinBox( m_useRange(false), m_oldIntVal(0) { - QSpinBox::setValue(0); + TQSpinBox::setValue(0); setStep( 0.25 ); - connect(this, SIGNAL(valueChanged ( int )), this, SLOT(internalValueChanged( int ))); - setValidator( new LocaleFloatValidator( dynamic_cast<QSpinBox * > (this) )); + connect(this, TQT_SIGNAL(valueChanged ( int )), this, TQT_SLOT(internalValueChanged( int ))); + setValidator( new LocaleFloatValidator( TQT_TQOBJECT(dynamic_cast<TQSpinBox * > (this)) )); } @@ -71,10 +71,10 @@ kt::FloatSpinBox::FloatSpinBox( float maxValue, float step, int precision, - QWidget * parent, + TQWidget * tqparent, const char * name ) - :QSpinBox( -100, 100, 1, parent, name), + :TQSpinBox( -100, 100, 1, tqparent, name), m_precision_digits( precision ), m_value(0.0f), m_minValue(minValue), @@ -82,27 +82,27 @@ kt::FloatSpinBox::FloatSpinBox( m_useRange(true), m_oldIntVal(0) { - QSpinBox::setValue(0); + TQSpinBox::setValue(0); setValue(0.0f); setStep( step ); - connect(this, SIGNAL(valueChanged ( int )), this, SLOT(internalValueChanged( int ))); - setValidator( new LocaleFloatValidator( this )); + connect(this, TQT_SIGNAL(valueChanged ( int )), this, TQT_SLOT(internalValueChanged( int ))); + setValidator( new LocaleFloatValidator( TQT_TQOBJECT(this) )); } -QString kt::FloatSpinBox::mapValueToText( int value ) +TQString kt::FloatSpinBox::mapValueToText( int value ) { - /// This is called from QSpinBox, which passes an int. - /// As we don't use the QSpinBox's internal value, we ignore it. - QString t = KGlobal::locale()->formatNumber( m_value, m_precision_digits); + /// This is called from TQSpinBox, which passes an int. + /// As we don't use the TQSpinBox's internal value, we ignore it. + TQString t = KGlobal::locale()->formatNumber( m_value, m_precision_digits); editor()->setText(t); return t; } int kt::FloatSpinBox::mapTextToValue( bool * ok ) { - /// This is called from QSpinBox, which needs an int for return. - /// As we don't use the QSpinBox's internal value, we only return 0. + /// This is called from TQSpinBox, which needs an int for return. + /// As we don't use the TQSpinBox's internal value, we only return 0. float value = KGlobal::locale()->readNumber(text(), ok); if (*ok) @@ -183,7 +183,7 @@ void kt::FloatSpinBox::setStep( float step) void kt::FloatSpinBox::internalValueChanged( int value ) { /// The step buttons won't work without tracking the - /// QSpinbox's value changes. + /// TQSpinbox's value changes. if ( value > m_oldIntVal) { diff --git a/plugins/infowidget/floatspinbox.h b/plugins/infowidget/floatspinbox.h index 42545bc..8aa4dc8 100644 --- a/plugins/infowidget/floatspinbox.h +++ b/plugins/infowidget/floatspinbox.h @@ -22,7 +22,7 @@ #ifndef FLOATSPINBOX_H #define FLOATSPINBOX_H -#include <qspinbox.h> +#include <tqspinbox.h> namespace kt { @@ -31,21 +31,22 @@ namespace kt * @author Jonas Widarsson * * A Spinbox for float values which respects KGlobal::locale(). - * QSpinBox's internal integer value is only + * TQSpinBox's internal integer value is only * used for step detection. */ - class FloatSpinBox : public QSpinBox + class FloatSpinBox : public TQSpinBox { Q_OBJECT + TQ_OBJECT public: - FloatSpinBox( QWidget* parent=0, const char* name=0 ); - FloatSpinBox( int precision = 2, QWidget* parent=0, const char* name=0 ); + FloatSpinBox( TQWidget* tqparent=0, const char* name=0 ); + FloatSpinBox( int precision = 2, TQWidget* tqparent=0, const char* name=0 ); FloatSpinBox( float minValue, float maxValue, float step = 0.5, int precision = 2, - QWidget* parent=0, const char* name=0 ); + TQWidget* tqparent=0, const char* name=0 ); virtual ~FloatSpinBox(); - QString mapValueToText( int value ); + TQString mapValueToText( int value ); int mapTextToValue( bool *ok ); diff --git a/plugins/infowidget/infowidgetplugin.cpp b/plugins/infowidget/infowidgetplugin.cpp index 4957c48..cbd30ef 100644 --- a/plugins/infowidget/infowidgetplugin.cpp +++ b/plugins/infowidget/infowidgetplugin.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qscrollview.h> +#include <tqscrollview.h> #include <kgenericfactory.h> #include <kglobal.h> #include <klocale.h> @@ -47,8 +47,8 @@ namespace kt { - InfoWidgetPlugin::InfoWidgetPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Info Widget"),AUTHOR,EMAIL, + InfoWidgetPlugin::InfoWidgetPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Info Widget"),AUTHOR,EMAIL, i18n("Shows additional information about a download. Like which chunks have been downloaded, how many seeders and leechers ..."), "ktinfowidget") { @@ -73,7 +73,7 @@ namespace kt pref = new InfoWidgetPrefPage(this); getGUI()->addViewListener(this); - getGUI()->addToolWidget(status_tab,"info",i18n("Status"),GUIInterface::DOCK_BOTTOM); + getGUI()->addToolWidget(status_tab,"info",i18n("tqStatus"),GUIInterface::DOCK_BOTTOM); getGUI()->addToolWidget(file_view,"folder",i18n("Files"),GUIInterface::DOCK_BOTTOM); showPeerView( InfoWidgetPluginSettings::showPeerView() ); @@ -157,7 +157,7 @@ namespace kt createMonitor(tc); } - bool InfoWidgetPlugin::versionCheck(const QString & version) const + bool InfoWidgetPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } @@ -216,8 +216,8 @@ namespace kt tracker_view->changeTC(const_cast<kt::TorrentInterface*>(getGUI()->getCurrentTorrent())); // seeing that a merge of the trackers might happen after a torrent has been loaded // we need to update the tracker_view - connect(getCore(),SIGNAL(loadingFinished(const KURL&, bool, bool)), - tracker_view,SLOT(onLoadingFinished(const KURL&, bool, bool))); + connect(getCore(),TQT_SIGNAL(loadingFinished(const KURL&, bool, bool)), + tracker_view,TQT_SLOT(onLoadingFinished(const KURL&, bool, bool))); } else if (!show && tracker_view) { diff --git a/plugins/infowidget/infowidgetplugin.h b/plugins/infowidget/infowidgetplugin.h index 9e08e75..cb6702c 100644 --- a/plugins/infowidget/infowidgetplugin.h +++ b/plugins/infowidget/infowidgetplugin.h @@ -42,15 +42,16 @@ namespace kt class InfoWidgetPlugin : public Plugin,public ViewListener { Q_OBJECT + TQ_OBJECT public: - InfoWidgetPlugin(QObject* parent, const char* name, const QStringList& args); + InfoWidgetPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~InfoWidgetPlugin(); virtual void load(); virtual void unload(); virtual void guiUpdate(); virtual void currentTorrentChanged(TorrentInterface* tc); - virtual bool versionCheck(const QString & version) const; + virtual bool versionCheck(const TQString & version) const; ///Show PeerView in main window void showPeerView(bool show); diff --git a/plugins/infowidget/infowidgetprefpage.cpp b/plugins/infowidget/infowidgetprefpage.cpp index 16e1384..2fa7f4e 100644 --- a/plugins/infowidget/infowidgetprefpage.cpp +++ b/plugins/infowidget/infowidgetprefpage.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <klocale.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> #include <kglobal.h> #include <kiconloader.h> #include "infowidgetplugin.h" @@ -53,9 +53,9 @@ namespace kt return true; } - void InfoWidgetPrefPage::createWidget(QWidget* parent) + void InfoWidgetPrefPage::createWidget(TQWidget* tqparent) { - pref = new IWPref(parent); + pref = new IWPref(tqparent); updateData(); } diff --git a/plugins/infowidget/infowidgetprefpage.h b/plugins/infowidget/infowidgetprefpage.h index a1fa40f..89ab56b 100644 --- a/plugins/infowidget/infowidgetprefpage.h +++ b/plugins/infowidget/infowidgetprefpage.h @@ -41,7 +41,7 @@ namespace kt virtual ~InfoWidgetPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void deleteWidget(); virtual void updateData(); diff --git a/plugins/infowidget/iwfiletreediritem.cpp b/plugins/infowidget/iwfiletreediritem.cpp index 1ddf899..c1eee32 100644 --- a/plugins/infowidget/iwfiletreediritem.cpp +++ b/plugins/infowidget/iwfiletreediritem.cpp @@ -33,13 +33,13 @@ using namespace kt; namespace kt { - IWFileTreeDirItem::IWFileTreeDirItem(KListView* klv,const QString & name) + IWFileTreeDirItem::IWFileTreeDirItem(KListView* klv,const TQString & name) : kt::FileTreeDirItem(klv,name) { } - IWFileTreeDirItem::IWFileTreeDirItem(IWFileTreeDirItem* parent,const QString & name) - : kt::FileTreeDirItem(parent,name) + IWFileTreeDirItem::IWFileTreeDirItem(IWFileTreeDirItem* tqparent,const TQString & name) + : kt::FileTreeDirItem(tqparent,name) { } @@ -51,8 +51,8 @@ namespace kt void IWFileTreeDirItem::updatePercentageInformation() { // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { IWFileTreeItem* item = (IWFileTreeItem*)i->second; item->updatePercentageInformation(); @@ -60,7 +60,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { ((IWFileTreeDirItem*)j->second)->updatePercentageInformation(); @@ -71,8 +71,8 @@ namespace kt void IWFileTreeDirItem::updatePreviewInformation(kt::TorrentInterface* tc) { // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { IWFileTreeItem* item = (IWFileTreeItem*)i->second; item->updatePreviewInformation(tc); @@ -80,7 +80,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { ((IWFileTreeDirItem*)j->second)->updatePreviewInformation(tc); @@ -91,11 +91,11 @@ namespace kt Priority IWFileTreeDirItem::updatePriorityInformation(kt::TorrentInterface* tc) { // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); bool setpriority = false; bool oneexcluded = false; Priority priority = PREVIEW_PRIORITY; - if(i != children.end()) + if(i != tqchildren.end()) { IWFileTreeItem* item = (IWFileTreeItem*)i->second; item->updatePriorityInformation(tc); @@ -105,7 +105,7 @@ namespace kt oneexcluded = true; setpriority = true; } - while (i != children.end()) + while (i != tqchildren.end()) { IWFileTreeItem* item = (IWFileTreeItem*)i->second; item->updatePriorityInformation(tc); @@ -117,8 +117,8 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); - if(j != subdirs.end() && children.begin() == children.end()) + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); + if(j != subdirs.end() && tqchildren.begin() == tqchildren.end()) { Priority priority = ((IWFileTreeDirItem*)j->second)->updatePriorityInformation(tc); @@ -176,12 +176,12 @@ namespace kt return PREVIEW_PRIORITY; } - FileTreeItem* IWFileTreeDirItem::newFileTreeItem(const QString & name,TorrentFileInterface & file) + FileTreeItem* IWFileTreeDirItem::newFileTreeItem(const TQString & name,TorrentFileInterface & file) { return new IWFileTreeItem(this,name,file); } - FileTreeDirItem* IWFileTreeDirItem::newFileTreeDirItem(const QString & subdir) + FileTreeDirItem* IWFileTreeDirItem::newFileTreeDirItem(const TQString & subdir) { return new IWFileTreeDirItem(this,subdir); } @@ -189,8 +189,8 @@ namespace kt void IWFileTreeDirItem::updateDNDInformation() { // first set all the child items - bt::PtrMap<QString,FileTreeItem>::iterator i = children.begin(); - while (i != children.end()) + bt::PtrMap<TQString,FileTreeItem>::iterator i = tqchildren.begin(); + while (i != tqchildren.end()) { IWFileTreeItem* item = (IWFileTreeItem*)i->second; item->updateDNDInformation(); @@ -198,7 +198,7 @@ namespace kt } // then recursivly move on to subdirs - bt::PtrMap<QString,FileTreeDirItem>::iterator j = subdirs.begin(); + bt::PtrMap<TQString,FileTreeDirItem>::iterator j = subdirs.begin(); while (j != subdirs.end()) { ((IWFileTreeDirItem*)j->second)->updateDNDInformation(); @@ -209,8 +209,8 @@ namespace kt bt::ConfirmationResult IWFileTreeDirItem::confirmationDialog() { return bt::KEEP_DATA; -/* QString msg = i18n("Do you want to keep the existing data for seeding ?"); - int ret = KMessageBox::warningYesNoCancel(0,msg,QString::null, +/* TQString msg = i18n("Do you want to keep the existing data for seeding ?"); + int ret = KMessageBox::warningYesNoCancel(0,msg,TQString(), KGuiItem(i18n("Keep the data")), KGuiItem(i18n("Delete the data"))); if (ret == KMessageBox::Yes) diff --git a/plugins/infowidget/iwfiletreediritem.h b/plugins/infowidget/iwfiletreediritem.h index 90aa7ea..3c26031 100644 --- a/plugins/infowidget/iwfiletreediritem.h +++ b/plugins/infowidget/iwfiletreediritem.h @@ -49,8 +49,8 @@ namespace kt class IWFileTreeDirItem : public kt::FileTreeDirItem { public: - IWFileTreeDirItem(KListView* klv,const QString & name); - IWFileTreeDirItem(IWFileTreeDirItem* parent,const QString & name); + IWFileTreeDirItem(KListView* klv,const TQString & name); + IWFileTreeDirItem(IWFileTreeDirItem* tqparent,const TQString & name); virtual ~IWFileTreeDirItem(); /** @@ -71,8 +71,8 @@ namespace kt */ void updateDNDInformation(); - virtual kt::FileTreeItem* newFileTreeItem(const QString & name, kt::TorrentFileInterface & file); - virtual kt::FileTreeDirItem* newFileTreeDirItem(const QString & subdir); + virtual kt::FileTreeItem* newFileTreeItem(const TQString & name, kt::TorrentFileInterface & file); + virtual kt::FileTreeDirItem* newFileTreeDirItem(const TQString & subdir); virtual bt::ConfirmationResult confirmationDialog(); }; } diff --git a/plugins/infowidget/iwfiletreeitem.cpp b/plugins/infowidget/iwfiletreeitem.cpp index e6281df..fbfdb4b 100644 --- a/plugins/infowidget/iwfiletreeitem.cpp +++ b/plugins/infowidget/iwfiletreeitem.cpp @@ -33,19 +33,19 @@ using namespace kt; namespace kt { - IWFileTreeItem::IWFileTreeItem(IWFileTreeDirItem* item,const QString & name,kt::TorrentFileInterface & file) + IWFileTreeItem::IWFileTreeItem(IWFileTreeDirItem* item,const TQString & name,kt::TorrentFileInterface & file) : FileTreeItem(item,name,file) { perc_complete = 0.0; - connect(&file,SIGNAL(downloadPercentageChanged( float )),this,SLOT(onPercentageUpdated( float ))); - connect(&file,SIGNAL(previewAvailable( bool )),this,SLOT(onPreviewAvailable( bool ))); + connect(&file,TQT_SIGNAL(downloadPercentageChanged( float )),this,TQT_SLOT(onPercentageUpdated( float ))); + connect(&file,TQT_SIGNAL(previewAvailable( bool )),this,TQT_SLOT(onPreviewAvailable( bool ))); } IWFileTreeItem::~IWFileTreeItem() { } - int IWFileTreeItem::compare(QListViewItem* i, int col, bool ascending) const + int IWFileTreeItem::compare(TQListViewItem* i, int col, bool ascending) const { if (col == 4) { @@ -92,7 +92,7 @@ namespace kt else if (percent > 100.0) percent = 100.0; KLocale* loc = KGlobal::locale(); - setText(4,i18n("%1 %").arg(loc->formatNumber(percent,2))); + setText(4,i18n("%1 %").tqarg(loc->formatNumber(percent,2))); perc_complete = percent; } @@ -147,8 +147,8 @@ namespace kt { return bt::KEEP_DATA; /* - QString msg = i18n("Do you want to keep the existing data for seeding ?"); - int ret = KMessageBox::warningYesNoCancel(0,msg,QString::null, + TQString msg = i18n("Do you want to keep the existing data for seeding ?"); + int ret = KMessageBox::warningYesNoCancel(0,msg,TQString(), KGuiItem(i18n("Keep the data")), KGuiItem(i18n("Delete the data"))); if (ret == KMessageBox::Yes) diff --git a/plugins/infowidget/iwfiletreeitem.h b/plugins/infowidget/iwfiletreeitem.h index 7877ff1..4810f92 100644 --- a/plugins/infowidget/iwfiletreeitem.h +++ b/plugins/infowidget/iwfiletreeitem.h @@ -20,7 +20,7 @@ #ifndef IWFILETREEITEM_H #define IWFILETREEITEM_H -#include <qobject.h> +#include <tqobject.h> #include <interfaces/filetreeitem.h> using namespace bt; @@ -36,13 +36,14 @@ namespace kt * * File item in the InfoWidget's file view. */ - class IWFileTreeItem : public QObject, public kt::FileTreeItem + class IWFileTreeItem : public TQObject, public kt::FileTreeItem { Q_OBJECT + TQ_OBJECT double perc_complete; public: - IWFileTreeItem(IWFileTreeDirItem* item,const QString & name,kt::TorrentFileInterface & file); + IWFileTreeItem(IWFileTreeDirItem* item,const TQString & name,kt::TorrentFileInterface & file); virtual ~IWFileTreeItem(); void updatePreviewInformation(kt::TorrentInterface* tc); @@ -50,7 +51,7 @@ namespace kt void updatePriorityInformation(kt::TorrentInterface* tc); void updateDNDInformation(); protected: - virtual int compare(QListViewItem* i, int col, bool ascending) const; + virtual int compare(TQListViewItem* i, int col, bool ascending) const; virtual bt::ConfirmationResult confirmationDialog(); protected slots: diff --git a/plugins/infowidget/iwpref.ui b/plugins/infowidget/iwpref.ui index 1007259..3973143 100644 --- a/plugins/infowidget/iwpref.ui +++ b/plugins/infowidget/iwpref.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>IWPref</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>IWPref</cstring> </property> @@ -16,7 +16,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>m_show_pv</cstring> </property> @@ -27,7 +27,7 @@ <string></string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>m_show_cdv</cstring> </property> @@ -45,14 +45,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>21</height> </size> </property> </spacer> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>m_show_tv</cstring> </property> @@ -65,5 +65,5 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/infowidget/localefloatvalidator.cpp b/plugins/infowidget/localefloatvalidator.cpp index 7faafed..f0c20ae 100644 --- a/plugins/infowidget/localefloatvalidator.cpp +++ b/plugins/infowidget/localefloatvalidator.cpp @@ -23,16 +23,16 @@ #include <klocale.h> #include "localefloatvalidator.h" -kt::LocaleFloatValidator::LocaleFloatValidator( QObject * parent, const char * name ) -:QValidator(parent, name) +kt::LocaleFloatValidator::LocaleFloatValidator( TQObject * tqparent, const char * name ) +:TQValidator(tqparent, name) { - QString decimalPoint = QRegExp::escape(KGlobal::locale()->decimalSymbol()); + TQString decimalPoint = TQRegExp::escape(KGlobal::locale()->decimalSymbol()); regexp.setPattern("^-?\\d*(" + decimalPoint + "\\d*)?$"); } -QValidator::State kt::LocaleFloatValidator::validate( QString & str, int & pos) const +TQValidator::State kt::LocaleFloatValidator::validate( TQString & str, int & pos) const { - return regexp.exactMatch(str) ? QValidator::Acceptable : QValidator::Invalid; + return regexp.exactMatch(str) ? TQValidator::Acceptable : TQValidator::Invalid; } diff --git a/plugins/infowidget/localefloatvalidator.h b/plugins/infowidget/localefloatvalidator.h index d4d12ee..3466445 100644 --- a/plugins/infowidget/localefloatvalidator.h +++ b/plugins/infowidget/localefloatvalidator.h @@ -22,23 +22,24 @@ #ifndef LOCALEFLOATVALIDATOR_H #define LOCALEFLOATVALIDATOR_H -#include <qvalidator.h> -class QRegExp; +#include <tqvalidator.h> +class TQRegExp; namespace kt{ /** * @author Jonas Widarsson * * A float validator that respects KLocale::decimalSymbol() */ - class LocaleFloatValidator : public QValidator + class LocaleFloatValidator : public TQValidator { Q_OBJECT + TQ_OBJECT public: - LocaleFloatValidator( QObject * parent, const char *name = 0 ); + LocaleFloatValidator( TQObject * tqparent, const char *name = 0 ); - virtual QValidator::State validate( QString & str, int & pos) const; + virtual TQValidator::State validate( TQString & str, int & pos) const; private: - QRegExp regexp; + TQRegExp regexp; }; } diff --git a/plugins/infowidget/peerview.cpp b/plugins/infowidget/peerview.cpp index 0e05791..a3876c6 100644 --- a/plugins/infowidget/peerview.cpp +++ b/plugins/infowidget/peerview.cpp @@ -27,8 +27,8 @@ #include <kstandarddirs.h> #include <kmessagebox.h> #include <ksocketaddress.h> -#include <qpoint.h> -#include <qlistview.h> +#include <tqpoint.h> +#include <tqlistview.h> #include <kpopupmenu.h> #include <interfaces/peerinterface.h> #include <interfaces/functions.h> @@ -53,13 +53,13 @@ namespace kt Uint32 PeerViewItem::pvi_count = 0; // Global GeoIP pointer, gets destroyed when no PeerViewItem's exist static GeoIP* geo_ip = 0; - static QPixmap yes_pix; - static QPixmap no_pix; - static QPixmap lock_pix; + static TQPixmap yes_pix; + static TQPixmap no_pix; + static TQPixmap lock_pix; static FlagDB flagDB(22, 18); static bool yes_no_pix_loaded = false; static bool geoip_db_exists = true; - static QString geoip_data_file; + static TQString geoip_data_file; PeerViewItem::PeerViewItem(PeerView* pv,kt::PeerInterface* peer) : KListViewItem(pv),peer(peer) { @@ -67,8 +67,8 @@ namespace kt { KIconLoader* iload = KGlobal::iconLoader(); /* Prefer builtin flag images to the ones provided by KDE */ - flagDB.addFlagSource("data", QString("ktorrent/geoip/%1.png")); - flagDB.addFlagSource("locale", QString("l10n/%1/flag.png")); + flagDB.addFlagSource("data", TQString("ktorrent/geoip/%1.png")); + flagDB.addFlagSource("locale", TQString("l10n/%1/flag.png")); yes_pix = iload->loadIcon("button_ok",KIcon::Small); no_pix = iload->loadIcon("button_cancel",KIcon::Small); lock_pix = iload->loadIcon("ktencrypted",KIcon::Small); @@ -111,7 +111,7 @@ namespace kt country_code = GeoIP_country_code[country_id]; country_name = GeoIP_country_name[country_id]; setText(1, country_name); - m_country = QString(country_name); + m_country = TQString(country_name); } else { @@ -170,16 +170,16 @@ namespace kt setText(5,s.choked ? i18n("Yes") : i18n("No")); //setPixmap(6,!s.snubbed ? yes_pix : no_pix); setText(6,s.snubbed ? i18n("Yes") : i18n("No")); - setText(7,QString("%1 %").arg(loc->formatNumber(s.perc_of_file,2))); + setText(7,TQString("%1 %").tqarg(loc->formatNumber(s.perc_of_file,2))); setPixmap(8,s.dht_support ? yes_pix : no_pix); setText(9,loc->formatNumber(s.aca_score,2)); - setPixmap(10,s.has_upload_slot ? yes_pix : QPixmap()); - setText(11,QString("%1 / %2").arg(s.num_down_requests).arg(s.num_up_requests)); + setPixmap(10,s.has_upload_slot ? yes_pix : TQPixmap()); + setText(11,TQString("%1 / %2").tqarg(s.num_down_requests).tqarg(s.num_up_requests)); setText(12, BytesToString(s.bytes_downloaded)); setText(13, BytesToString(s.bytes_uploaded)); } - int PeerViewItem::compare(QListViewItem * i,int col,bool) const + int PeerViewItem::compare(TQListViewItem * i,int col,bool) const { PeerViewItem* pvi = (PeerViewItem*) i; PeerInterface* op = pvi->peer; @@ -188,9 +188,9 @@ namespace kt switch (col) { case 0: return CompareVal(ip,pvi->ip); // use numeric representation to sort - //return QString::compare(s.ip_address,os.ip_address); - case 1: return QString::compare(m_country, pvi->m_country); - case 2: return QString::compare(s.client,os.client); + //return TQString::compare(s.ip_address,os.ip_address); + case 1: return TQString::compare(m_country, pvi->m_country); + case 2: return TQString::compare(s.client,os.client); case 3: return CompareVal(s.download_rate,os.download_rate); case 4: return CompareVal(s.upload_rate,os.upload_rate); case 5: return CompareVal(s.choked,os.choked); @@ -207,8 +207,8 @@ namespace kt return 0; } - PeerView::PeerView(QWidget *parent, const char *name) - : KListView(parent, name) + PeerView::PeerView(TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { addColumn(i18n("IP")); addColumn(i18n("Country")); @@ -228,20 +228,20 @@ namespace kt setAllColumnsShowFocus(true); setShowSortIndicator(true); - setColumnAlignment(3,Qt::AlignRight); - setColumnAlignment(4,Qt::AlignRight); - setColumnAlignment(5,Qt::AlignCenter); - setColumnAlignment(6,Qt::AlignCenter); - setColumnAlignment(7,Qt::AlignRight); - setColumnAlignment(8,Qt::AlignCenter); - setColumnAlignment(9,Qt::AlignRight); - setColumnAlignment(10,Qt::AlignCenter); - setColumnAlignment(11,Qt::AlignCenter); - setColumnAlignment(12,Qt::AlignRight); - setColumnAlignment(13,Qt::AlignRight); + setColumnAlignment(3,TQt::AlignRight); + setColumnAlignment(4,TQt::AlignRight); + setColumnAlignment(5,TQt::AlignCenter); + setColumnAlignment(6,TQt::AlignCenter); + setColumnAlignment(7,TQt::AlignRight); + setColumnAlignment(8,TQt::AlignCenter); + setColumnAlignment(9,TQt::AlignRight); + setColumnAlignment(10,TQt::AlignCenter); + setColumnAlignment(11,TQt::AlignCenter); + setColumnAlignment(12,TQt::AlignRight); + setColumnAlignment(13,TQt::AlignRight); for (Uint32 i = 0;i < (Uint32)columns();i++) - setColumnWidthMode(i,QListView::Manual); + setColumnWidthMode(i,TQListView::Manual); setShowSortIndicator(true); @@ -249,10 +249,10 @@ namespace kt kick_id = menu->insertItem(KGlobal::iconLoader()->loadIcon("delete_user", KIcon::NoGroup), i18n("to kick", "Kick peer")); ban_id = menu->insertItem(KGlobal::iconLoader()->loadIcon("filter",KIcon::NoGroup), i18n("to ban", "Ban peer")); - connect(this,SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint& )), - this,SLOT(showContextMenu(KListView*, QListViewItem*, const QPoint& ))); - connect(menu, SIGNAL ( activated ( int ) ), this, SLOT ( contextItem ( int ) ) ); - setFrameShape(QFrame::NoFrame); + connect(this,TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint& )), + this,TQT_SLOT(showContextMenu(KListView*, TQListViewItem*, const TQPoint& ))); + connect(menu, TQT_SIGNAL ( activated ( int ) ), this, TQT_SLOT ( contextItem ( int ) ) ); + setFrameShape(TQFrame::NoFrame); } @@ -267,7 +267,7 @@ namespace kt void PeerView::removePeer(kt::PeerInterface* peer) { - QMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.find(peer); + TQMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.tqfind(peer); if (it == items.end()) { return; @@ -290,7 +290,7 @@ namespace kt IPBlocklist& filter = IPBlocklist::instance(); const PeerInterface::Stats & s = peer->getStats(); KNetwork::KIpAddress ip(s.ip_address); - QString ips = ip.toString(); + TQString ips = ip.toString(); /** * @TODO Clean this up. * this whole mess was because of KNetwork classes @@ -314,7 +314,7 @@ namespace kt void PeerView::update() { - QMap<kt::PeerInterface*,PeerViewItem*>::iterator i = items.begin(); + TQMap<kt::PeerInterface*,PeerViewItem*>::iterator i = items.begin(); while (i != items.end()) { PeerViewItem* it = i.data(); @@ -330,7 +330,7 @@ namespace kt clear(); } - void PeerView::showContextMenu( KListView*, QListViewItem* item, const QPoint& p) + void PeerView::showContextMenu( KListView*, TQListViewItem* item, const TQPoint& p) { if(!item) return; diff --git a/plugins/infowidget/peerview.h b/plugins/infowidget/peerview.h index a4a8b94..e7e403b 100644 --- a/plugins/infowidget/peerview.h +++ b/plugins/infowidget/peerview.h @@ -20,11 +20,11 @@ #ifndef PEERVIEW_H #define PEERVIEW_H -#include <qmap.h> +#include <tqmap.h> #include <klistview.h> -#include <qlistview.h> +#include <tqlistview.h> #include <kpopupmenu.h> -#include <qpoint.h> +#include <tqpoint.h> #include <util/constants.h> namespace kt @@ -35,7 +35,7 @@ namespace kt class PeerViewItem : public KListViewItem { kt::PeerInterface* peer; - QString m_country; + TQString m_country; bt::Uint32 ip; // counter to keep track of how many PeerViewItem objects are in existence static bt::Uint32 pvi_count; @@ -44,7 +44,7 @@ namespace kt virtual ~PeerViewItem(); void update(); - int compare(QListViewItem * i,int col,bool) const; + int compare(TQListViewItem * i,int col,bool) const; kt::PeerInterface* getPeer() { return peer; } }; @@ -55,10 +55,11 @@ namespace kt class PeerView : public KListView { Q_OBJECT + TQ_OBJECT - QMap<kt::PeerInterface*,PeerViewItem*> items; + TQMap<kt::PeerInterface*,PeerViewItem*> items; public: - PeerView(QWidget *parent = 0, const char *name = 0); + PeerView(TQWidget *tqparent = 0, const char *name = 0); virtual ~PeerView(); public slots: @@ -68,7 +69,7 @@ namespace kt void kickPeer(kt::PeerInterface* peer); void update(); void removeAll(); - void showContextMenu(KListView* ,QListViewItem* item,const QPoint & p); + void showContextMenu(KListView* ,TQListViewItem* item,const TQPoint & p); void contextItem(int id); private: KPopupMenu* menu; diff --git a/plugins/infowidget/statustab.cpp b/plugins/infowidget/statustab.cpp index b0974ed..0fc6f16 100644 --- a/plugins/infowidget/statustab.cpp +++ b/plugins/infowidget/statustab.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ #include <math.h> #include <float.h> -#include <qdatetime.h> -#include <qcheckbox.h> +#include <tqdatetime.h> +#include <tqcheckbox.h> #include <kglobal.h> #include <klocale.h> #include <interfaces/functions.h> @@ -34,10 +34,10 @@ namespace kt { - StatusTab::StatusTab(QWidget* parent, const char* name, WFlags fl) - : StatusTabBase(parent,name,fl),curr_tc(0) + StatusTab::StatusTab(TQWidget* tqparent, const char* name, WFlags fl) + : StatusTabBase(tqparent,name,fl),curr_tc(0) { - QColorGroup cg = colorGroup(); + TQColorGroup cg = tqcolorGroup(); // do not use hardcoded colors m_info_caption->setPaletteBackgroundColor(cg.mid()); m_chunks_caption->setPaletteBackgroundColor(cg.mid()); @@ -46,15 +46,15 @@ namespace kt maxRatio->setMinValue(0.0f); maxRatio->setMaxValue(100.0f); maxRatio->setStep(0.1f); - connect(maxRatio, SIGNAL(valueHasChanged()), this, SLOT(maxRatioReturnPressed())); - connect(useLimit, SIGNAL( toggled(bool) ), this, SLOT( useLimitToggled(bool) ) ); + connect(maxRatio, TQT_SIGNAL(valueHasChanged()), this, TQT_SLOT(maxRatioReturnPressed())); + connect(useLimit, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( useLimitToggled(bool) ) ); maxTime->setMinValue(0.0f); maxTime->setMaxValue(10000000.0f); maxTime->setStep(0.05f); maxTime->setSpecialValueText(i18n("No limit")); - connect(useTimeLimit,SIGNAL(toggled(bool)), this,SLOT(useTimeLimitToggled(bool))); - connect(maxTime,SIGNAL(valueHasChanged()), this, SLOT(timeValueChanged())); + connect(useTimeLimit,TQT_SIGNAL(toggled(bool)), this,TQT_SLOT(useTimeLimitToggled(bool))); + connect(maxTime,TQT_SIGNAL(valueHasChanged()), this, TQT_SLOT(timeValueChanged())); int h = (int)ceil(fontMetrics().height()*1.25); m_chunk_bar->setFixedHeight(h); @@ -130,7 +130,7 @@ namespace kt if (s.running) { - QTime t; + TQTime t; t = t.addSecs(curr_tc->getTimeToNextTrackerUpdate()); m_tracker_update_time->setText(t.toString("mm:ss")); } @@ -141,17 +141,17 @@ namespace kt m_tracker_status->setText(s.trackerstatus); - m_seeders->setText(QString("%1 (%2)") - .arg(s.seeders_connected_to).arg(s.seeders_total)); + m_seeders->setText(TQString("%1 (%2)") + .tqarg(s.seeders_connected_to).tqarg(s.seeders_total)); - m_leechers->setText(QString("%1 (%2)") - .arg(s.leechers_connected_to).arg(s.leechers_total)); + m_leechers->setText(TQString("%1 (%2)") + .tqarg(s.leechers_connected_to).tqarg(s.leechers_total)); float ratio = kt::ShareRatio(s); if(!maxRatio->hasFocus() && useLimit->isChecked()) maxRatioUpdate(); - m_share_ratio->setText(QString("<font color=\"%1\">%2</font>").arg(ratio <= 0.8 ? "#ff0000" : "#1c9a1c").arg(KGlobal::locale()->formatNumber(ratio,2))); + m_share_ratio->setText(TQString("<font color=\"%1\">%2</font>").tqarg(ratio <= 0.8 ? "#ff0000" : "#1c9a1c").tqarg(KGlobal::locale()->formatNumber(ratio,2))); Uint32 secs = curr_tc->getRunningTimeUL(); if (secs == 0) diff --git a/plugins/infowidget/statustab.h b/plugins/infowidget/statustab.h index 14e987d..b747596 100644 --- a/plugins/infowidget/statustab.h +++ b/plugins/infowidget/statustab.h @@ -30,9 +30,10 @@ namespace kt class StatusTab : public StatusTabBase { Q_OBJECT + TQ_OBJECT public: - StatusTab(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + StatusTab(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); virtual ~StatusTab(); diff --git a/plugins/infowidget/statustabbase.ui b/plugins/infowidget/statustabbase.ui index 179f68a..3ef85e8 100644 --- a/plugins/infowidget/statustabbase.ui +++ b/plugins/infowidget/statustabbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>StatusTabBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>StatusTabBase</cstring> </property> @@ -13,13 +13,13 @@ </rect> </property> <property name="caption"> - <string>Status</string> + <string>tqStatus</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_info_caption</cstring> </property> @@ -39,23 +39,23 @@ <string>Info</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout16</cstring> + <cstring>tqlayout16</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout15</cstring> + <cstring>tqlayout15</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -63,7 +63,7 @@ <string>Seeders:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_6</cstring> </property> @@ -71,11 +71,11 @@ <string>Leechers:</string> </property> </widget> - <widget class="QLabel" row="1" column="1"> + <widget class="TQLabel" row="1" column="1"> <property name="name"> <cstring>m_seeders</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -87,15 +87,15 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>m_leechers</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -107,21 +107,21 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -129,11 +129,11 @@ <string>Average Down Speed:</string> </property> </widget> - <widget class="QLabel" row="1" column="1"> + <widget class="TQLabel" row="1" column="1"> <property name="name"> <cstring>m_avg_down</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -145,15 +145,15 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>m_avg_up</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -165,11 +165,11 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_7</cstring> </property> @@ -179,15 +179,15 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout12</cstring> + <cstring>tqlayout12</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel3_2</cstring> </property> @@ -195,19 +195,19 @@ <string>Next update in:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1_5</cstring> </property> <property name="text"> - <string>Tracker Status:</string> + <string>Tracker tqStatus:</string> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>m_tracker_status</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -219,15 +219,15 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QLabel" row="1" column="1"> + <widget class="TQLabel" row="1" column="1"> <property name="name"> <cstring>m_tracker_update_time</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -239,7 +239,7 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -255,7 +255,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>207</width> <height>20</height> @@ -264,31 +264,31 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout17</cstring> + <cstring>tqlayout17</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout23</cstring> + <cstring>tqlayout23</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout25</cstring> + <cstring>tqlayout25</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_chunks_caption</cstring> </property> @@ -316,7 +316,7 @@ <string>Chunks</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -344,14 +344,14 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>20</height> </size> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -379,7 +379,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>20</height> @@ -398,7 +398,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> @@ -429,15 +429,15 @@ <enum>Vertical</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout16</cstring> + <cstring>tqlayout16</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_sharing_caption</cstring> </property> @@ -457,9 +457,9 @@ <string>Sharing</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout15</cstring> + <cstring>tqlayout15</cstring> </property> <grid> <property name="name"> @@ -477,7 +477,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>20</width> <height>0</height> @@ -487,7 +487,7 @@ <string>Your upload will stop when share ratio gets to this value. Zero means no limit.</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel3_3</cstring> </property> @@ -495,9 +495,9 @@ <string>Share ratio:</string> </property> </widget> - <widget class="QLayoutWidget" row="2" column="1"> + <widget class="TQLayoutWidget" row="2" column="1"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> @@ -515,7 +515,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>20</width> <height>0</height> @@ -525,7 +525,7 @@ <string>Your upload will stop when you have uploaded for this many hours.</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_9</cstring> </property> @@ -535,7 +535,7 @@ </widget> </hbox> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>useLimit</cstring> </property> @@ -549,7 +549,7 @@ <string>Limit works only in seed mode</string> </property> </widget> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>useTimeLimit</cstring> </property> @@ -557,11 +557,11 @@ <string>Time &limit:</string> </property> </widget> - <widget class="QLabel" row="0" column="1"> + <widget class="TQLabel" row="0" column="1"> <property name="name"> <cstring>m_share_ratio</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>50</width> <height>0</height> @@ -573,7 +573,7 @@ <property name="text"> <string></string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -589,7 +589,7 @@ <property name="sizeType"> <enum>MinimumExpanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -657,7 +657,7 @@ <data format="XBM.GZ" length="79">789c534e494dcbcc4b554829cdcdad8c2fcf4c29c95030e0524611cd48cd4ccf28010a1797249664262b2467241641a592324b8aa363156c15aab914146aadb90067111b1f</data> </image> </images> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>downloadedchunkbar.h</includehint> <includehint>availabilitychunkbar.h</includehint> diff --git a/plugins/infowidget/trackerview.cpp b/plugins/infowidget/trackerview.cpp index 2339189..0c23548 100644 --- a/plugins/infowidget/trackerview.cpp +++ b/plugins/infowidget/trackerview.cpp @@ -21,13 +21,13 @@ #include <interfaces/torrentinterface.h> #include <interfaces/trackerslist.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qlabel.h> -#include <qlistview.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qtooltip.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqlistview.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> #include <klocale.h> #include <kurl.h> @@ -43,8 +43,8 @@ namespace kt { - TrackerView::TrackerView(QWidget *parent, const char *name) - :TrackerViewBase(parent, name), tc(0) + TrackerView::TrackerView(TQWidget *tqparent, const char *name) + :TrackerViewBase(tqparent, name), tc(0) { KIconLoader* iload = KGlobal::iconLoader(); btnUpdate->setIconSet(iload->loadIconSet("apply", KIcon::Small)); @@ -52,8 +52,8 @@ namespace kt btnRemove->setIconSet(iload->loadIconSet("remove", KIcon::Small)); btnRestore->setIconSet(iload->loadIconSet("undo", KIcon::Small)); - QPalette p = lblCurrent->palette(); - p.setColor(QPalette::Active,QColorGroup::Base,p.color(QPalette::Active,QColorGroup::Background)); + TQPalette p = lblCurrent->palette(); + p.setColor(TQPalette::Active,TQColorGroup::Base,p.color(TQPalette::Active,TQColorGroup::Background)); lblCurrent->setPalette(p); } @@ -79,13 +79,13 @@ namespace kt return; } - new QListViewItem(listTrackers, txtTracker->text()); + new TQListViewItem(listTrackers, txtTracker->text()); tc->getTrackersList()->addTracker(url,true); } void TrackerView::btnRemove_clicked() { - QListViewItem* current = listTrackers->currentItem(); + TQListViewItem* current = listTrackers->currentItem(); if(!current) return; @@ -98,7 +98,7 @@ namespace kt void TrackerView::btnChange_clicked() { - QListViewItem* current = listTrackers->currentItem(); + TQListViewItem* current = listTrackers->currentItem(); if(!current) return; @@ -120,7 +120,7 @@ namespace kt return; for (KURL::List::const_iterator i = trackers.begin();i != trackers.end();i++) - new QListViewItem(listTrackers, (*i).prettyURL()); + new TQListViewItem(listTrackers, (*i).prettyURL()); } void TrackerView::btnUpdate_clicked() @@ -131,7 +131,7 @@ namespace kt tc->updateTracker(); } - void TrackerView::listTrackers_currentChanged(QListViewItem* item) + void TrackerView::listTrackers_currentChanged(TQListViewItem* item) { if(!item) txtTracker->clear(); @@ -157,7 +157,7 @@ namespace kt const TorrentStats & s = tc->getStats(); if (s.running) { - QTime t; + TQTime t; t = t.addSecs(tc->getTimeToNextTrackerUpdate()); lblUpdate->setText(t.toString("mm:ss")); } @@ -167,17 +167,17 @@ namespace kt // only enable change when we can actually change and the torrent is running btnChange->setEnabled(s.running && listTrackers->childCount() > 1); - lblStatus->setText("<b>" + s.trackerstatus + "</b>"); + lbltqStatus->setText("<b>" + s.trackerstatus + "</b>"); if (tc->getTrackersList()) { - QString t = tc->getTrackersList()->getTrackerURL().prettyURL(); + TQString t = tc->getTrackersList()->getTrackerURL().prettyURL(); if (lblCurrent->text() != t ) lblCurrent->setText(t); } else lblCurrent->clear(); - btnAdd->setEnabled(txtTracker->text() != QString::null && !tc->getStats().priv_torrent); + btnAdd->setEnabled(txtTracker->text() != TQString() && !tc->getStats().priv_torrent); } void TrackerView::onLoadingFinished(const KURL & ,bool,bool) @@ -191,7 +191,7 @@ namespace kt listTrackers->clear(); if(!tc) { - lblStatus->clear(); + lbltqStatus->clear(); lblCurrent->clear(); lblUpdate->clear(); txtTracker->clear(); @@ -226,12 +226,12 @@ namespace kt const KURL::List trackers = tc->getTrackersList()->getTrackerURLs(); if(trackers.empty()) { - new QListViewItem(listTrackers, tc->getTrackersList()->getTrackerURL().prettyURL()); + new TQListViewItem(listTrackers, tc->getTrackersList()->getTrackerURL().prettyURL()); } else { for (KURL::List::const_iterator i = trackers.begin();i != trackers.end();i++) - new QListViewItem(listTrackers, (*i).prettyURL()); + new TQListViewItem(listTrackers, (*i).prettyURL()); } btnUpdate->setEnabled(s.running && tc->announceAllowed()); diff --git a/plugins/infowidget/trackerview.h b/plugins/infowidget/trackerview.h index fd23fb8..9499e4b 100644 --- a/plugins/infowidget/trackerview.h +++ b/plugins/infowidget/trackerview.h @@ -35,8 +35,9 @@ namespace kt class TrackerView: public TrackerViewBase { Q_OBJECT + TQ_OBJECT public: - TrackerView(QWidget *parent = 0, const char *name = 0); + TrackerView(TQWidget *tqparent = 0, const char *name = 0); virtual ~TrackerView(); void update(); @@ -48,7 +49,7 @@ namespace kt virtual void btnChange_clicked(); virtual void btnRemove_clicked(); virtual void btnAdd_clicked(); - virtual void listTrackers_currentChanged(QListViewItem*); + virtual void listTrackers_currentChanged(TQListViewItem*); void onLoadingFinished(const KURL & ,bool,bool); private: diff --git a/plugins/infowidget/trackerviewbase.ui b/plugins/infowidget/trackerviewbase.ui index 758ddc7..cbdbce5 100644 --- a/plugins/infowidget/trackerviewbase.ui +++ b/plugins/infowidget/trackerviewbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>TrackerViewBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>TrackerViewBase</cstring> </property> @@ -24,7 +24,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit" row="1" column="0"> + <widget class="TQLineEdit" row="1" column="0"> <property name="name"> <cstring>txtTracker</cstring> </property> @@ -48,9 +48,9 @@ <string>Add Trac&ker</string> </property> </widget> - <widget class="QLayoutWidget" row="2" column="1"> + <widget class="TQLayoutWidget" row="2" column="1"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <vbox> <property name="name"> @@ -67,7 +67,7 @@ <string></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnChange</cstring> </property> @@ -85,7 +85,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>68</height> @@ -127,15 +127,15 @@ <bool>true</bool> </property> </widget> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -151,7 +151,7 @@ <string>URL:</string> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>lblCurrent</cstring> </property> @@ -180,14 +180,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -200,12 +200,12 @@ </sizepolicy> </property> <property name="text"> - <string>Status:</string> + <string>tqStatus:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> - <cstring>lblStatus</cstring> + <cstring>lbltqStatus</cstring> </property> <property name="sizePolicy"> <sizepolicy> @@ -229,14 +229,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -252,7 +252,7 @@ <string>Next update in:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>lblUpdate</cstring> </property> @@ -298,15 +298,15 @@ <slot>btnRestore_clicked()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnChange_clicked()</slot> - <slot>listTrackers_currentChanged(QListViewItem*)</slot> + <slot>listTrackers_currentChanged(TQListViewItem*)</slot> <slot>btnUpdate_clicked()</slot> <slot>btnAdd_clicked()</slot> <slot>btnRemove_clicked()</slot> <slot>btnRestore_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/plugins/ipfilter/antip2p.cpp b/plugins/ipfilter/antip2p.cpp index 28f9b24..b3755ec 100644 --- a/plugins/ipfilter/antip2p.cpp +++ b/plugins/ipfilter/antip2p.cpp @@ -28,8 +28,8 @@ #include <kglobal.h> #include <kstandarddirs.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> using namespace bt; @@ -46,7 +46,7 @@ namespace kt return ip1 < b.ip1;// a and b intersect } - Uint32 AntiP2P::toUint32(const QString& ip) + Uint32 AntiP2P::toUint32(const TQString& ip) { bool test; Uint32 ret = ip.section('.',0,0).toULongLong(&test); @@ -60,26 +60,26 @@ namespace kt return ret; } - QString fromUint32(Uint32 ip) + TQString fromUint32(Uint32 ip) { Uint32 tmp = ip; - QString out; + TQString out; tmp = ip; tmp &= 0x000000FF; - out.prepend(QString("%1").arg(tmp)); + out.prepend(TQString("%1").tqarg(tmp)); ip >>= 8; tmp = ip; tmp &= 0x000000FF; - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); ip >>= 8; tmp = ip; tmp &= 0x000000FF; - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); ip >>= 8; tmp = ip; tmp &= 0x000000FF; - out.prepend(QString("%1.").arg(tmp)); + out.prepend(TQString("%1.").tqarg(tmp)); return out; } @@ -152,7 +152,7 @@ namespace kt return file != 0; } - bool AntiP2P::isBlockedIP(const QString& ip ) + bool AntiP2P::isBlockedIP(const TQString& ip ) { Uint32 test = toUint32(ip); return isBlockedIP(test); diff --git a/plugins/ipfilter/antip2p.h b/plugins/ipfilter/antip2p.h index 48350e3..ce54c53 100644 --- a/plugins/ipfilter/antip2p.h +++ b/plugins/ipfilter/antip2p.h @@ -24,8 +24,8 @@ #include <util/mmapfile.h> #include <util/constants.h> -#include <qvaluelist.h> -#include <qstring.h> +#include <tqvaluelist.h> +#include <tqstring.h> namespace kt { @@ -70,9 +70,9 @@ namespace kt /** * Checks if specified IP is listed in filter file. * @return TRUE if IP should be blocked, FALSE otherwise - * @param ip QString representation of IP to be checked + * @param ip TQString representation of IP to be checked **/ - bool isBlockedIP(const QString& ip); + bool isBlockedIP(const TQString& ip); /** * Overloaded function. Uses Uint32 IP to be checked @@ -80,13 +80,13 @@ namespace kt bool isBlockedIP(bt::Uint32& ip); /** - * This function converts QString IP to Uint32 format. + * This function converts TQString IP to Uint32 format. **/ - static bt::Uint32 toUint32(const QString& ip); + static bt::Uint32 toUint32(const TQString& ip); private: bt::MMapFile* file; - QValueList<HeaderBlock> blocks; + TQValueList<HeaderBlock> blocks; ///Is AntiP2P header loaded bool header_loaded; diff --git a/plugins/ipfilter/convert_dlg.ui b/plugins/ipfilter/convert_dlg.ui index cc246ed..b63b4f7 100644 --- a/plugins/ipfilter/convert_dlg.ui +++ b/plugins/ipfilter/convert_dlg.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ConvertingDlg</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>ConvertingDlg</cstring> </property> @@ -33,7 +33,7 @@ <property name="resizeMode"> <enum>Fixed</enum> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -46,14 +46,14 @@ <property name="scaledContents"> <bool>false</bool> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> <property name="indent"> <number>-2</number> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>lbl_progress</cstring> </property> @@ -73,22 +73,22 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>390</width> <height>0</height> </size> </property> </widget> - <widget class="QLayoutWidget" row="3" column="0"> + <widget class="TQLayoutWidget" row="3" column="0"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>label1</cstring> </property> @@ -96,7 +96,7 @@ <string></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnClose</cstring> </property> @@ -112,7 +112,7 @@ <string>&Close</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnCancel</cstring> </property> @@ -146,11 +146,11 @@ <slot>btnCancel_clicked()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnClose_clicked()</slot> <slot>btnCancel_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kprogress.h</includehint> </includehints> diff --git a/plugins/ipfilter/convertdialog.cpp b/plugins/ipfilter/convertdialog.cpp index 6fed40f..c8fef33 100644 --- a/plugins/ipfilter/convertdialog.cpp +++ b/plugins/ipfilter/convertdialog.cpp @@ -34,15 +34,15 @@ #include <torrent/globals.h> #include <interfaces/coreinterface.h> -#include <qfile.h> -#include <qstringlist.h> -#include <qtextstream.h> -#include <qregexp.h> -#include <qvalidator.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qevent.h> -#include <qurloperator.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqvalidator.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqevent.h> +#include <tqurloperator.h> #include "antip2p.h" using namespace bt; @@ -51,7 +51,7 @@ namespace kt { - Uint32 toUint32(QString& ip) + Uint32 toUint32(TQString& ip) { bool test; Uint32 ret = ip.section('.',0,0).toULongLong(&test); @@ -65,17 +65,17 @@ namespace kt return ret; } - IPBlock RangeToBlock(const QString& range) + IPBlock RangeToBlock(const TQString& range) { IPBlock block; - QStringList ls = QStringList::split('-', range); + TQStringList ls = TQStringList::split('-', range); block.ip1 = toUint32(ls[0]); block.ip2 = toUint32(ls[1]); return block; } - ConvertDialog::ConvertDialog( IPFilterPlugin* p, QWidget *parent, const char *name ) - : ConvertingDlg( parent, name ) + ConvertDialog::ConvertDialog( IPFilterPlugin* p, TQWidget *tqparent, const char *name ) + : ConvertingDlg( tqparent, name ) { m_plugin = p; btnClose->setText(i18n("Convert")); @@ -87,9 +87,9 @@ namespace kt void ConvertDialog::convert() { - QFile source( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.txt" ); - QFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" ); - QFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp" ); + TQFile source( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.txt" ); + TQFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" ); + TQFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp" ); if(target.exists()) { @@ -98,7 +98,7 @@ namespace kt } /* READ INPUT FILE */ - QValueList<IPBlock> list; + TQValueList<IPBlock> list; lbl_progress->setText( i18n( "Loading txt file..." ) ); label1->setText( i18n("Please wait...") ); ulong source_size = source.size(); @@ -109,12 +109,12 @@ namespace kt if ( source.open( IO_ReadOnly ) ) { - QTextStream stream( &source ); + TQTextStream stream( &source ); kProgress1->setEnabled(true); int i = 0; - QRegExp rx( "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}-[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}-[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}" ); + TQRegExpValidator v( rx, 0 ); int poz = 0; while ( !stream.atEnd() ) @@ -123,13 +123,13 @@ namespace kt return; KApplication::kApplication() ->processEvents(); - QString line = stream.readLine(); + TQString line = stream.readLine(); i += line.length() * sizeof( char ); //rough estimation of string size kProgress1->setProgress( i * 100 / source_size ); ++i; - QString ip_part = line.section( ':' , -1 ); - if ( v.validate( ip_part, poz ) != QValidator::Acceptable ) + TQString ip_part = line.section( ':' , -1 ); + if ( v.validate( ip_part, poz ) != TQValidator::Acceptable ) continue; else ++counter; @@ -172,7 +172,7 @@ namespace kt Out(SYS_IPF|LOG_NOTICE) << "Loading finished. Starting conversion..." << endl; - QValueList<IPBlock>::iterator iter; + TQValueList<IPBlock>::iterator iter; int i = 0; for (iter = list.begin(); iter != list.end(); ++iter, ++i) { @@ -226,7 +226,7 @@ namespace kt this->close(); } - void ConvertDialog::closeEvent(QCloseEvent* e) + void ConvertDialog::closeEvent(TQCloseEvent* e) { if(!converting) e->accept(); @@ -238,11 +238,11 @@ namespace kt { if(converting) { - QFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" ); + TQFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" ); if(target.exists()) target.remove(); - QFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp"); + TQFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp"); if(temp.exists()) { KIO::NetAccess::file_copy(KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", -1, true); diff --git a/plugins/ipfilter/convertdialog.h b/plugins/ipfilter/convertdialog.h index be451f3..53eab64 100644 --- a/plugins/ipfilter/convertdialog.h +++ b/plugins/ipfilter/convertdialog.h @@ -23,16 +23,17 @@ #include "convert_dlg.h" #include "ipfilterplugin.h" -#include <qevent.h> +#include <tqevent.h> namespace kt { class ConvertDialog: public ConvertingDlg { Q_OBJECT + TQ_OBJECT public: - ConvertDialog( IPFilterPlugin* p, QWidget *parent = 0, const char *name = 0 ); + ConvertDialog( IPFilterPlugin* p, TQWidget *tqparent = 0, const char *name = 0 ); public slots: virtual void btnClose_clicked(); @@ -45,7 +46,7 @@ namespace kt bool canceled; private slots: - void closeEvent(QCloseEvent* e); + void closeEvent(TQCloseEvent* e); virtual void btnCancel_clicked(); }; } diff --git a/plugins/ipfilter/ipblockingpref.ui b/plugins/ipfilter/ipblockingpref.ui index 43870f0..afb13c0 100644 --- a/plugins/ipfilter/ipblockingpref.ui +++ b/plugins/ipfilter/ipblockingpref.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>IPBlockingPref</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>IPBlockingPref</cstring> </property> @@ -29,14 +29,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -50,7 +50,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>checkUseLevel1</cstring> </property> @@ -61,15 +61,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -90,9 +90,9 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -108,14 +108,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>361</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnDownload</cstring> </property> @@ -125,7 +125,7 @@ </widget> </hbox> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -134,7 +134,7 @@ NOTE: ZIP file from bluetack.co.uk is supported.</string> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>lbl_status1</cstring> </property> @@ -152,7 +152,7 @@ NOTE: ZIP file from bluetack.co.uk is supported.</string> <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -191,12 +191,12 @@ NOTE: ZIP file from bluetack.co.uk is supported.</string> <slot>setEnabled(bool)</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnDownload_clicked()</slot> <slot>checkUseLevel1_toggled(bool)</slot> <slot>checkUseKTfilter_toggled(bool)</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/plugins/ipfilter/ipblockingprefpage.cpp b/plugins/ipfilter/ipblockingprefpage.cpp index 6d06d1b..41d427d 100644 --- a/plugins/ipfilter/ipblockingprefpage.cpp +++ b/plugins/ipfilter/ipblockingprefpage.cpp @@ -40,14 +40,14 @@ #include <torrent/globals.h> #include <interfaces/coreinterface.h> -#include <qthread.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qregexp.h> -#include <qvalidator.h> -#include <qlayout.h> -#include <qdialog.h> -#include <qobject.h> +#include <tqthread.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqregexp.h> +#include <tqvalidator.h> +#include <tqlayout.h> +#include <tqdialog.h> +#include <tqobject.h> using namespace bt; @@ -55,11 +55,11 @@ using namespace bt; namespace kt { - IPBlockingPrefPageWidget::IPBlockingPrefPageWidget(QWidget* parent) : IPBlockingPref(parent) + IPBlockingPrefPageWidget::IPBlockingPrefPageWidget(TQWidget* tqparent) : IPBlockingPref(tqparent) { m_url->setURL(IPBlockingPluginSettings::filterURL()); if (m_url->url() == "") - m_url->setURL(QString("http://www.bluetack.co.uk/config/splist.zip")); + m_url->setURL(TQString("http://www.bluetack.co.uk/config/splist.zip")); bool use_level1 = IPBlockingPluginSettings::useLevel1(); @@ -67,13 +67,13 @@ namespace kt if(use_level1) { - lbl_status1->setText(i18n("Status: Loaded and running.")); + lbl_status1->setText(i18n("tqStatus: Loaded and running.")); m_url->setEnabled(true); btnDownload->setEnabled(true); } else { - lbl_status1->setText(i18n("Status: Not loaded.")); + lbl_status1->setText(i18n("tqStatus: Not loaded.")); m_url->setEnabled(false); btnDownload->setEnabled(false); } @@ -89,21 +89,21 @@ namespace kt if(checkUseLevel1->isChecked()) { - QFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat"); + TQFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat"); if(target.exists()) - lbl_status1->setText(i18n("Status: Loaded and running.")); + lbl_status1->setText(i18n("tqStatus: Loaded and running.")); else - lbl_status1->setText(i18n("Status: <font color=\"#ff0000\">Filter file not found.</font> Download and convert filter file.")); + lbl_status1->setText(i18n("tqStatus: <font color=\"#ff0000\">Filter file not found.</font> Download and convert filter file.")); } else - lbl_status1->setText(i18n("Status: Not loaded.")); + lbl_status1->setText(i18n("tqStatus: Not loaded.")); } void IPBlockingPrefPageWidget::btnDownload_clicked() { - QString target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1"); - QFile target_file(target); - QFile txtfile(target + ".txt"); + TQString target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1"); + TQFile target_file(target); + TQFile txtfile(target + ".txt"); KURL url(m_url->url()); KURL dest(target); KURL temp(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp"); @@ -132,8 +132,8 @@ namespace kt } else { - QString err = KIO::NetAccess::lastErrorString(); - if(err != QString::null) + TQString err = KIO::NetAccess::lastErrorString(); + if(err != TQString()) KMessageBox::error(0,KIO::NetAccess::lastErrorString(),i18n("Error")); else KIO::NetAccess::move(temp, target); @@ -188,7 +188,7 @@ namespace kt void IPBlockingPrefPageWidget::convert() { - QFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat"); + TQFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat"); if(target.exists()) { if((KMessageBox::questionYesNo(this,i18n("Filter file (level1.dat) already exists, do you want to convert it again?"),i18n("File Exists")) == 4)) @@ -240,9 +240,9 @@ namespace kt return true; } - void IPBlockingPrefPage::createWidget(QWidget* parent) + void IPBlockingPrefPage::createWidget(TQWidget* tqparent) { - widget = new IPBlockingPrefPageWidget(parent); + widget = new IPBlockingPrefPageWidget(tqparent); widget->setPlugin(m_plugin); widget->setPrefPage(this); } diff --git a/plugins/ipfilter/ipblockingprefpage.h b/plugins/ipfilter/ipblockingprefpage.h index 3779965..7626bea 100644 --- a/plugins/ipfilter/ipblockingprefpage.h +++ b/plugins/ipfilter/ipblockingprefpage.h @@ -25,8 +25,8 @@ #include "ipblockingpref.h" #include "ipfilterplugin.h" #include <interfaces/coreinterface.h> -#include <qthread.h> -#include <qobject.h> +#include <tqthread.h> +#include <tqobject.h> class KProgress; @@ -41,7 +41,7 @@ namespace kt class IPBlockingPrefPageWidget : public IPBlockingPref { public: - IPBlockingPrefPageWidget(QWidget *parent = 0); + IPBlockingPrefPageWidget(TQWidget *tqparent = 0); void apply(); void convert(); void setPlugin(IPFilterPlugin* p); @@ -70,7 +70,7 @@ namespace kt virtual ~IPBlockingPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/ipfilter/ipfilterplugin.cpp b/plugins/ipfilter/ipfilterplugin.cpp index 2f53197..8381226 100644 --- a/plugins/ipfilter/ipfilterplugin.cpp +++ b/plugins/ipfilter/ipfilterplugin.cpp @@ -25,7 +25,7 @@ #include <util/constants.h> #include <torrent/ipblocklist.h> -#include <qstring.h> +#include <tqstring.h> #include "ipfilterplugin.h" #include "ipfilterpluginsettings.h" @@ -37,13 +37,13 @@ K_EXPORT_COMPONENT_FACTORY(ktipfilterplugin,KGenericFactory<kt::IPFilterPlugin>( namespace kt { - const QString NAME = "IP Filter"; - const QString AUTHOR = "Ivan Vasic"; - const QString EMAIL = "[email protected]"; - const QString DESCRIPTION = i18n("Filters out unwanted peers based on their IP address"); + const TQString NAME = "IP Filter"; + const TQString AUTHOR = "Ivan Vasic"; + const TQString EMAIL = "[email protected]"; + const TQString DESCRIPTION = i18n("Filters out unwanted peers based on their IP address"); - IPFilterPlugin::IPFilterPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("IP Filter"),AUTHOR,EMAIL,DESCRIPTION,"filter") + IPFilterPlugin::IPFilterPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("IP Filter"),AUTHOR,EMAIL,DESCRIPTION,"filter") { // setXMLFile("ktpluginui.rc"); level1 = 0; @@ -114,7 +114,7 @@ namespace kt return true; } - bool IPFilterPlugin::isBlockedIP(const QString& ip) + bool IPFilterPlugin::isBlockedIP(const TQString& ip) { if (level1 == 0) return false; @@ -122,7 +122,7 @@ namespace kt return level1->isBlockedIP(ip); } - bool IPFilterPlugin::versionCheck(const QString & version) const + bool IPFilterPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/ipfilter/ipfilterplugin.h b/plugins/ipfilter/ipfilterplugin.h index 2e9c984..d016ee9 100644 --- a/plugins/ipfilter/ipfilterplugin.h +++ b/plugins/ipfilter/ipfilterplugin.h @@ -27,7 +27,7 @@ #include "ipblockingprefpage.h" #include "antip2p.h" -class QString; +class TQString; namespace kt { @@ -42,8 +42,9 @@ namespace kt class IPFilterPlugin : public Plugin, public kt::IPBlockingInterface { Q_OBJECT + TQ_OBJECT public: - IPFilterPlugin(QObject* parent, const char* name, const QStringList& args); + IPFilterPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~IPFilterPlugin(); virtual void load(); @@ -60,9 +61,9 @@ namespace kt ///Checks if IP is listed in AntiP2P filter list. - bool isBlockedIP(const QString& ip); + bool isBlockedIP(const TQString& ip); - bool versionCheck(const QString & version) const; + bool versionCheck(const TQString & version) const; private: IPBlockingPrefPage* pref; AntiP2P* level1; diff --git a/plugins/logviewer/logflags.cpp b/plugins/logviewer/logflags.cpp index ef1ba69..c6ab95b 100644 --- a/plugins/logviewer/logflags.cpp +++ b/plugins/logviewer/logflags.cpp @@ -24,7 +24,7 @@ #include <util/log.h> #include <torrent/globals.h> -#include <qstring.h> +#include <tqstring.h> using namespace bt; @@ -137,7 +137,7 @@ namespace kt m_log = log; } - QString& LogFlags::getFormattedMessage(unsigned int arg, QString& line) + TQString& LogFlags::getFormattedMessage(unsigned int arg, TQString& line) { if( (arg & LOG_ALL) == LOG_ALL) { diff --git a/plugins/logviewer/logflags.h b/plugins/logviewer/logflags.h index 9d7245a..618a020 100644 --- a/plugins/logviewer/logflags.h +++ b/plugins/logviewer/logflags.h @@ -20,7 +20,7 @@ #ifndef KTLOGFLAGS_H #define KTLOGFLAGS_H -class QString; +class TQString; namespace kt { @@ -72,7 +72,7 @@ namespace kt void setLog(LogViewer* log); ///Makes line rich text according to arg level. - QString& getFormattedMessage(unsigned int arg, QString& line); + TQString& getFormattedMessage(unsigned int arg, TQString& line); private: LogFlags(); diff --git a/plugins/logviewer/logprefpage.cpp b/plugins/logviewer/logprefpage.cpp index cc89a68..b49c4ce 100644 --- a/plugins/logviewer/logprefpage.cpp +++ b/plugins/logviewer/logprefpage.cpp @@ -46,9 +46,9 @@ namespace kt return true; } - void LogPrefPage::createWidget(QWidget* parent) + void LogPrefPage::createWidget(TQWidget* tqparent) { - m_widget = new LogPrefWidget(parent); + m_widget = new LogPrefWidget(tqparent); } void LogPrefPage::updateData() diff --git a/plugins/logviewer/logprefpage.h b/plugins/logviewer/logprefpage.h index 3aed61b..cd8e6a8 100644 --- a/plugins/logviewer/logprefpage.h +++ b/plugins/logviewer/logprefpage.h @@ -38,7 +38,7 @@ namespace kt virtual ~LogPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/logviewer/logprefwidget.cpp b/plugins/logviewer/logprefwidget.cpp index 6bf99bd..215bce6 100644 --- a/plugins/logviewer/logprefwidget.cpp +++ b/plugins/logviewer/logprefwidget.cpp @@ -24,15 +24,15 @@ #include <kglobal.h> #include <klocale.h> -#include <qwidget.h> -#include <qstring.h> -#include <qcheckbox.h> -#include <qcombobox.h> +#include <tqwidget.h> +#include <tqstring.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> namespace kt { - LogPrefWidget::LogPrefWidget(QWidget *parent, const char *name) - :LogPrefWidgetBase(parent, name) + LogPrefWidget::LogPrefWidget(TQWidget *tqparent, const char *name) + :LogPrefWidgetBase(tqparent, name) { m_sysgen->setCurrentItem(getLevel(LogViewerPluginSettings::sysGEN())); m_syscon->setCurrentItem(getLevel(LogViewerPluginSettings::sysCON())); diff --git a/plugins/logviewer/logprefwidget.h b/plugins/logviewer/logprefwidget.h index 35a6c06..4bb1030 100644 --- a/plugins/logviewer/logprefwidget.h +++ b/plugins/logviewer/logprefwidget.h @@ -27,8 +27,9 @@ namespace kt class LogPrefWidget: public LogPrefWidgetBase { Q_OBJECT + TQ_OBJECT public: - LogPrefWidget(QWidget *parent = 0, const char *name = 0); + LogPrefWidget(TQWidget *tqparent = 0, const char *name = 0); bool apply(); private: diff --git a/plugins/logviewer/logprefwidgetbase.ui b/plugins/logviewer/logprefwidgetbase.ui index 76e7124..32ccf61 100644 --- a/plugins/logviewer/logprefwidgetbase.ui +++ b/plugins/logviewer/logprefwidgetbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>LogPrefWidgetBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>LogPrefWidgetBase</cstring> </property> @@ -29,14 +29,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>110</height> </size> </property> </spacer> - <widget class="QButtonGroup" row="0" column="1"> + <widget class="TQButtonGroup" row="0" column="1"> <property name="name"> <cstring>buttonGroup2</cstring> </property> @@ -47,7 +47,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QComboBox" row="0" column="1"> + <widget class="TQComboBox" row="0" column="1"> <item> <property name="text"> <string>All</string> @@ -77,7 +77,7 @@ <cstring>m_sysipf</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -88,7 +88,7 @@ <cstring>comboBox1_5</cstring> </property> </widget> - <widget class="QComboBox" row="1" column="1"> + <widget class="TQComboBox" row="1" column="1"> <item> <property name="text"> <string>All</string> @@ -118,7 +118,7 @@ <cstring>m_syssrc</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -129,7 +129,7 @@ <cstring>comboBox1_6</cstring> </property> </widget> - <widget class="QComboBox" row="2" column="1"> + <widget class="TQComboBox" row="2" column="1"> <item> <property name="text"> <string>All</string> @@ -159,7 +159,7 @@ <cstring>m_syspnp</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2_3</cstring> </property> @@ -170,7 +170,7 @@ <cstring>comboBox1_7</cstring> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel2_4</cstring> </property> @@ -181,7 +181,7 @@ <cstring>comboBox1_8</cstring> </property> </widget> - <widget class="QComboBox" row="3" column="1"> + <widget class="TQComboBox" row="3" column="1"> <item> <property name="text"> <string>All</string> @@ -211,7 +211,7 @@ <cstring>m_syssnf</cstring> </property> </widget> - <widget class="QComboBox" row="4" column="1"> + <widget class="TQComboBox" row="4" column="1"> <item> <property name="text"> <string>All</string> @@ -241,7 +241,7 @@ <cstring>m_sysscd</cstring> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel2_5</cstring> </property> @@ -252,7 +252,7 @@ <cstring>comboBox1_9</cstring> </property> </widget> - <widget class="QComboBox" row="5" column="1"> + <widget class="TQComboBox" row="5" column="1"> <item> <property name="text"> <string>All</string> @@ -282,7 +282,7 @@ <cstring>m_syspfi</cstring> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>textLabel2_6</cstring> </property> @@ -293,7 +293,7 @@ <cstring>comboBox1_10</cstring> </property> </widget> - <widget class="QLabel" row="6" column="0"> + <widget class="TQLabel" row="6" column="0"> <property name="name"> <cstring>textLabel2_7</cstring> </property> @@ -304,7 +304,7 @@ <cstring>comboBox1_11</cstring> </property> </widget> - <widget class="QComboBox" row="6" column="1"> + <widget class="TQComboBox" row="6" column="1"> <item> <property name="text"> <string>All</string> @@ -334,7 +334,7 @@ <cstring>m_sysinw</cstring> </property> </widget> - <widget class="QLabel" row="7" column="0"> + <widget class="TQLabel" row="7" column="0"> <property name="name"> <cstring>textLabel2_7_2</cstring> </property> @@ -345,7 +345,7 @@ <cstring>comboBox1_11</cstring> </property> </widget> - <widget class="QComboBox" row="7" column="1"> + <widget class="TQComboBox" row="7" column="1"> <item> <property name="text"> <string>All</string> @@ -375,7 +375,7 @@ <cstring>m_sysrss</cstring> </property> </widget> - <widget class="QComboBox" row="8" column="1"> + <widget class="TQComboBox" row="8" column="1"> <item> <property name="text"> <string>All</string> @@ -405,7 +405,7 @@ <cstring>m_sysweb</cstring> </property> </widget> - <widget class="QLabel" row="8" column="0"> + <widget class="TQLabel" row="8" column="0"> <property name="name"> <cstring>textLabel2_7_2_2</cstring> </property> @@ -418,7 +418,7 @@ </widget> </grid> </widget> - <widget class="QButtonGroup" row="0" column="0"> + <widget class="TQButtonGroup" row="0" column="0"> <property name="name"> <cstring>buttonGroup3</cstring> </property> @@ -429,7 +429,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -437,7 +437,7 @@ <string>General:</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2_8</cstring> </property> @@ -445,7 +445,7 @@ <string>Connections:</string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2_9</cstring> </property> @@ -453,7 +453,7 @@ <string>DHT:</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel2_10</cstring> </property> @@ -461,7 +461,7 @@ <string>Tracker:</string> </property> </widget> - <widget class="QComboBox" row="0" column="1"> + <widget class="TQComboBox" row="0" column="1"> <item> <property name="text"> <string>All</string> @@ -491,7 +491,7 @@ <cstring>m_sysgen</cstring> </property> </widget> - <widget class="QComboBox" row="1" column="1"> + <widget class="TQComboBox" row="1" column="1"> <item> <property name="text"> <string>All</string> @@ -521,7 +521,7 @@ <cstring>m_syscon</cstring> </property> </widget> - <widget class="QComboBox" row="2" column="1"> + <widget class="TQComboBox" row="2" column="1"> <item> <property name="text"> <string>All</string> @@ -551,7 +551,7 @@ <cstring>m_sysdht</cstring> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -559,7 +559,7 @@ <string>Disk I/O:</string> </property> </widget> - <widget class="QComboBox" row="3" column="1"> + <widget class="TQComboBox" row="3" column="1"> <item> <property name="text"> <string>All</string> @@ -589,7 +589,7 @@ <cstring>m_systrk</cstring> </property> </widget> - <widget class="QComboBox" row="4" column="1"> + <widget class="TQComboBox" row="4" column="1"> <item> <property name="text"> <string>All</string> @@ -621,7 +621,7 @@ </widget> </grid> </widget> - <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQButtonGroup" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>buttonGroup3_2</cstring> </property> @@ -632,7 +632,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>m_useRich</cstring> </property> @@ -644,5 +644,5 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/logviewer/logviewer.cpp b/plugins/logviewer/logviewer.cpp index 5e6b16c..916af8e 100644 --- a/plugins/logviewer/logviewer.cpp +++ b/plugins/logviewer/logviewer.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include <kglobal.h> #include <kconfig.h> -#include <qapplication.h> +#include <tqapplication.h> #include "logviewer.h" #include "logflags.h" #include "logviewerpluginsettings.h" @@ -28,33 +28,33 @@ namespace kt { const int LOG_EVENT_TYPE = 65432; - class LogEvent : public QCustomEvent + class LogEvent : public TQCustomEvent { - QString str; + TQString str; public: - LogEvent(const QString & str) : QCustomEvent(LOG_EVENT_TYPE),str(str) + LogEvent(const TQString & str) : TQCustomEvent(LOG_EVENT_TYPE),str(str) {} virtual ~LogEvent() {} - const QString & msg() const {return str;} + const TQString & msg() const {return str;} }; - LogViewer::LogViewer(QWidget *parent, const char *name) - : KTextBrowser(parent, name), LogMonitorInterface() + LogViewer::LogViewer(TQWidget *tqparent, const char *name) + : KTextBrowser(tqparent, name), LogMonitorInterface() { /* IMPORTANT: use LogText mode, so that setMaxLogLines will work, if not everything will be kept in memory. */ - setTextFormat(Qt::LogText); + setTextFormat(TQt::LogText); setMaxLogLines(200); - setMinimumSize(QSize(0,50)); - setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); + setMinimumSize(TQSize(0,50)); + tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding); KGlobal::config()->setGroup("LogViewer"); if (KGlobal::config()->hasKey("LogViewerWidgetSize")) { - QSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0); + TQSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0); resize(s); } @@ -70,10 +70,10 @@ namespace kt } - void LogViewer::message(const QString& line, unsigned int arg) + void LogViewer::message(const TQString& line, unsigned int arg) { /* - IMPORTANT: because QTextBrowser is not thread safe, we must use the Qt event mechanism + IMPORTANT: because TQTextBrowser is not thread safe, we must use the TQt event mechanism to add strings to it, this will ensure that strings will only be added in the main application thread. */ @@ -81,19 +81,19 @@ namespace kt { if(m_useRichText) { - QString tmp = line; + TQString tmp = line; LogEvent* le = new LogEvent(LogFlags::instance().getFormattedMessage(arg, tmp)); - QApplication::postEvent(this,le); + TQApplication::postEvent(this,le); } else { LogEvent* le = new LogEvent(line); - QApplication::postEvent(this,le); + TQApplication::postEvent(this,le); } } } - void LogViewer::customEvent(QCustomEvent* ev) + void LogViewer::customEvent(TQCustomEvent* ev) { if (ev->type() == LOG_EVENT_TYPE) { diff --git a/plugins/logviewer/logviewer.h b/plugins/logviewer/logviewer.h index 4198215..ced8bf0 100644 --- a/plugins/logviewer/logviewer.h +++ b/plugins/logviewer/logviewer.h @@ -32,12 +32,13 @@ namespace kt class LogViewer : public KTextBrowser, public LogMonitorInterface { Q_OBJECT + TQ_OBJECT public: - LogViewer(QWidget *parent = 0, const char *name = 0); + LogViewer(TQWidget *tqparent = 0, const char *name = 0); virtual ~LogViewer(); - virtual void message(const QString& line, unsigned int arg); - virtual void customEvent(QCustomEvent* ev); + virtual void message(const TQString& line, unsigned int arg); + virtual void customEvent(TQCustomEvent* ev); void setRichText(bool val); diff --git a/plugins/logviewer/logviewerplugin.cpp b/plugins/logviewer/logviewerplugin.cpp index aa35d2f..5df9fac 100644 --- a/plugins/logviewer/logviewerplugin.cpp +++ b/plugins/logviewer/logviewerplugin.cpp @@ -40,8 +40,8 @@ K_EXPORT_COMPONENT_FACTORY(ktlogviewerplugin,KGenericFactory<kt::LogViewerPlugin namespace kt { - LogViewerPlugin::LogViewerPlugin(QObject* parent, const char* qt_name, const QStringList& args) - : Plugin(parent, qt_name, args, NAME,i18n("Log Viewer"), AUTHOR, EMAIL, + LogViewerPlugin::LogViewerPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args) + : Plugin(tqparent, qt_name, args, NAME,i18n("Log Viewer"), AUTHOR, EMAIL, i18n("Displays ktorrent logging output"),"log") { lv = 0; @@ -75,7 +75,7 @@ namespace kt LogFlags::finalize(); } - bool LogViewerPlugin::versionCheck(const QString & version) const + bool LogViewerPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/logviewer/logviewerplugin.h b/plugins/logviewer/logviewerplugin.h index 9cd5af8..238121f 100644 --- a/plugins/logviewer/logviewerplugin.h +++ b/plugins/logviewer/logviewerplugin.h @@ -35,13 +35,14 @@ namespace kt class LogViewerPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - LogViewerPlugin(QObject* parent, const char* qt_name, const QStringList& args); + LogViewerPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args); virtual ~LogViewerPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; private: LogViewer* lv; LogPrefPage* pref; diff --git a/plugins/partfileimport/importdialog.cpp b/plugins/partfileimport/importdialog.cpp index 22f9a4b..158b4f8 100644 --- a/plugins/partfileimport/importdialog.cpp +++ b/plugins/partfileimport/importdialog.cpp @@ -42,8 +42,8 @@ using namespace bt; namespace kt { - ImportDialog::ImportDialog(CoreInterface* core,QWidget* parent, const char* name, bool modal, WFlags fl) - : ImportDlgBase(parent,name, modal,fl),DataCheckerListener(false),core(core) + ImportDialog::ImportDialog(CoreInterface* core,TQWidget* tqparent, const char* name, bool modal, WFlags fl) + : ImportDlgBase(tqparent,name, modal,fl),DataCheckerListener(false),core(core) { KURLRequester* r = m_torrent_url; r->setMode(KFile::File|KFile::LocalOnly); @@ -52,8 +52,8 @@ namespace kt r = m_data_url; r->setMode(KFile::File|KFile::Directory|KFile::LocalOnly); - connect(m_import_btn,SIGNAL(clicked()),this,SLOT(onImport())); - connect(m_cancel_btn,SIGNAL(clicked()),this,SLOT(reject())); + connect(m_import_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onImport())); + connect(m_cancel_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject())); m_progress->setEnabled(false); } @@ -92,18 +92,18 @@ namespace kt try { dc->setListener(this); - dc->check(data_url.path(),tor,QString::null); + dc->check(data_url.path(),tor,TQString()); } catch (Error & e) { delete dc; - KMessageBox::error(this,i18n("Cannot verify data : %1").arg(e.toString()),i18n("Error")); + KMessageBox::error(this,i18n("Cannot verify data : %1").tqarg(e.toString()),i18n("Error")); reject(); return; } // find a new torrent dir and make it if necessary - QString tor_dir = core->findNewTorrentDir(); + TQString tor_dir = core->findNewTorrentDir(); if (!tor_dir.endsWith(bt::DirSeparator())) tor_dir += bt::DirSeparator(); @@ -123,11 +123,11 @@ namespace kt // make the cache if (tor.isMultiFile()) { - QValueList<Uint32> dnd_files; + TQValueList<Uint32> dnd_files; bool dnd = false; // first make tor_dir/cache/ - QString cache_dir = tor_dir + "cache" + bt::DirSeparator(); - QString dnd_dir = tor_dir + "dnd" + bt::DirSeparator(); + TQString cache_dir = tor_dir + "cache" + bt::DirSeparator(); + TQString dnd_dir = tor_dir + "dnd" + bt::DirSeparator(); if (!bt::Exists(cache_dir)) MakeDir(cache_dir); if (!bt::Exists(dnd_dir)) @@ -143,10 +143,10 @@ namespace kt dnd = false; } - QString durl = data_url.path(); + TQString durl = data_url.path(); if (durl.endsWith(bt::DirSeparator())) durl = durl.left(durl.length() - 1); - int ds = durl.findRev(bt::DirSeparator()); + int ds = durl.tqfindRev(bt::DirSeparator()); if (durl.mid(ds+1) == tor.getNameSuggestion()) { durl = durl.left(ds); @@ -162,8 +162,8 @@ namespace kt { // single file, just symlink the data_url to tor_dir/cache bt::SymLink(data_url.path(),tor_dir + "cache"); - QString durl = data_url.path(); - int ds = durl.findRev(bt::DirSeparator()); + TQString durl = data_url.path(); + int ds = durl.tqfindRev(bt::DirSeparator()); durl = durl.left(ds); saveStats(tor_dir + "stats",durl,imported,false); } @@ -204,7 +204,7 @@ namespace kt } catch (Error & e) { - KMessageBox::error(this,i18n("Cannot load the torrent file : %1").arg(e.toString()), + KMessageBox::error(this,i18n("Cannot load the torrent file : %1").tqarg(e.toString()), i18n("Error")); reject(); return; @@ -226,7 +226,7 @@ namespace kt { // download the torrent file KIO::StoredTransferJob* j = KIO::storedGet(tor_url); - connect(j,SIGNAL(result(KIO::Job* )),this,SLOT(onTorrentGetReult(KIO::Job*))); + connect(j,TQT_SIGNAL(result(KIO::Job* )),this,TQT_SLOT(onTorrentGetReult(KIO::Job*))); } else { @@ -240,7 +240,7 @@ namespace kt } catch (Error & e) { - KMessageBox::error(this,i18n("Cannot load the torrent file : %1").arg(e.toString()), + KMessageBox::error(this,i18n("Cannot load the torrent file : %1").tqarg(e.toString()), i18n("Error")); reject(); return; @@ -249,12 +249,12 @@ namespace kt } } - void ImportDialog::writeIndex(const QString & file,const BitSet & chunks) + void ImportDialog::writeIndex(const TQString & file,const BitSet & chunks) { // first try to open it File fptr; if (!fptr.open(file,"wb")) - throw Error(i18n("Cannot open %1 : %2").arg(file).arg(fptr.errorString())); + throw Error(i18n("Cannot open %1 : %2").tqarg(file).tqarg(fptr.errorString())); // write all chunks to the file for (Uint32 i = 0;i < chunks.getNumBits();i++) @@ -270,18 +270,18 @@ namespace kt } } - void ImportDialog::linkTorFile(const QString & cache_dir,const QString & dnd_dir, - const KURL & data_url,const QString & fpath,bool & dnd) + void ImportDialog::linkTorFile(const TQString & cache_dir,const TQString & dnd_dir, + const KURL & data_url,const TQString & fpath,bool & dnd) { - QStringList sl = QStringList::split(bt::DirSeparator(),fpath); + TQStringList sl = TQStringList::split(bt::DirSeparator(),fpath); // create all necessary subdirs - QString ctmp = cache_dir; - QString otmp = data_url.path(); + TQString ctmp = cache_dir; + TQString otmp = data_url.path(); if (!otmp.endsWith(bt::DirSeparator())) otmp += bt::DirSeparator(); - QString dtmp = dnd_dir; + TQString dtmp = dnd_dir; for (Uint32 i = 0;i < sl.count() - 1;i++) { otmp += sl[i]; @@ -300,7 +300,7 @@ namespace kt dtmp += bt::DirSeparator(); } - QString dfile = otmp + sl.last(); + TQString dfile = otmp + sl.last(); if (!bt::Exists(dfile)) { // when we start the torrent the user will be asked what to do @@ -315,16 +315,16 @@ namespace kt } } - void ImportDialog::saveStats(const QString & stats_file,const KURL & data_url,Uint64 imported,bool custom_output_name) + void ImportDialog::saveStats(const TQString & stats_file,const KURL & data_url,Uint64 imported,bool custom_output_name) { - QFile fptr(stats_file); + TQFile fptr(stats_file); if (!fptr.open(IO_WriteOnly)) { Out(SYS_PFI|LOG_IMPORTANT) << "Warning : can't create stats file" << endl; return; } - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "OUTPUTDIR=" << data_url.path() << ::endl; out << "UPLOADED=0" << ::endl; out << "RUNNING_TIME_DL=0" << ::endl; @@ -332,8 +332,8 @@ namespace kt out << "PRIORITY=0" << ::endl; out << "AUTOSTART=1" << ::endl; if (core->getGlobalMaxShareRatio() > 0) - out << QString("MAX_RATIO=%1").arg(core->getGlobalMaxShareRatio(),0,'f',2) << ::endl; - out << QString("IMPORTED=%1").arg(imported) << ::endl; + out << TQString("MAX_RATIO=%1").tqarg(core->getGlobalMaxShareRatio(),0,'f',2) << ::endl; + out << TQString("IMPORTED=%1").tqarg(imported) << ::endl; if (custom_output_name) out << "CUSTOM_OUTPUT_NAME=1" << endl; } @@ -358,7 +358,7 @@ namespace kt return nb; } - void ImportDialog::saveFileInfo(const QString & file_info_file,QValueList<Uint32> & dnd) + void ImportDialog::saveFileInfo(const TQString & file_info_file,TQValueList<Uint32> & dnd) { // saves which TorrentFile's do not need to be downloaded File fptr; diff --git a/plugins/partfileimport/importdialog.h b/plugins/partfileimport/importdialog.h index b7617fc..9f7db9f 100644 --- a/plugins/partfileimport/importdialog.h +++ b/plugins/partfileimport/importdialog.h @@ -46,9 +46,10 @@ namespace kt class ImportDialog : public ImportDlgBase,public bt::DataCheckerListener { Q_OBJECT + TQ_OBJECT public: - ImportDialog(CoreInterface* core,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ImportDialog(CoreInterface* core,TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); virtual ~ImportDialog(); public slots: @@ -56,12 +57,12 @@ namespace kt void onTorrentGetReult(KIO::Job* j); private: - void writeIndex(const QString & file,const bt::BitSet & chunks); - void linkTorFile(const QString & cache_dir,const QString & dnd_dir, - const KURL & data_url,const QString & fpath,bool & dnd); - void saveStats(const QString & stats_file,const KURL & data_url,bt::Uint64 imported,bool custom_output_name); + void writeIndex(const TQString & file,const bt::BitSet & chunks); + void linkTorFile(const TQString & cache_dir,const TQString & dnd_dir, + const KURL & data_url,const TQString & fpath,bool & dnd); + void saveStats(const TQString & stats_file,const KURL & data_url,bt::Uint64 imported,bool custom_output_name); bt::Uint64 calcImportedBytes(const bt::BitSet & chunks,const bt::Torrent & tor); - void saveFileInfo(const QString & file_info_file,QValueList<bt::Uint32> & dnd); + void saveFileInfo(const TQString & file_info_file,TQValueList<bt::Uint32> & dnd); virtual void progress(bt::Uint32 num,bt::Uint32 total); virtual void status(bt::Uint32 num_failed,bt::Uint32 num_downloaded); diff --git a/plugins/partfileimport/importdlgbase.ui b/plugins/partfileimport/importdlgbase.ui index e1cdd64..c14ceee 100644 --- a/plugins/partfileimport/importdlgbase.ui +++ b/plugins/partfileimport/importdlgbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ImportDlgBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>ImportDlgBase</cstring> </property> @@ -19,27 +19,27 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>60</width> <height>0</height> @@ -49,11 +49,11 @@ <string>Torrent:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>60</width> <height>0</height> @@ -65,9 +65,9 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <vbox> <property name="name"> @@ -100,9 +100,9 @@ <cstring>m_progress</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -118,7 +118,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>61</width> <height>20</height> @@ -147,7 +147,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> diff --git a/plugins/partfileimport/partfileimportplugin.cpp b/plugins/partfileimport/partfileimportplugin.cpp index c154478..04ef8fd 100644 --- a/plugins/partfileimport/partfileimportplugin.cpp +++ b/plugins/partfileimport/partfileimportplugin.cpp @@ -39,8 +39,8 @@ K_EXPORT_COMPONENT_FACTORY(ktpartfileimportplugin,KGenericFactory<kt::PartFileIm namespace kt { - PartFileImportPlugin::PartFileImportPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Import"),AUTHOR,EMAIL,i18n("Imports partially or fully downloaded torrents from other clients"),"ktplugins") + PartFileImportPlugin::PartFileImportPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Import"),AUTHOR,EMAIL,i18n("Imports partially or fully downloaded torrents from other clients"),"ktplugins") { setXMLFile("ktpartfileimportpluginui.rc"); import_action = 0; @@ -54,7 +54,7 @@ namespace kt void PartFileImportPlugin::load() { import_action = new KAction(i18n("Import existing download" ), 0, this, - SLOT(onImport()), actionCollection(), "partfileimport" ); + TQT_SLOT(onImport()), actionCollection(), "partfileimport" ); } void PartFileImportPlugin::unload() @@ -69,7 +69,7 @@ namespace kt dlg.exec(); } - bool PartFileImportPlugin::versionCheck(const QString & version) const + bool PartFileImportPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/partfileimport/partfileimportplugin.h b/plugins/partfileimport/partfileimportplugin.h index 31f2d3a..da2874e 100644 --- a/plugins/partfileimport/partfileimportplugin.h +++ b/plugins/partfileimport/partfileimportplugin.h @@ -33,13 +33,14 @@ namespace kt class PartFileImportPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - PartFileImportPlugin(QObject* parent, const char* name, const QStringList& args); + PartFileImportPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~PartFileImportPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; public slots: void onImport(); diff --git a/plugins/rssfeed/rss/article.cpp b/plugins/rssfeed/rss/article.cpp index 571490e..476eb09 100644 --- a/plugins/rssfeed/rss/article.cpp +++ b/plugins/rssfeed/rss/article.cpp @@ -17,8 +17,8 @@ #include <kurllabel.h> #include <kmdcodec.h> -#include <qdatetime.h> -#include <qdom.h> +#include <tqdatetime.h> +#include <tqdom.h> using namespace RSS; namespace RSS @@ -28,11 +28,11 @@ namespace RSS struct Article::Private : public Shared { - QString title; + TQString title; KURL link; - QString description; - QDateTime pubDate; - QString guid; + TQString description; + TQDateTime pubDate; + TQString guid; bool guidIsPermaLink; MetaInfoMap meta; KURL commentsLink; @@ -48,28 +48,28 @@ Article::Article(const Article &other) : d(0) *this = other; } -Article::Article(const QDomNode &node, Format format) : d(new Private) +Article::Article(const TQDomNode &node, Format format) : d(new Private) { - QString elemText; + TQString elemText; d->numComments=0; - if (!(elemText = extractNode(node, QString::fromLatin1("title"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) d->title = elemText; - QDomNode n; + TQDomNode n; bool foundTorrentEnclosure = false; for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - const QDomElement e = n.toElement(); - if ( (e.tagName()==QString::fromLatin1("enclosure") ) ) + const TQDomElement e = n.toElement(); + if ( (e.tagName()==TQString::tqfromLatin1("enclosure") ) ) { - QString enclosureAttr = e.attribute(QString::fromLatin1("type")); + TQString enclosureAttr = e.attribute(TQString::tqfromLatin1("type")); if (!enclosureAttr.isNull() ) { if (enclosureAttr == "application/x-bittorrent") { - enclosureAttr = e.attribute(QString::fromLatin1("url")); + enclosureAttr = e.attribute(TQString::tqfromLatin1("url")); if (!enclosureAttr.isNull() ) { d->link=enclosureAttr; @@ -85,44 +85,44 @@ Article::Article(const QDomNode &node, Format format) : d(new Private) { if (format==AtomFeed) { - QDomNode n; + TQDomNode n; for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - const QDomElement e = n.toElement(); - if ( (e.tagName()==QString::fromLatin1("link")) && - (e.attribute(QString::fromLatin1("rel"))==QString::fromLatin1("alternate"))) + const TQDomElement e = n.toElement(); + if ( (e.tagName()==TQString::tqfromLatin1("link")) && + (e.attribute(TQString::tqfromLatin1("rel"))==TQString::tqfromLatin1("alternate"))) { - d->link=n.toElement().attribute(QString::fromLatin1("href")); + d->link=n.toElement().attribute(TQString::tqfromLatin1("href")); break; } } } else { - if (!(elemText = extractNode(node, QString::fromLatin1("link"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) d->link = elemText; } } // prefer content/content:encoded over summary/description for feeds that provide it - QString tagName=(format==AtomFeed)? QString::fromLatin1("content"): QString::fromLatin1("content:encoded"); + TQString tagName=(format==AtomFeed)? TQString::tqfromLatin1("content"): TQString::tqfromLatin1("content:encoded"); if (!(elemText = extractNode(node, tagName, false)).isNull()) d->description = elemText; if (d->description.isEmpty()) { - if (!(elemText = extractNode(node, QString::fromLatin1("body"), false)).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("body"), false)).isNull()) d->description = elemText; if (d->description.isEmpty()) // 3rd try: see http://www.intertwingly.net/blog/1299.html { - if (!(elemText = extractNode(node, QString::fromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull()) d->description = elemText; } } - if (!(elemText = extractNode(node, QString::fromLatin1((format==AtomFeed)? "created": "pubDate"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1((format==AtomFeed)? "created": "pubDate"))).isNull()) { time_t _time; if (format==AtomFeed) @@ -134,7 +134,7 @@ Article::Article(const QDomNode &node, Format format) : d(new Private) if (_time != 0) d->pubDate.setTime_t(_time); } - if (!(elemText = extractNode(node, QString::fromLatin1("dc:date"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("dc:date"))).isNull()) { time_t _time = parseISO8601Date(elemText); @@ -146,23 +146,23 @@ Article::Article(const QDomNode &node, Format format) : d(new Private) //no luck so far - so let's set it to the current time if (!d->pubDate.isValid()) { - d->pubDate = QDateTime::currentDateTime(); + d->pubDate = TQDateTime::tqcurrentDateTime(); } - if (!(elemText = extractNode(node, QString::fromLatin1("wfw:comment"))).isNull()) { + if (!(elemText = extractNode(node, TQString::tqfromLatin1("wfw:comment"))).isNull()) { d->commentsLink = elemText; } - if (!(elemText = extractNode(node, QString::fromLatin1("slash:comments"))).isNull()) { + if (!(elemText = extractNode(node, TQString::tqfromLatin1("slash:comments"))).isNull()) { d->numComments = elemText.toInt(); } - tagName=(format==AtomFeed)? QString::fromLatin1("id"): QString::fromLatin1("guid"); + tagName=(format==AtomFeed)? TQString::tqfromLatin1("id"): TQString::tqfromLatin1("guid"); n = node.namedItem(tagName); if (!n.isNull()) { d->guidIsPermaLink = (format==AtomFeed)? false : true; - if (n.toElement().attribute(QString::fromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false; + if (n.toElement().attribute(TQString::tqfromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false; if (!(elemText = extractNode(node, tagName)).isNull()) d->guid = elemText; @@ -172,18 +172,18 @@ Article::Article(const QDomNode &node, Format format) : d(new Private) d->guidIsPermaLink = false; md5Machine.reset(); - QDomNode n(node); + TQDomNode n(node); md5Machine.update(d->title.utf8()); md5Machine.update(d->description.utf8()); - d->guid = QString(md5Machine.hexDigest().data()); - d->meta[QString::fromLatin1("guidIsHash")] = QString::fromLatin1("true"); + d->guid = TQString(md5Machine.hexDigest().data()); + d->meta[TQString::tqfromLatin1("guidIsHash")] = TQString::tqfromLatin1("true"); } - for (QDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling()) + for (TQDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling()) { - if (i.isElement() && i.toElement().tagName() == QString::fromLatin1("metaInfo:meta")) + if (i.isElement() && i.toElement().tagName() == TQString::tqfromLatin1("metaInfo:meta")) { - QString type = i.toElement().attribute(QString::fromLatin1("type")); + TQString type = i.toElement().attribute(TQString::tqfromLatin1("type")); d->meta[type] = i.toElement().text(); } } @@ -195,7 +195,7 @@ Article::~Article() delete d; } -QString Article::title() const +TQString Article::title() const { return d->title; } @@ -205,12 +205,12 @@ const KURL &Article::link() const return d->link; } -QString Article::description() const +TQString Article::description() const { return d->description; } -QString Article::guid() const +TQString Article::guid() const { return d->guid; } @@ -220,7 +220,7 @@ bool Article::guidIsPermaLink() const return d->guidIsPermaLink; } -const QDateTime &Article::pubDate() const +const TQDateTime &Article::pubDate() const { return d->pubDate; } @@ -236,14 +236,14 @@ int Article::comments() const } -QString Article::meta(const QString &key) const +TQString Article::meta(const TQString &key) const { return d->meta[key]; } -KURLLabel *Article::widget(QWidget *parent, const char *name) const +KURLLabel *Article::widget(TQWidget *tqparent, const char *name) const { - KURLLabel *label = new KURLLabel(d->link.url(), d->title, parent, name); + KURLLabel *label = new KURLLabel(d->link.url(), d->title, tqparent, name); label->setUseTips(true); if (!d->description.isNull()) label->setTipText(d->description); diff --git a/plugins/rssfeed/rss/article.h b/plugins/rssfeed/rss/article.h index bab7a38..93f1908 100644 --- a/plugins/rssfeed/rss/article.h +++ b/plugins/rssfeed/rss/article.h @@ -11,15 +11,15 @@ #ifndef LIBRSS_ARTICLE_H #define LIBRSS_ARTICLE_H -#include <qmap.h> +#include <tqmap.h> #include "global.h" -class QDateTime; -class QDomNode; -template <class> class QValueList; -class QString; -class QWidget; +class TQDateTime; +class TQDomNode; +template <class> class TQValueList; +class TQString; +class TQWidget; class KURL; class KURLLabel; @@ -37,7 +37,7 @@ namespace RSS /** * A list of articles. */ - typedef QValueList<Article> List; + typedef TQValueList<Article> List; /** * Default constructor. @@ -52,10 +52,10 @@ namespace RSS /** * Constructs an Article from a piece of RSS markup. - * @param node A QDomNode which references the DOM leaf to be used + * @param node A TQDomNode which references the DOM leaf to be used * for constructing the Article. */ - Article(const QDomNode &node, Format format); + Article(const TQDomNode &node, Format format); /** * Assignment operator. @@ -87,10 +87,10 @@ namespace RSS /** * RSS 0.90 and upwards - * @return The headline of this article, or QString::null if + * @return The headline of this article, or TQString() if * no headline was available. */ - QString title() const; + TQString title() const; /** * RSS 0.90 and upwards @@ -103,20 +103,20 @@ namespace RSS /** * RSS 0.91 and upwards - * @return A story synopsis, or QString::null if no description + * @return A story synopsis, or TQString() if no description * was available. */ - QString description() const; + TQString description() const; /** * RSS 2.0 and upwards * @return An article GUID (globally unique identifier). */ - QString guid() const; + TQString guid() const; /** * RSS 2.0 and upwards - * @return If this article GUID is permalink. Has no meaning when guid() is QString::null. + * @return If this article GUID is permalink. Has no meaning when guid() is TQString(). */ bool guidIsPermaLink() const; @@ -124,30 +124,30 @@ namespace RSS * RSS 2.0 and upwards * @return The date when the article was published. */ - const QDateTime &pubDate() const; + const TQDateTime &pubDate() const; const KURL &commentsLink() const; int comments() const; - QString meta(const QString &key) const; + TQString meta(const TQString &key) const; /** - * @param parent The parent widget for the KURLLabel. + * @param tqparent The tqparent widget for the KURLLabel. * @param name A name for the widget which will be used internally. * @return a widget (a KURLLabel in this case) for the Article. * This makes building a user-interface which contains the * information in this Article object more convenient. * The returned KURLLabel's caption will be the title(), clicking - * on it will emit the URL link(), and it has a QToolTip attached + * on it will emit the URL link(), and it has a TQToolTip attached * to it which displays the description() (in case it has one, * if there is no description, the URL which the label links to * will be used). * Note that you have to delete the KURLLabel object returned by * this method yourself. */ - KURLLabel *widget(QWidget *parent = 0, const char *name = 0) const; + KURLLabel *widget(TQWidget *tqparent = 0, const char *name = 0) const; - typedef QMap<QString, QString> MetaInfoMap; + typedef TQMap<TQString, TQString> MetaInfoMap; private: struct Private; diff --git a/plugins/rssfeed/rss/document.cpp b/plugins/rssfeed/rss/document.cpp index be353e4..f2e3763 100644 --- a/plugins/rssfeed/rss/document.cpp +++ b/plugins/rssfeed/rss/document.cpp @@ -18,9 +18,9 @@ #include <krfcdate.h> #include <kurl.h> -#include <qdatetime.h> -#include <qdom.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqdom.h> +#include <tqptrlist.h> using namespace RSS; @@ -40,22 +40,22 @@ struct Document::Private : public Shared } Version version; - QString title; - QString description; + TQString title; + TQString description; KURL link; Image *image; TextInput *textInput; Article::List articles; Language language; Format format; - QString copyright; - QDateTime pubDate; - QDateTime lastBuildDate; - QString rating; + TQString copyright; + TQDateTime pubDate; + TQDateTime lastBuildDate; + TQString rating; KURL docs; int ttl; - QString managingEditor; - QString webMaster; + TQString managingEditor; + TQString webMaster; HourList skipHours; DayList skipDays; bool valid; @@ -70,51 +70,51 @@ Document::Document(const Document &other) : d(0) *this = other; } -Document::Document(const QDomDocument &doc) : d(new Private) +Document::Document(const TQDomDocument &doc) : d(new Private) { - QString elemText; - QDomNode rootNode = doc.documentElement(); + TQString elemText; + TQDomNode rootNode = doc.documentElement(); // Determine the version of the present RSS markup. - QString attr; + TQString attr; // we should probably check that it ISN'T feed or rss, rather than check if it is xhtml - if (rootNode.toElement().tagName()==QString::fromLatin1("html")) + if (rootNode.toElement().tagName()==TQString::tqfromLatin1("html")) d->valid=false; else d->valid=true; - attr = rootNode.toElement().attribute(QString::fromLatin1("version"), QString::null); + attr = rootNode.toElement().attribute(TQString::tqfromLatin1("version"), TQString()); if (!attr.isNull()) { if (rootNode.toElement().tagName()=="feed") { d->format=AtomFeed; - if (attr == QString::fromLatin1("0.3")) + if (attr == TQString::tqfromLatin1("0.3")) d->version = vAtom_0_3; - else if (attr == QString::fromLatin1("0.2")) /* smt -> review */ + else if (attr == TQString::tqfromLatin1("0.2")) /* smt -> review */ d->version = vAtom_0_2; - else if (attr == QString::fromLatin1("0.1")) /* smt -> review */ + else if (attr == TQString::tqfromLatin1("0.1")) /* smt -> review */ d->version = vAtom_0_1; } else { d->format=RSSFeed; - if (attr == QString::fromLatin1("0.91")) + if (attr == TQString::tqfromLatin1("0.91")) d->version = v0_91; - else if (attr == QString::fromLatin1("0.92")) + else if (attr == TQString::tqfromLatin1("0.92")) d->version = v0_92; - else if (attr == QString::fromLatin1("0.93")) + else if (attr == TQString::tqfromLatin1("0.93")) d->version = v0_93; - else if (attr == QString::fromLatin1("0.94")) + else if (attr == TQString::tqfromLatin1("0.94")) d->version = v0_94; - else if (attr.startsWith("2.0") || attr == QString::fromLatin1("2")) // http://www.breuls.org/rss puts 2.00 in version (BR #0000016) + else if (attr.startsWith("2.0") || attr == TQString::tqfromLatin1("2")) // http://www.breuls.org/rss puts 2.00 in version (BR #0000016) d->version = v2_0; } } if (d->format==UnknownFormat) { - attr = rootNode.toElement().attribute(QString::fromLatin1("xmlns"), QString::null); + attr = rootNode.toElement().attribute(TQString::tqfromLatin1("xmlns"), TQString()); if (!attr.isNull()) { /* * Hardcoding these URLs is actually a bad idea, since the DTD doesn't @@ -124,275 +124,275 @@ Document::Document(const QDomDocument &doc) : d(new Private) * distinguish the RSS versions by analyzing the relationship between * the nodes. */ - if (attr == QString::fromLatin1("http://my.netscape.com/rdf/simple/0.9/")) { + if (attr == TQString::tqfromLatin1("http://my.netscape.com/rdf/simple/0.9/")) { d->format=RSSFeed; d->version = v0_90; } - else if (attr == QString::fromLatin1("http://purl.org/rss/1.0/")) { + else if (attr == TQString::tqfromLatin1("http://purl.org/rss/1.0/")) { d->format=RSSFeed; d->version = v1_0; } } } - QDomNode channelNode; + TQDomNode channelNode; if (d->format == AtomFeed) channelNode=rootNode; else - channelNode=rootNode.namedItem(QString::fromLatin1("channel")); + channelNode=rootNode.namedItem(TQString::tqfromLatin1("channel")); - if (!(elemText = extractNode(channelNode, QString::fromLatin1("title"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("title"))).isNull()) d->title = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1("description"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("description"))).isNull()) d->description = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1("link"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("link"))).isNull()) d->link = elemText; - /* This is ugly but necessary since RSS 0.90 and 1.0 have a different parent + /* This is ugly but necessary since RSS 0.90 and 1.0 have a different tqparent * node for <image>, <textinput> and <item> than RSS 0.91-0.94 and RSS 2.0. */ - QDomNode parentNode; + TQDomNode tqparentNode; if (d->version == v0_90 || d->version == v1_0 || d->format == AtomFeed) - parentNode = rootNode; + tqparentNode = rootNode; else { // following is a HACK for broken 0.91 feeds like xanga.com's - if (!rootNode.namedItem(QString::fromLatin1("item")).isNull()) - parentNode = rootNode; + if (!rootNode.namedItem(TQString::tqfromLatin1("item")).isNull()) + tqparentNode = rootNode; else - parentNode = channelNode; + tqparentNode = channelNode; } // image and textinput aren't supported by Atom.. handle in case feed provides - QDomNode n = parentNode.namedItem(QString::fromLatin1("image")); + TQDomNode n = tqparentNode.namedItem(TQString::tqfromLatin1("image")); if (!n.isNull()) d->image = new Image(n); - n = parentNode.namedItem(QString::fromLatin1("textinput")); + n = tqparentNode.namedItem(TQString::tqfromLatin1("textinput")); if (!n.isNull()) d->textInput = new TextInput(n); // Our (hopefully faster) version of elementsByTagName() - QString tagName; + TQString tagName; if (d->format == AtomFeed) - tagName=QString::fromLatin1("entry"); + tagName=TQString::tqfromLatin1("entry"); else - tagName=QString::fromLatin1("item"); + tagName=TQString::tqfromLatin1("item"); - for (n = parentNode.firstChild(); !n.isNull(); n = n.nextSibling()) { - const QDomElement e = n.toElement(); + for (n = tqparentNode.firstChild(); !n.isNull(); n = n.nextSibling()) { + const TQDomElement e = n.toElement(); if (e.tagName() == tagName) d->articles.append(Article(e, d->format)); } - if (!(elemText = extractNode(channelNode, QString::fromLatin1("copyright"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("copyright"))).isNull()) d->copyright = elemText; if (d->format == AtomFeed) - elemText = rootNode.toElement().attribute(QString::fromLatin1("xml:lang"), QString::null); + elemText = rootNode.toElement().attribute(TQString::tqfromLatin1("xml:lang"), TQString()); else - elemText = extractNode(channelNode, QString::fromLatin1("language")); + elemText = extractNode(channelNode, TQString::tqfromLatin1("language")); if (!elemText.isNull()){ - if (elemText == QString::fromLatin1("af")) + if (elemText == TQString::tqfromLatin1("af")) d->language = af; - else if (elemText == QString::fromLatin1("sq")) + else if (elemText == TQString::tqfromLatin1("sq")) d->language = sq; - else if (elemText == QString::fromLatin1("eu")) + else if (elemText == TQString::tqfromLatin1("eu")) d->language = eu; - else if (elemText == QString::fromLatin1("be")) + else if (elemText == TQString::tqfromLatin1("be")) d->language = be; - else if (elemText == QString::fromLatin1("bg")) + else if (elemText == TQString::tqfromLatin1("bg")) d->language = bg; - else if (elemText == QString::fromLatin1("ca")) + else if (elemText == TQString::tqfromLatin1("ca")) d->language = ca; - else if (elemText == QString::fromLatin1("zh-cn")) + else if (elemText == TQString::tqfromLatin1("zh-cn")) d->language = zh_cn; - else if (elemText == QString::fromLatin1("zh-tw")) + else if (elemText == TQString::tqfromLatin1("zh-tw")) d->language = zh_tw; - else if (elemText == QString::fromLatin1("hr")) + else if (elemText == TQString::tqfromLatin1("hr")) d->language = hr; - else if (elemText == QString::fromLatin1("cs")) + else if (elemText == TQString::tqfromLatin1("cs")) d->language = cs; - else if (elemText == QString::fromLatin1("da")) + else if (elemText == TQString::tqfromLatin1("da")) d->language = da; - else if (elemText == QString::fromLatin1("nl")) + else if (elemText == TQString::tqfromLatin1("nl")) d->language = nl; - else if (elemText == QString::fromLatin1("nl-be")) + else if (elemText == TQString::tqfromLatin1("nl-be")) d->language = nl_be; - else if (elemText == QString::fromLatin1("nl-nl")) + else if (elemText == TQString::tqfromLatin1("nl-nl")) d->language = nl_nl; - else if (elemText == QString::fromLatin1("en")) + else if (elemText == TQString::tqfromLatin1("en")) d->language = en; - else if (elemText == QString::fromLatin1("en-au")) + else if (elemText == TQString::tqfromLatin1("en-au")) d->language = en_au; - else if (elemText == QString::fromLatin1("en-bz")) + else if (elemText == TQString::tqfromLatin1("en-bz")) d->language = en_bz; - else if (elemText == QString::fromLatin1("en-ca")) + else if (elemText == TQString::tqfromLatin1("en-ca")) d->language = en_ca; - else if (elemText == QString::fromLatin1("en-ie")) + else if (elemText == TQString::tqfromLatin1("en-ie")) d->language = en_ie; - else if (elemText == QString::fromLatin1("en-jm")) + else if (elemText == TQString::tqfromLatin1("en-jm")) d->language = en_jm; - else if (elemText == QString::fromLatin1("en-nz")) + else if (elemText == TQString::tqfromLatin1("en-nz")) d->language = en_nz; - else if (elemText == QString::fromLatin1("en-ph")) + else if (elemText == TQString::tqfromLatin1("en-ph")) d->language = en_ph; - else if (elemText == QString::fromLatin1("en-za")) + else if (elemText == TQString::tqfromLatin1("en-za")) d->language = en_za; - else if (elemText == QString::fromLatin1("en-tt")) + else if (elemText == TQString::tqfromLatin1("en-tt")) d->language = en_tt; - else if (elemText == QString::fromLatin1("en-gb")) + else if (elemText == TQString::tqfromLatin1("en-gb")) d->language = en_gb; - else if (elemText == QString::fromLatin1("en-us")) + else if (elemText == TQString::tqfromLatin1("en-us")) d->language = en_us; - else if (elemText == QString::fromLatin1("en-zw")) + else if (elemText == TQString::tqfromLatin1("en-zw")) d->language = en_zw; - else if (elemText == QString::fromLatin1("fo")) + else if (elemText == TQString::tqfromLatin1("fo")) d->language = fo; - else if (elemText == QString::fromLatin1("fi")) + else if (elemText == TQString::tqfromLatin1("fi")) d->language = fi; - else if (elemText == QString::fromLatin1("fr")) + else if (elemText == TQString::tqfromLatin1("fr")) d->language = fr; - else if (elemText == QString::fromLatin1("fr-be")) + else if (elemText == TQString::tqfromLatin1("fr-be")) d->language = fr_be; - else if (elemText == QString::fromLatin1("fr-ca")) + else if (elemText == TQString::tqfromLatin1("fr-ca")) d->language = fr_ca; - else if (elemText == QString::fromLatin1("fr-fr")) + else if (elemText == TQString::tqfromLatin1("fr-fr")) d->language = fr_fr; - else if (elemText == QString::fromLatin1("fr-lu")) + else if (elemText == TQString::tqfromLatin1("fr-lu")) d->language = fr_lu; - else if (elemText == QString::fromLatin1("fr-mc")) + else if (elemText == TQString::tqfromLatin1("fr-mc")) d->language = fr_mc; - else if (elemText == QString::fromLatin1("fr-ch")) + else if (elemText == TQString::tqfromLatin1("fr-ch")) d->language = fr_ch; - else if (elemText == QString::fromLatin1("gl")) + else if (elemText == TQString::tqfromLatin1("gl")) d->language = gl; - else if (elemText == QString::fromLatin1("gd")) + else if (elemText == TQString::tqfromLatin1("gd")) d->language = gd; - else if (elemText == QString::fromLatin1("de")) + else if (elemText == TQString::tqfromLatin1("de")) d->language = de; - else if (elemText == QString::fromLatin1("de-at")) + else if (elemText == TQString::tqfromLatin1("de-at")) d->language = de_at; - else if (elemText == QString::fromLatin1("de-de")) + else if (elemText == TQString::tqfromLatin1("de-de")) d->language = de_de; - else if (elemText == QString::fromLatin1("de-li")) + else if (elemText == TQString::tqfromLatin1("de-li")) d->language = de_li; - else if (elemText == QString::fromLatin1("de-lu")) + else if (elemText == TQString::tqfromLatin1("de-lu")) d->language = de_lu; - else if (elemText == QString::fromLatin1("de-ch")) + else if (elemText == TQString::tqfromLatin1("de-ch")) d->language = de_ch; - else if (elemText == QString::fromLatin1("el")) + else if (elemText == TQString::tqfromLatin1("el")) d->language = el; - else if (elemText == QString::fromLatin1("hu")) + else if (elemText == TQString::tqfromLatin1("hu")) d->language = hu; - else if (elemText == QString::fromLatin1("is")) + else if (elemText == TQString::tqfromLatin1("is")) d->language = is; - else if (elemText == QString::fromLatin1("id")) + else if (elemText == TQString::tqfromLatin1("id")) d->language = id; - else if (elemText == QString::fromLatin1("ga")) + else if (elemText == TQString::tqfromLatin1("ga")) d->language = ga; - else if (elemText == QString::fromLatin1("it")) + else if (elemText == TQString::tqfromLatin1("it")) d->language = it; - else if (elemText == QString::fromLatin1("it-it")) + else if (elemText == TQString::tqfromLatin1("it-it")) d->language = it_it; - else if (elemText == QString::fromLatin1("it-ch")) + else if (elemText == TQString::tqfromLatin1("it-ch")) d->language = it_ch; - else if (elemText == QString::fromLatin1("ja")) + else if (elemText == TQString::tqfromLatin1("ja")) d->language = ja; - else if (elemText == QString::fromLatin1("ko")) + else if (elemText == TQString::tqfromLatin1("ko")) d->language = ko; - else if (elemText == QString::fromLatin1("mk")) + else if (elemText == TQString::tqfromLatin1("mk")) d->language = mk; - else if (elemText == QString::fromLatin1("no")) + else if (elemText == TQString::tqfromLatin1("no")) d->language = no; - else if (elemText == QString::fromLatin1("pl")) + else if (elemText == TQString::tqfromLatin1("pl")) d->language = pl; - else if (elemText == QString::fromLatin1("pt")) + else if (elemText == TQString::tqfromLatin1("pt")) d->language = pt; - else if (elemText == QString::fromLatin1("pt-br")) + else if (elemText == TQString::tqfromLatin1("pt-br")) d->language = pt_br; - else if (elemText == QString::fromLatin1("pt-pt")) + else if (elemText == TQString::tqfromLatin1("pt-pt")) d->language = pt_pt; - else if (elemText == QString::fromLatin1("ro")) + else if (elemText == TQString::tqfromLatin1("ro")) d->language = ro; - else if (elemText == QString::fromLatin1("ro-mo")) + else if (elemText == TQString::tqfromLatin1("ro-mo")) d->language = ro_mo; - else if (elemText == QString::fromLatin1("ro-ro")) + else if (elemText == TQString::tqfromLatin1("ro-ro")) d->language = ro_ro; - else if (elemText == QString::fromLatin1("ru")) + else if (elemText == TQString::tqfromLatin1("ru")) d->language = ru; - else if (elemText == QString::fromLatin1("ru-mo")) + else if (elemText == TQString::tqfromLatin1("ru-mo")) d->language = ru_mo; - else if (elemText == QString::fromLatin1("ru-ru")) + else if (elemText == TQString::tqfromLatin1("ru-ru")) d->language = ru_ru; - else if (elemText == QString::fromLatin1("sr")) + else if (elemText == TQString::tqfromLatin1("sr")) d->language = sr; - else if (elemText == QString::fromLatin1("sk")) + else if (elemText == TQString::tqfromLatin1("sk")) d->language = sk; - else if (elemText == QString::fromLatin1("sl")) + else if (elemText == TQString::tqfromLatin1("sl")) d->language = sl; - else if (elemText == QString::fromLatin1("es")) + else if (elemText == TQString::tqfromLatin1("es")) d->language = es; - else if (elemText == QString::fromLatin1("es-ar")) + else if (elemText == TQString::tqfromLatin1("es-ar")) d->language = es_ar; - else if (elemText == QString::fromLatin1("es-bo")) + else if (elemText == TQString::tqfromLatin1("es-bo")) d->language = es_bo; - else if (elemText == QString::fromLatin1("es-cl")) + else if (elemText == TQString::tqfromLatin1("es-cl")) d->language = es_cl; - else if (elemText == QString::fromLatin1("es-co")) + else if (elemText == TQString::tqfromLatin1("es-co")) d->language = es_co; - else if (elemText == QString::fromLatin1("es-cr")) + else if (elemText == TQString::tqfromLatin1("es-cr")) d->language = es_cr; - else if (elemText == QString::fromLatin1("es-do")) + else if (elemText == TQString::tqfromLatin1("es-do")) d->language = es_do; - else if (elemText == QString::fromLatin1("es-ec")) + else if (elemText == TQString::tqfromLatin1("es-ec")) d->language = es_ec; - else if (elemText == QString::fromLatin1("es-sv")) + else if (elemText == TQString::tqfromLatin1("es-sv")) d->language = es_sv; - else if (elemText == QString::fromLatin1("es-gt")) + else if (elemText == TQString::tqfromLatin1("es-gt")) d->language = es_gt; - else if (elemText == QString::fromLatin1("es-hn")) + else if (elemText == TQString::tqfromLatin1("es-hn")) d->language = es_hn; - else if (elemText == QString::fromLatin1("es-mx")) + else if (elemText == TQString::tqfromLatin1("es-mx")) d->language = es_mx; - else if (elemText == QString::fromLatin1("es-ni")) + else if (elemText == TQString::tqfromLatin1("es-ni")) d->language = es_ni; - else if (elemText == QString::fromLatin1("es-pa")) + else if (elemText == TQString::tqfromLatin1("es-pa")) d->language = es_pa; - else if (elemText == QString::fromLatin1("es-py")) + else if (elemText == TQString::tqfromLatin1("es-py")) d->language = es_py; - else if (elemText == QString::fromLatin1("es-pe")) + else if (elemText == TQString::tqfromLatin1("es-pe")) d->language = es_pe; - else if (elemText == QString::fromLatin1("es-pr")) + else if (elemText == TQString::tqfromLatin1("es-pr")) d->language = es_pr; - else if (elemText == QString::fromLatin1("es-es")) + else if (elemText == TQString::tqfromLatin1("es-es")) d->language = es_es; - else if (elemText == QString::fromLatin1("es-uy")) + else if (elemText == TQString::tqfromLatin1("es-uy")) d->language = es_uy; - else if (elemText == QString::fromLatin1("es-ve")) + else if (elemText == TQString::tqfromLatin1("es-ve")) d->language = es_ve; - else if (elemText == QString::fromLatin1("sv")) + else if (elemText == TQString::tqfromLatin1("sv")) d->language = sv; - else if (elemText == QString::fromLatin1("sv-fi")) + else if (elemText == TQString::tqfromLatin1("sv-fi")) d->language = sv_fi; - else if (elemText == QString::fromLatin1("sv-se")) + else if (elemText == TQString::tqfromLatin1("sv-se")) d->language = sv_se; - else if (elemText == QString::fromLatin1("tr")) + else if (elemText == TQString::tqfromLatin1("tr")) d->language = tr; - else if (elemText == QString::fromLatin1("uk")) + else if (elemText == TQString::tqfromLatin1("uk")) d->language = uk; else d->language = UndefinedLanguage; } if (d->format == AtomFeed) - tagName=QString::fromLatin1("issued"); // atom doesn't specify this for feeds + tagName=TQString::tqfromLatin1("issued"); // atom doesn't specify this for feeds // but some broken feeds do this else - tagName=QString::fromLatin1("pubDate"); + tagName=TQString::tqfromLatin1("pubDate"); if (!(elemText = extractNode(channelNode, tagName)).isNull()) { time_t _time; @@ -408,7 +408,7 @@ Document::Document(const QDomDocument &doc) : d(new Private) d->pubDate.setTime_t(_time); } - if (!(elemText = extractNode(channelNode, QString::fromLatin1("dc:date"))).isNull()) { + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("dc:date"))).isNull()) { time_t _time = parseISO8601Date(elemText); /* \bug This isn't really the right way since it will set the date to * Jan 1 1970, 1:00:00 if the passed date was invalid; this means that @@ -418,9 +418,9 @@ Document::Document(const QDomDocument &doc) : d(new Private) } if (d->format == AtomFeed) - tagName=QString::fromLatin1("modified"); + tagName=TQString::tqfromLatin1("modified"); else - tagName=QString::fromLatin1("lastBuildDate"); + tagName=TQString::tqfromLatin1("lastBuildDate"); if (!(elemText = extractNode(channelNode, tagName)).isNull()) { time_t _time; if (d->format == AtomFeed) @@ -430,44 +430,44 @@ Document::Document(const QDomDocument &doc) : d(new Private) d->lastBuildDate.setTime_t(_time); } - if (!(elemText = extractNode(channelNode, QString::fromLatin1("rating"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("rating"))).isNull()) d->rating = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1("docs"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("docs"))).isNull()) d->docs = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1((d->format == AtomFeed) ? "author" : "managingEditor"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1((d->format == AtomFeed) ? "author" : "managingEditor"))).isNull()) d->managingEditor = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1("webMaster"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("webMaster"))).isNull()) d->webMaster = elemText; - if (!(elemText = extractNode(channelNode, QString::fromLatin1("ttl"))).isNull()) + if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("ttl"))).isNull()) d->ttl = elemText.toUInt(); - n = channelNode.namedItem(QString::fromLatin1("skipHours")); + n = channelNode.namedItem(TQString::tqfromLatin1("skipHours")); if (!n.isNull()) - for (QDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) - if (e.tagName() == QString::fromLatin1("hour")) + for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) + if (e.tagName() == TQString::tqfromLatin1("hour")) d->skipHours.append(e.text().toUInt()); - n = channelNode.namedItem(QString::fromLatin1("skipDays")); + n = channelNode.namedItem(TQString::tqfromLatin1("skipDays")); if (!n.isNull()) { Day day; - QString elemText; - for (QDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) - if (e.tagName() == QString::fromLatin1("day")) { + TQString elemText; + for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) + if (e.tagName() == TQString::tqfromLatin1("day")) { elemText = e.text().lower(); - if (elemText == QString::fromLatin1("monday")) + if (elemText == TQString::tqfromLatin1("monday")) day = Monday; - else if (elemText == QString::fromLatin1("tuesday")) + else if (elemText == TQString::tqfromLatin1("tuesday")) day = Tuesday; - else if (elemText == QString::fromLatin1("wednesday")) + else if (elemText == TQString::tqfromLatin1("wednesday")) day = Wednesday; - else if (elemText == QString::fromLatin1("thursday")) + else if (elemText == TQString::tqfromLatin1("thursday")) day = Thursday; - else if (elemText == QString::fromLatin1("friday")) + else if (elemText == TQString::tqfromLatin1("friday")) day = Friday; - else if (elemText == QString::fromLatin1("saturday")) + else if (elemText == TQString::tqfromLatin1("saturday")) day = Saturday; - else if (elemText == QString::fromLatin1("sunday")) + else if (elemText == TQString::tqfromLatin1("sunday")) day = Sunday; else day = UndefinedDay; @@ -493,29 +493,29 @@ Version Document::version() const return d->version; } -QString Document::verbVersion() const +TQString Document::verbVersion() const { switch (d->version) { - case v0_90: return QString::fromLatin1("0.90"); - case v0_91: return QString::fromLatin1("0.91"); - case v0_92: return QString::fromLatin1("0.92"); - case v0_93: return QString::fromLatin1("0.93"); - case v0_94: return QString::fromLatin1("0.94"); - case v1_0: return QString::fromLatin1("1.0"); - case v2_0: return QString::fromLatin1("2.0"); - case vAtom_0_3: return QString::fromLatin1("0.3"); - case vAtom_0_2: return QString::fromLatin1("0.2"); - case vAtom_0_1: return QString::fromLatin1("0.1"); + case v0_90: return TQString::tqfromLatin1("0.90"); + case v0_91: return TQString::tqfromLatin1("0.91"); + case v0_92: return TQString::tqfromLatin1("0.92"); + case v0_93: return TQString::tqfromLatin1("0.93"); + case v0_94: return TQString::tqfromLatin1("0.94"); + case v1_0: return TQString::tqfromLatin1("1.0"); + case v2_0: return TQString::tqfromLatin1("2.0"); + case vAtom_0_3: return TQString::tqfromLatin1("0.3"); + case vAtom_0_2: return TQString::tqfromLatin1("0.2"); + case vAtom_0_1: return TQString::tqfromLatin1("0.1"); } - return QString::null; + return TQString(); } -QString Document::title() const +TQString Document::title() const { return d->title; } -QString Document::description() const +TQString Document::description() const { return d->description; } @@ -555,22 +555,22 @@ Language Document::language() const return d->language; } -QString Document::copyright() const +TQString Document::copyright() const { return d->copyright; } -const QDateTime &Document::pubDate() const +const TQDateTime &Document::pubDate() const { return d->pubDate; } -const QDateTime &Document::lastBuildDate() const +const TQDateTime &Document::lastBuildDate() const { return d->lastBuildDate; } -QString Document::rating() const +TQString Document::rating() const { return d->rating; } @@ -580,12 +580,12 @@ const KURL &Document::docs() const return d->docs; } -QString Document::managingEditor() const +TQString Document::managingEditor() const { return d->managingEditor; } -QString Document::webMaster() const +TQString Document::webMaster() const { return d->webMaster; } diff --git a/plugins/rssfeed/rss/document.h b/plugins/rssfeed/rss/document.h index 1ead634..c65c15e 100644 --- a/plugins/rssfeed/rss/document.h +++ b/plugins/rssfeed/rss/document.h @@ -14,8 +14,8 @@ #include "article.h" #include "global.h" -class QDateTime; -class QDomDocument; +class TQDateTime; +class TQDomDocument; namespace RSS { @@ -45,7 +45,7 @@ namespace RSS /** * Constructs a Document from a piece of XML markup. */ - Document(const QDomDocument &doc); + Document(const TQDomDocument &doc); /** * Assignment operator. @@ -75,28 +75,28 @@ namespace RSS /** * Convenience method. Differs from version() only in how the result * is returned. - * @return A QString representing the verbose version of the + * @return A TQString representing the verbose version of the * document. * @see version() */ - QString verbVersion() const; + TQString verbVersion() const; /** * RSS 0.90 and upwards - * @return The title of the RSS document, or QString::null if no + * @return The title of the RSS document, or TQString() if no * title was available. This is often the name of the news source * from which the RSS document was retrieved. */ - QString title() const; + TQString title() const; /** * RSS 0.90 and upwards - * @return The description of the RSS document, or QString::null + * @return The description of the RSS document, or TQString() * if no description was available. This is usually a short slogan * or description of the news source from which the RSS document * was retrieved. */ - QString description() const; + TQString description() const; /** * RSS 0.90 and upwards @@ -158,28 +158,28 @@ namespace RSS /** * RSS 0.91 and upwards * @return A copyright of the information contained in the RSS - * document, or QString::null if no copyright is available. + * document, or TQString() if no copyright is available. */ - QString copyright() const; + TQString copyright() const; /** * RSS 0.91 and upwards * @return The date when the RSS document was published. */ - const QDateTime &pubDate() const; + const TQDateTime &pubDate() const; /** * RSS 0.91 and upwards. * @return The last time the channel was modified. */ - const QDateTime &lastBuildDate() const; + const TQDateTime &lastBuildDate() const; /** * RSS 0.91 and upwards * @return A <a href="http://www.w3.org/PICS/#Specs">PICS</a> * rating for this page. */ - QString rating() const; + TQString rating() const; /** * RSS 0.91 and upwards @@ -197,16 +197,16 @@ namespace RSS * [email protected] (Bull Mancuso). * @see webMaster() */ - QString managingEditor() const; + TQString managingEditor() const; /** * RSS 0.91 and upwards * @return The email address of the webmaster for the site, the * person to contact if there are technical problems with the - * channel, or QString::null if this information isn't available. + * channel, or TQString() if this information isn't available. * @see managingEditor() */ - QString webMaster() const; + TQString webMaster() const; /** * RSS 0.91 and upwards diff --git a/plugins/rssfeed/rss/global.h b/plugins/rssfeed/rss/global.h index 3a954e6..e4bc7c7 100644 --- a/plugins/rssfeed/rss/global.h +++ b/plugins/rssfeed/rss/global.h @@ -12,7 +12,7 @@ #define LIBRSS_GLOBAL_H template <class> -class QValueList; +class TQValueList; namespace RSS { @@ -39,7 +39,7 @@ namespace RSS * Possible status values returned by the signal * Loader::loadingComplete(). */ - enum Status { + enum tqStatus { Success, /** * Nothing went wrong so far, but you still have to check * what values are returned by the classes since it's not @@ -133,12 +133,12 @@ namespace RSS /** * This type is used by Document::skipDays(). */ - typedef QValueList<Day> DayList; + typedef TQValueList<Day> DayList; /** * This type is used by Document::skipHours(). */ - typedef QValueList<unsigned short> HourList; + typedef TQValueList<unsigned short> HourList; } #endif // LIBRSS_GLOBAL_H diff --git a/plugins/rssfeed/rss/image.cpp b/plugins/rssfeed/rss/image.cpp index 33e1544..98074be 100644 --- a/plugins/rssfeed/rss/image.cpp +++ b/plugins/rssfeed/rss/image.cpp @@ -14,9 +14,9 @@ #include <kio/job.h> #include <kurl.h> -#include <qbuffer.h> -#include <qdom.h> -#include <qpixmap.h> +#include <tqbuffer.h> +#include <tqdom.h> +#include <tqpixmap.h> using namespace RSS; @@ -25,40 +25,40 @@ struct Image::Private : public Shared Private() : height(31), width(88), pixmapBuffer(NULL), job(NULL) { } - QString title; + TQString title; KURL url; KURL link; - QString description; + TQString description; unsigned int height; unsigned int width; - QBuffer *pixmapBuffer; + TQBuffer *pixmapBuffer; KIO::Job *job; }; -Image::Image() : QObject(), d(new Private) +Image::Image() : TQObject(), d(new Private) { } -Image::Image(const Image &other) : QObject(), d(0) +Image::Image(const Image &other) : TQObject(), d(0) { *this = other; } -Image::Image(const QDomNode &node) : QObject(), d(new Private) +Image::Image(const TQDomNode &node) : TQObject(), d(new Private) { - QString elemText; + TQString elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("title"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) d->title = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("url"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("url"))).isNull()) d->url = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("link"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) d->link = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("description"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("description"))).isNull()) d->description = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("height"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("height"))).isNull()) d->height = elemText.toUInt(); - if (!(elemText = extractNode(node, QString::fromLatin1("width"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("width"))).isNull()) d->width = elemText.toUInt(); } @@ -72,7 +72,7 @@ Image::~Image() } } -QString Image::title() const +TQString Image::title() const { return d->title; } @@ -87,7 +87,7 @@ const KURL &Image::link() const return d->link; } -QString Image::description() const +TQString Image::description() const { return d->description; } @@ -108,25 +108,25 @@ void Image::getPixmap() if (d->pixmapBuffer) return; - d->pixmapBuffer = new QBuffer; + d->pixmapBuffer = new TQBuffer; d->pixmapBuffer->open(IO_WriteOnly); d->job = KIO::get(d->url, false, false); - connect(d->job, SIGNAL(data(KIO::Job *, const QByteArray &)), - this, SLOT(slotData(KIO::Job *, const QByteArray &))); - connect(d->job, SIGNAL(result(KIO::Job *)), this, SLOT(slotResult(KIO::Job *))); + connect(d->job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + this, TQT_SLOT(slotData(KIO::Job *, const TQByteArray &))); + connect(d->job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotResult(KIO::Job *))); } -void Image::slotData(KIO::Job *, const QByteArray &data) +void Image::slotData(KIO::Job *, const TQByteArray &data) { d->pixmapBuffer->writeBlock(data.data(), data.size()); } void Image::slotResult(KIO::Job *job) { - QPixmap pixmap; + TQPixmap pixmap; if (!job->error()) - pixmap = QPixmap(d->pixmapBuffer->buffer()); + pixmap = TQPixmap(d->pixmapBuffer->buffer()); emit gotPixmap(pixmap); delete d->pixmapBuffer; diff --git a/plugins/rssfeed/rss/image.h b/plugins/rssfeed/rss/image.h index e9e65b1..f0a43ca 100644 --- a/plugins/rssfeed/rss/image.h +++ b/plugins/rssfeed/rss/image.h @@ -13,9 +13,9 @@ #include "global.h" -#include <qobject.h> +#include <tqobject.h> -class QDomNode; +class TQDomNode; namespace KIO { @@ -31,9 +31,10 @@ namespace RSS * is via Document::image(). * @see Document::image() */ - class Image : public QObject + class Image : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. @@ -48,10 +49,10 @@ namespace RSS /** * Constructs an Image from a piece of RSS markup. - * @param node A QDomNode which references the DOM leaf to be used + * @param node A TQDomNode which references the DOM leaf to be used * for constructing the Image. */ - Image(const QDomNode &node); + Image(const TQDomNode &node); /** * Assignment operator. @@ -83,10 +84,10 @@ namespace RSS /** * RSS 0.90 and upwards - * @return The 'caption' of this image, or QString::null if no + * @return The 'caption' of this image, or TQString() if no * caption is available. */ - QString title() const; + TQString title() const; /** * RSS 0.90 and upwards @@ -112,11 +113,11 @@ namespace RSS /** * RSS 0.91 and upwards * @return A description of what this picture shows, or - * QString::null if no description is available. Useful for + * TQString() if no description is available. Useful for * people who deactivated images but want or need to know what is * shown. */ - QString description() const; + TQString description() const; /** * RSS 0.91 and upwards @@ -125,7 +126,7 @@ namespace RSS * this value to be between 1 and 400. * '0' if this information isn't available. This is merely provided * for completeness, you should not rely on this value but rather - * check what height the QPixmap as returned by gotPixmap() + * check what height the TQPixmap as returned by gotPixmap() * reports. */ unsigned int height() const; @@ -136,7 +137,7 @@ namespace RSS * default value is 88 pixels. The RSS 0.91 Specification requires * this value to be between 1 and 144. * This is merely provided for completeness, you should not rely - * on this value but rather check what width the QPixmap as + * on this value but rather check what width the TQPixmap as * returned by gotPixmap() reports. */ unsigned int width() const; @@ -157,10 +158,10 @@ namespace RSS * @param pixmap The pixmap as constructed from the data referenced * by the URL returned by link(). */ - void gotPixmap(const QPixmap &pixmap); + void gotPixmap(const TQPixmap &pixmap); private slots: - void slotData(KIO::Job *job, const QByteArray &data); + void slotData(KIO::Job *job, const TQByteArray &data); void slotResult(KIO::Job *job); private: diff --git a/plugins/rssfeed/rss/loader.cpp b/plugins/rssfeed/rss/loader.cpp index 9dfb50a..835a2e6 100644 --- a/plugins/rssfeed/rss/loader.cpp +++ b/plugins/rssfeed/rss/loader.cpp @@ -16,11 +16,11 @@ #include <kurl.h> #include <kdebug.h> -#include <qdom.h> -#include <qbuffer.h> -#include <qregexp.h> -#include <qstringlist.h> -#include <qtimer.h> +#include <tqdom.h> +#include <tqbuffer.h> +#include <tqregexp.h> +#include <tqstringlist.h> +#include <tqtimer.h> using namespace RSS; @@ -45,7 +45,7 @@ struct FileRetriever::Private delete buffer; } - QBuffer *buffer; + TQBuffer *buffer; int lastError; KIO::Job *job; }; @@ -72,7 +72,7 @@ void FileRetriever::retrieveData(const KURL &url) if (d->buffer) return; - d->buffer = new QBuffer; + d->buffer = new TQBuffer; d->buffer->open(IO_WriteOnly); KURL u=url; @@ -83,13 +83,13 @@ void FileRetriever::retrieveData(const KURL &url) d->job = KIO::get(u, !m_useCache, false); - QTimer::singleShot(1000*90, this, SLOT(slotTimeout())); + TQTimer::singleShot(1000*90, this, TQT_SLOT(slotTimeout())); - connect(d->job, SIGNAL(data(KIO::Job *, const QByteArray &)), - SLOT(slotData(KIO::Job *, const QByteArray &))); - connect(d->job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *))); - connect(d->job, SIGNAL(permanentRedirection(KIO::Job *, const KURL &, const KURL &)), - SLOT(slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &))); + connect(d->job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + TQT_SLOT(slotData(KIO::Job *, const TQByteArray &))); + connect(d->job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *))); + connect(d->job, TQT_SIGNAL(permanentRedirection(KIO::Job *, const KURL &, const KURL &)), + TQT_SLOT(slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &))); } void FileRetriever::slotTimeout() @@ -101,7 +101,7 @@ void FileRetriever::slotTimeout() d->lastError = KIO::ERR_SERVER_TIMEOUT; - emit dataRetrieved(QByteArray(), false); + emit dataRetrieved(TQByteArray(), false); } int FileRetriever::errorCode() const @@ -109,14 +109,14 @@ int FileRetriever::errorCode() const return d->lastError; } -void FileRetriever::slotData(KIO::Job *, const QByteArray &data) +void FileRetriever::slotData(KIO::Job *, const TQByteArray &data) { d->buffer->writeBlock(data.data(), data.size()); } void FileRetriever::slotResult(KIO::Job *job) { - QByteArray data = d->buffer->buffer(); + TQByteArray data = d->buffer->buffer(); data.detach(); delete d->buffer; @@ -155,7 +155,7 @@ struct OutputRetriever::Private } KShellProcess *process; - QBuffer *buffer; + TQBuffer *buffer; int lastError; }; @@ -175,14 +175,14 @@ void OutputRetriever::retrieveData(const KURL &url) if (d->buffer || d->process) return; - d->buffer = new QBuffer; + d->buffer = new TQBuffer; d->buffer->open(IO_WriteOnly); d->process = new KShellProcess(); - connect(d->process, SIGNAL(processExited(KProcess *)), - SLOT(slotExited(KProcess *))); - connect(d->process, SIGNAL(receivedStdout(KProcess *, char *, int)), - SLOT(slotOutput(KProcess *, char *, int))); + connect(d->process, TQT_SIGNAL(processExited(KProcess *)), + TQT_SLOT(slotExited(KProcess *))); + connect(d->process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), + TQT_SLOT(slotOutput(KProcess *, char *, int))); *d->process << url.path(); d->process->start(KProcess::NotifyOnExit, KProcess::Stdout); } @@ -202,7 +202,7 @@ void OutputRetriever::slotExited(KProcess *p) if (!p->normalExit()) d->lastError = p->exitStatus(); - QByteArray data = d->buffer->buffer(); + TQByteArray data = d->buffer->buffer(); data.detach(); delete d->buffer; @@ -237,10 +237,10 @@ Loader *Loader::create() return new Loader; } -Loader *Loader::create(QObject *object, const char *slot) +Loader *Loader::create(TQObject *object, const char *slot) { Loader *loader = create(); - connect(loader, SIGNAL(loadingComplete(Loader *, Document, Status)), + connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, tqStatus)), object, slot); return loader; } @@ -262,8 +262,8 @@ void Loader::loadFrom(const KURL &url, DataRetriever *retriever) d->url=url; d->retriever = retriever; - connect(d->retriever, SIGNAL(dataRetrieved(const QByteArray &, bool)), - this, SLOT(slotRetrieverDone(const QByteArray &, bool))); + connect(d->retriever, TQT_SIGNAL(dataRetrieved(const TQByteArray &, bool)), + this, TQT_SLOT(slotRetrieverDone(const TQByteArray &, bool))); d->retriever->retrieveData(url); } @@ -281,7 +281,7 @@ void Loader::abort() delete d->retriever; d->retriever=NULL; } - emit loadingComplete(this, QDomDocument(), Aborted); + emit loadingComplete(this, TQDomDocument(), Aborted); delete this; } @@ -292,7 +292,7 @@ const KURL &Loader::discoveredFeedURL() const #include <kdebug.h> -void Loader::slotRetrieverDone(const QByteArray &data, bool success) +void Loader::slotRetrieverDone(const TQByteArray &data, bool success) { d->lastError = d->retriever->errorCode(); @@ -300,29 +300,29 @@ void Loader::slotRetrieverDone(const QByteArray &data, bool success) d->retriever = NULL; Document rssDoc; - Status status = Success; + tqStatus status = Success; if (success) { - QDomDocument doc; + TQDomDocument doc; /* Some servers insert whitespace before the <?xml...?> declaration. - * QDom doesn't tolerate that (and it's right, that's invalid XML), + * TQDom doesn't tolerate that (and it's right, that's invalid XML), * so we strip that. */ const char *charData = data.data(); int len = data.count(); - while (len && QChar(*charData).isSpace()) { + while (len && TQChar(*charData).isSpace()) { --len; ++charData; } - if ( len > 3 && QChar(*charData) == QChar(0357) ) { // 0357 0273 0277 + if ( len > 3 && TQChar(*charData) == TQChar(0357) ) { // 0357 0273 0277 len -= 3; charData += 3; } - QByteArray tmpData; + TQByteArray tmpData; tmpData.setRawData(charData, len); if (doc.setContent(tmpData)) @@ -349,24 +349,24 @@ void Loader::slotRetrieverDone(const QByteArray &data, bool success) delete this; } -void Loader::discoverFeeds(const QByteArray &data) +void Loader::discoverFeeds(const TQByteArray &data) { - QString str = QString(data).simplifyWhiteSpace(); - QString s2; - //QTextStream ts( &str, IO_WriteOnly ); + TQString str = TQString(data).simplifyWhiteSpace(); + TQString s2; + //TQTextStream ts( &str, IO_WriteOnly ); //ts << data.data(); // "<[\\s]link[^>]*rel[\\s]=[\\s]\\\"[\\s]alternate[\\s]\\\"[^>]*>" // "type[\\s]=[\\s]\\\"application/rss+xml\\\"" // "href[\\s]=[\\s]\\\"application/rss+xml\\\"" - QRegExp rx( "(?:REL)[^=]*=[^sAa]*(?:service.feed|ALTERNATE)[\\s]*[^s][^s](?:[^>]*)(?:HREF)[^=]*=[^A-Z0-9-_~,./$]*([^'\">\\s]*)", false); + TQRegExp rx( "(?:REL)[^=]*=[^sAa]*(?:service.feed|ALTERNATE)[\\s]*[^s][^s](?:[^>]*)(?:HREF)[^=]*=[^A-Z0-9-_~,./$]*([^'\">\\s]*)", false); if (rx.search(str)!=-1) s2=rx.cap(1); else{ // does not support Atom/RSS autodiscovery.. try finding feeds by brute force.... int pos=0; - QStringList feeds; - QString host=d->url.host(); + TQStringList feeds; + TQString host=d->url.host(); rx.setPattern("(?:<A )[^H]*(?:HREF)[^=]*=[^A-Z0-9-_~,./]*([^'\">\\s]*)"); while ( pos >= 0 ) { pos = rx.search( str, pos ); @@ -381,7 +381,7 @@ void Loader::discoverFeeds(const QByteArray &data) s2=feeds.first(); KURL testURL; // loop through, prefer feeds on same host - for ( QStringList::Iterator it = feeds.begin(); it != feeds.end(); ++it ) { + for ( TQStringList::Iterator it = feeds.begin(); it != feeds.end(); ++it ) { testURL=*it; if (testURL.host()==host) { diff --git a/plugins/rssfeed/rss/loader.h b/plugins/rssfeed/rss/loader.h index fb06634..438ebaf 100644 --- a/plugins/rssfeed/rss/loader.h +++ b/plugins/rssfeed/rss/loader.h @@ -15,7 +15,7 @@ class KURL; -#include <qobject.h> +#include <tqobject.h> namespace KIO { @@ -32,9 +32,10 @@ namespace RSS * a new retrieval algorithm which can then be plugged into the RSS loader. * @see Loader, FileRetriever, OutputRetriever */ - class DataRetriever : public QObject + class DataRetriever : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. @@ -75,7 +76,7 @@ namespace RSS * wrong and that the data parameter might contain no or invalid * data. */ - void dataRetrieved(const QByteArray &data, bool success); + void dataRetrieved(const TQByteArray &data, bool success); private: DataRetriever(const DataRetriever &other); @@ -89,6 +90,7 @@ namespace RSS class FileRetriever : public DataRetriever { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. @@ -135,7 +137,7 @@ namespace RSS void slotTimeout(); private slots: - void slotData(KIO::Job *job, const QByteArray &data); + void slotData(KIO::Job *job, const TQByteArray &data); void slotResult(KIO::Job *job); void slotPermanentRedirection(KIO::Job *job, const KURL &fromUrl, const KURL &toUrl); @@ -158,6 +160,7 @@ namespace RSS class OutputRetriever : public DataRetriever { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. @@ -206,8 +209,8 @@ namespace RSS * * \code * Loader *loader = Loader::create(); - * connect(loader, SIGNAL(loadingComplete(Loader *, Document, Status)), - * this, SLOT(slotLoadingComplete(Loader *, Document, Status))); + * connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, tqStatus)), + * this, TQT_SLOT(slotLoadingComplete(Loader *, Document, tqStatus))); * loader->loadFrom("http://www.blah.org/foobar.rdf", new FileRetriever); * \endcode * @@ -231,7 +234,7 @@ namespace RSS * 'slotLoadingComplete' method might look like this: * * \code - * void MyClass::slotLoadingComplete(Loader *loader, Document doc, Status status) + * void MyClass::slotLoadingComplete(Loader *loader, Document doc, tqStatus status) * { * // Note that Loader::~Loader() is private, so you cannot delete Loader instances. * // You don't need to do that anyway since Loader instances delete themselves. @@ -239,7 +242,7 @@ namespace RSS * if (status != RSS::Success) * return; * - * QString title = doc.title(); + * TQString title = doc.title(); * // do whatever you want with the information. * } * \endcode @@ -249,9 +252,10 @@ namespace RSS * loadingComplete signal goes out of scope. This is e.g. the case if you * intend to call getPixmap() on Document::image()! */ - class Loader : public QObject + class Loader : public TQObject { Q_OBJECT + TQ_OBJECT friend class someClassWhichDoesNotExist; public: /** @@ -268,10 +272,10 @@ namespace RSS * Convenience method. Does the same as the above method except that * it also does the job of connecting the loadingComplete() signal * to the given slot for you. - * @param object A QObject which features the specified slot + * @param object A TQObject which features the specified slot * @param slot Which slot to connect to. */ - static Loader *create(QObject *object, const char *slot); + static Loader *create(TQObject *object, const char *slot); /** * Loads the RSS file referenced by the given URL using the @@ -316,19 +320,19 @@ namespace RSS * the case if you intend to call getPixmap() on Document::image()! * @param status A status byte telling whether there were any problems * while retrieving or parsing the data. - * @see Document, Status + * @see Document, tqStatus */ - void loadingComplete(Loader *loader, Document doc, Status status); + void loadingComplete(Loader *loader, Document doc, tqStatus status); private slots: - void slotRetrieverDone(const QByteArray &data, bool success); + void slotRetrieverDone(const TQByteArray &data, bool success); private: Loader(); Loader(const Loader &other); Loader &operator=(const Loader &other); ~Loader(); - void discoverFeeds(const QByteArray &data); + void discoverFeeds(const TQByteArray &data); struct Private; Private *d; diff --git a/plugins/rssfeed/rss/testlibrss.cpp b/plugins/rssfeed/rss/testlibrss.cpp index 5d98bba..571717a 100644 --- a/plugins/rssfeed/rss/testlibrss.cpp +++ b/plugins/rssfeed/rss/testlibrss.cpp @@ -16,15 +16,15 @@ static const KCmdLineOptions options[] = }; -void Tester::test( const QString &url ) +void Tester::test( const TQString &url ) { Loader *loader = Loader::create(); - connect( loader, SIGNAL( loadingComplete( Loader *, Document, Status ) ), - this, SLOT( slotLoadingComplete( Loader *, Document, Status ) ) ); + connect( loader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), + this, TQT_SLOT( slotLoadingComplete( Loader *, Document, tqStatus ) ) ); loader->loadFrom( url, new FileRetriever ); } -void Tester::slotLoadingComplete( Loader *loader, Document doc, Status status ) +void Tester::slotLoadingComplete( Loader *loader, Document doc, tqStatus status ) { if ( status == Success ) { diff --git a/plugins/rssfeed/rss/testlibrss.h b/plugins/rssfeed/rss/testlibrss.h index c65fa3b..18e1832 100644 --- a/plugins/rssfeed/rss/testlibrss.h +++ b/plugins/rssfeed/rss/testlibrss.h @@ -1,7 +1,7 @@ #ifndef TESTLIBRSS_H #define TESTLIBRSS_H -#include <qobject.h> +#include <tqobject.h> #include "loader.h" #include "document.h" @@ -10,16 +10,17 @@ using RSS::Loader; using RSS::Document; -using RSS::Status; +using RSS::tqStatus; -class Tester : public QObject +class Tester : public TQObject { Q_OBJECT + TQ_OBJECT public: - void test( const QString &url ); + void test( const TQString &url ); private slots: - void slotLoadingComplete( Loader *loader, Document doc, Status status ); + void slotLoadingComplete( Loader *loader, Document doc, tqStatus status ); }; #endif diff --git a/plugins/rssfeed/rss/textinput.cpp b/plugins/rssfeed/rss/textinput.cpp index 432b773..a12442f 100644 --- a/plugins/rssfeed/rss/textinput.cpp +++ b/plugins/rssfeed/rss/textinput.cpp @@ -13,15 +13,15 @@ #include <kurl.h> -#include <qdom.h> +#include <tqdom.h> using namespace RSS; struct TextInput::Private : public Shared { - QString title; - QString description; - QString name; + TQString title; + TQString description; + TQString name; KURL link; }; @@ -34,17 +34,17 @@ TextInput::TextInput(const TextInput &other) : d(0) *this = other; } -TextInput::TextInput(const QDomNode &node) : d(new Private) +TextInput::TextInput(const TQDomNode &node) : d(new Private) { - QString elemText; + TQString elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("title"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) d->title = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("description"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("description"))).isNull()) d->description = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("name")))) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("name")))) d->name = elemText; - if (!(elemText = extractNode(node, QString::fromLatin1("link"))).isNull()) + if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) d->link = elemText; } @@ -54,17 +54,17 @@ TextInput::~TextInput() delete d; } -QString TextInput::title() const +TQString TextInput::title() const { return d->title; } -QString TextInput::description() const +TQString TextInput::description() const { return d->description; } -QString TextInput::name() const +TQString TextInput::name() const { return d->name; } diff --git a/plugins/rssfeed/rss/textinput.h b/plugins/rssfeed/rss/textinput.h index dd13c42..cbf5bdb 100644 --- a/plugins/rssfeed/rss/textinput.h +++ b/plugins/rssfeed/rss/textinput.h @@ -15,8 +15,8 @@ class KURL; -class QDomNode; -class QString; +class TQDomNode; +class TQString; namespace RSS { @@ -43,10 +43,10 @@ namespace RSS /** * Constructs a TextInput from a piece of RSS markup. - * @param node A QDomNode which references the DOM leaf to be used + * @param node A TQDomNode which references the DOM leaf to be used * for constructing the TextInput. */ - TextInput(const QDomNode &node); + TextInput(const TQDomNode &node); /** * Assignment operator. @@ -79,25 +79,25 @@ namespace RSS /** * RSS 0.90 and upwards * @return The title (often a label to be used for the input field) - * of the text input, or QString::null if no title is available. + * of the text input, or TQString() if no title is available. */ - QString title() const; + TQString title() const; /** * RSS 0.90 and upwards * @return The description (usually used as a tooltip which appears * if the mouse hovers above the input field for a short time) of - * the text input, or QString::null if no description is + * the text input, or TQString() if no description is * available. */ - QString description() const; + TQString description() const; /** * RSS 0.90 and upwards * @return The name of the text input (what's this for?) of the - * text input, or QString::null, if no name is available. + * text input, or TQString(), if no name is available. */ - QString name() const; + TQString name() const; /** * RSS 0.90 and upwards diff --git a/plugins/rssfeed/rss/tools_p.cpp b/plugins/rssfeed/rss/tools_p.cpp index c1ebbc9..51fcbf5 100644 --- a/plugins/rssfeed/rss/tools_p.cpp +++ b/plugins/rssfeed/rss/tools_p.cpp @@ -11,39 +11,39 @@ #include "tools_p.h" #include <krfcdate.h> -#include <qdom.h> +#include <tqdom.h> -time_t RSS::parseISO8601Date(const QString &s) +time_t RSS::parseISO8601Date(const TQString &s) { // do some sanity check: 26-12-2004T00:00+00:00 is parsed to epoch+1 in the KRFCDate, which is wrong. So let's check if the date begins with YYYY -fo if (s.stripWhiteSpace().left(4).toInt() < 1000) return 0; // error // FIXME: imho this is done in KRFCDate::parseDateISO8601() automatically, so we could omit it? -fo - if (s.find('T') != -1) + if (s.tqfind('T') != -1) return KRFCDate::parseDateISO8601(s); else return KRFCDate::parseDateISO8601(s + "T12:00:00"); } -QString RSS::extractNode(const QDomNode &parent, const QString &elemName, bool isInlined) +TQString RSS::extractNode(const TQDomNode &tqparent, const TQString &elemName, bool isInlined) { - QDomNode node = parent.namedItem(elemName); + TQDomNode node = tqparent.namedItem(elemName); if (node.isNull()) - return QString::null; + return TQString(); - QString result = node.toElement().text(); + TQString result = node.toElement().text(); - bool hasPre = result.contains("<pre>",false); - bool hasHtml = hasPre || result.contains("<"); // FIXME: test if we have html, should be more clever -> regexp + bool hasPre = result.tqcontains("<pre>",false); + bool hasHtml = hasPre || result.tqcontains("<"); // FIXME: test if we have html, should be more clever -> regexp if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts - result = result = result.replace(QChar('\n'), "<br />"); + result = result = result.tqreplace(TQChar('\n'), "<br />"); if(!hasPre) // strip white spaces if no <pre> result = result.simplifyWhiteSpace(); if (result.isEmpty()) - return QString::null; + return TQString(); return result; } diff --git a/plugins/rssfeed/rss/tools_p.h b/plugins/rssfeed/rss/tools_p.h index 5076004..1f77171 100644 --- a/plugins/rssfeed/rss/tools_p.h +++ b/plugins/rssfeed/rss/tools_p.h @@ -13,8 +13,8 @@ #include <time.h> -class QDomNode; -class QString; +class TQDomNode; +class TQString; namespace RSS { @@ -26,8 +26,8 @@ namespace RSS unsigned int count; }; - QString extractNode(const QDomNode &parent, const QString &elemName, bool isInlined=true); - time_t parseISO8601Date(const QString &s); + TQString extractNode(const TQDomNode &tqparent, const TQString &elemName, bool isInlined=true); + time_t parseISO8601Date(const TQString &s); } #endif // LIBRSS_TOOLS_P_H diff --git a/plugins/rssfeed/rssarticle.cpp b/plugins/rssfeed/rssarticle.cpp index afc932d..a73b3c9 100644 --- a/plugins/rssfeed/rssarticle.cpp +++ b/plugins/rssfeed/rssarticle.cpp @@ -43,7 +43,7 @@ namespace kt *this = other; } - RssArticle::RssArticle(QString title, KURL link, QString description, QDateTime pubDate, QString guid, int downloaded) + RssArticle::RssArticle(TQString title, KURL link, TQString description, TQDateTime pubDate, TQString guid, int downloaded) { m_title = title; m_link = link; @@ -74,20 +74,20 @@ namespace kt return m_guid==other.guid(); } - QDataStream &operator<<( QDataStream &out, const RssArticle &article ) + TQDataStream &operator<<( TQDataStream &out, const RssArticle &article ) { out << article.title() << article.link() << article.description() << article.pubDate() << article.guid() << article.downloaded(); return out; } - QDataStream &operator>>( QDataStream &in, RssArticle &article ) + TQDataStream &operator>>( TQDataStream &in, RssArticle &article ) { KURL link; - QString title; - QString description; - QDateTime pubDate; - QString guid; + TQString title; + TQString description; + TQDateTime pubDate; + TQString guid; int downloaded; in >> title >> link >> description >> pubDate >> guid >> downloaded; article = RssArticle(title, link, description, pubDate, guid, downloaded); diff --git a/plugins/rssfeed/rssarticle.h b/plugins/rssfeed/rssarticle.h index 4d8c536..e727456 100644 --- a/plugins/rssfeed/rssarticle.h +++ b/plugins/rssfeed/rssarticle.h @@ -20,9 +20,9 @@ #ifndef RSSARTICLE_H #define RSSARTICLE_H -#include <qstring.h> -#include <qdatetime.h> -#include <qdatastream.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqdatastream.h> #include <kurl.h> @@ -41,7 +41,7 @@ namespace kt { public: - typedef QValueList<RssArticle> List; + typedef TQValueList<RssArticle> List; /** * Default constructor. @@ -51,31 +51,31 @@ namespace kt RssArticle(const RssArticle &other); RssArticle &operator=(const RssArticle &other); bool operator==(const RssArticle &other) const; - RssArticle(QString title, KURL link, QString description, QDateTime pubDate, QString guid, int downloaded = 0); + RssArticle(TQString title, KURL link, TQString description, TQDateTime pubDate, TQString guid, int downloaded = 0); - void setTitle(const QString& title) { m_title=title; } + void setTitle(const TQString& title) { m_title=title; } void setDownloaded(const int downloaded) { m_downloaded=downloaded; } - QString title() const { return m_title; } + TQString title() const { return m_title; } KURL link() const { return m_link; } - QString description() const { return m_description; } - QDateTime pubDate() const { return m_pubDate; } - QString guid() const { return m_guid; } + TQString description() const { return m_description; } + TQDateTime pubDate() const { return m_pubDate; } + TQString guid() const { return m_guid; } int downloaded() const { return m_downloaded; } ~RssArticle(); private: KURL m_link; - QString m_title; - QString m_description; - QDateTime m_pubDate; - QString m_guid; + TQString m_title; + TQString m_description; + TQDateTime m_pubDate; + TQString m_guid; int m_downloaded; }; - QDataStream &operator<<( QDataStream &out, const RssArticle &article ); - QDataStream &operator>>( QDataStream &in, RssArticle &article ); + TQDataStream &operator<<( TQDataStream &out, const RssArticle &article ); + TQDataStream &operator>>( TQDataStream &in, RssArticle &article ); } diff --git a/plugins/rssfeed/rssfeed.cpp b/plugins/rssfeed/rssfeed.cpp index 0d1244b..f5b4c64 100644 --- a/plugins/rssfeed/rssfeed.cpp +++ b/plugins/rssfeed/rssfeed.cpp @@ -23,9 +23,9 @@ #include <kstandarddirs.h> #include <krfcdate.h> #include <kio/netaccess.h> -#include <qfile.h> -#include <qapplication.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqapplication.h> +#include <tqdir.h> namespace kt { @@ -35,7 +35,7 @@ namespace kt if (m_active) { refreshFeed(); - refreshTimer.start(QTime().msecsTo(m_autoRefresh)); + refreshTimer.start(TQTime().msecsTo(m_autoRefresh)); } else { @@ -48,13 +48,13 @@ namespace kt feedLoading = false; loadArticles(); - connect(&refreshTimer, SIGNAL(timeout()), this, SLOT( refreshFeed() ) ); - connect(this, SIGNAL(articlesChanged(const RssArticle::List&)), this, SLOT( saveArticles() ) ); + connect(&refreshTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( refreshFeed() ) ); + connect(this, TQT_SIGNAL(articlesChanged(const RssArticle::List&)), this, TQT_SLOT( saveArticles() ) ); startFeed(); } - RssFeed::RssFeed(QObject * parent) : QObject(parent) + RssFeed::RssFeed(TQObject * tqparent) : TQObject(tqparent) { m_active = false; m_articleAge = 365; @@ -64,7 +64,7 @@ namespace kt initialize(); } - RssFeed::RssFeed(KURL feedUrl, QString title, bool active, int articleAge, bool ignoreTTL, QTime autoRefresh ) + RssFeed::RssFeed(KURL feedUrl, TQString title, bool active, int articleAge, bool ignoreTTL, TQTime autoRefresh ) { m_feedUrl = feedUrl; m_title = title; @@ -76,7 +76,7 @@ namespace kt initialize(); } - RssFeed::RssFeed(const RssFeed &other) : QObject() + RssFeed::RssFeed(const RssFeed &other) : TQObject() { *this = other; } @@ -109,7 +109,7 @@ namespace kt } } - void RssFeed::setFeedUrl( const QString& url ) + void RssFeed::setFeedUrl( const TQString& url ) { if (m_feedUrl != url) { @@ -146,7 +146,7 @@ namespace kt } } - void RssFeed::setTitle( const QString& title ) + void RssFeed::setTitle( const TQString& title ) { if (m_title != title) { @@ -155,14 +155,14 @@ namespace kt } } - void RssFeed::setAutoRefresh( const QTime& autoRefresh ) + void RssFeed::setAutoRefresh( const TQTime& autoRefresh ) { if (m_autoRefresh != autoRefresh) { m_autoRefresh = autoRefresh; if (m_active) { - refreshTimer.changeInterval(QTime().msecsTo(m_autoRefresh)); + refreshTimer.changeInterval(TQTime().msecsTo(m_autoRefresh)); } emit autoRefreshChanged(autoRefresh); @@ -178,25 +178,25 @@ namespace kt } } - QString RssFeed::getFilename() + TQString RssFeed::getFilename() { - QDir directory; + TQDir directory; directory.mkdir(KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds"); - return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).replace("/", "_").replace(":", "_") + ".ktr"; + return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).tqreplace("/", "_").tqreplace(":", "_") + ".ktr"; } void RssFeed::loadArticles() { - QString filename = getFilename(); + TQString filename = getFilename(); //load articles from disk - QFile file(filename); + TQFile file(filename); if (file.exists()) { file.open( IO_ReadOnly ); - QDataStream in(&file); + TQDataStream in(&file); in >> m_articles; emit articlesChanged( m_articles ); @@ -205,13 +205,13 @@ namespace kt void RssFeed::saveArticles() { - QString filename = getFilename(); + TQString filename = getFilename(); //load articles from disk - QFile file(filename); + TQFile file(filename); file.open( IO_WriteOnly ); - QDataStream out(&file); + TQDataStream out(&file); out << m_articles; } @@ -223,7 +223,7 @@ namespace kt RssArticle::List::iterator it; for ( it = m_articles.begin(); it != m_articles.end(); ) { - if ((*it).pubDate().daysTo(QDateTime::currentDateTime()) > m_articleAge) + if ((*it).pubDate().daysTo(TQDateTime::tqcurrentDateTime()) > m_articleAge) { it = m_articles.erase(it); removed = true; @@ -254,12 +254,12 @@ namespace kt feedLoading = true; cleanArticles(); Loader * feedLoader = Loader::create(); - connect( feedLoader, SIGNAL( loadingComplete( Loader *, Document, Status ) ), - this, SLOT( feedLoaded( Loader *, Document, Status ) ) ); + connect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), + this, TQT_SLOT( feedLoaded( Loader *, Document, tqStatus ) ) ); feedLoader->loadFrom( m_feedUrl, new FileRetriever ); } - void RssFeed::feedLoaded(Loader *feedLoader, Document doc, Status status) + void RssFeed::feedLoaded(Loader *feedLoader, Document doc, tqStatus status) { feedLoading = false; @@ -267,7 +267,7 @@ namespace kt { bool added = false; - if (m_title.isEmpty() || m_title == QString("New")) + if (m_title.isEmpty() || m_title == TQString("New")) { setTitle(doc.title()); emit updateTitle(doc.title()); @@ -277,11 +277,11 @@ namespace kt { if (doc.ttl() < 0) { - setAutoRefresh(QTime().addSecs(3600)); + setAutoRefresh(TQTime().addSecs(3600)); } else { - setAutoRefresh(QTime().addSecs(doc.ttl() * 60)); + setAutoRefresh(TQTime().addSecs(doc.ttl() * 60)); } } @@ -290,7 +290,7 @@ namespace kt for (int i=doc.articles().count()-1; i>=0; i--) { curArticle = doc.articles()[i]; - if (curArticle.pubDate().daysTo(QDateTime::currentDateTime()) < m_articleAge && !m_articles.contains(curArticle)) + if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.tqcontains(curArticle)) { m_articles.prepend(curArticle); emit scanRssArticle(curArticle); @@ -306,13 +306,13 @@ namespace kt qDebug( "There was and error loading the feed\n"); } - disconnect( feedLoader, SIGNAL( loadingComplete( Loader *, Document, Status ) ), - this, SLOT( feedLoaded( Loader *, Document, Status ) ) ); + disconnect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), + this, TQT_SLOT( feedLoaded( Loader *, Document, tqStatus ) ) ); feedLoader->deleteLater(); } - void RssFeed::setDownloaded(QString link, int downloaded) + void RssFeed::setDownloaded(TQString link, int downloaded) { bool changed = false; @@ -332,21 +332,21 @@ namespace kt } } - QDataStream &operator<<( QDataStream &out, const RssFeed &feed ) + TQDataStream &operator<<( TQDataStream &out, const RssFeed &feed ) { out << feed.feedUrl() << feed.title() << int(feed.active()) << feed.articleAge() << int(feed.ignoreTTL()) << feed.autoRefresh(); return out; } - QDataStream &operator>>( QDataStream &in, RssFeed &feed ) + TQDataStream &operator>>( TQDataStream &in, RssFeed &feed ) { KURL feedUrl; - QString title; + TQString title; int active; int articleAge; int ignoreTTL; - QTime autoRefresh; + TQTime autoRefresh; in >> feedUrl >> title >> active >> articleAge >> ignoreTTL >> autoRefresh; feed = RssFeed(feedUrl, title, active, articleAge, ignoreTTL, autoRefresh); diff --git a/plugins/rssfeed/rssfeed.h b/plugins/rssfeed/rssfeed.h index 9bcd2f7..279862b 100644 --- a/plugins/rssfeed/rssfeed.h +++ b/plugins/rssfeed/rssfeed.h @@ -20,12 +20,12 @@ #ifndef RSSFEED_H #define RSSFEED_H -#include <qobject.h> -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> -#include <qtimer.h> -#include <qdatastream.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> +#include <tqtimer.h> +#include <tqdatastream.h> #include <kurl.h> @@ -45,16 +45,17 @@ namespace kt * */ - class RssFeed : public QObject + class RssFeed : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. */ - RssFeed(QObject * parent = 0); - RssFeed(KURL feedUrl, QString title = "", bool active = false, int articleAge = 3, bool ignoreTTL = false, QTime autoRefresh = QTime()); + RssFeed(TQObject * tqparent = 0); + RssFeed(KURL feedUrl, TQString title = "", bool active = false, int articleAge = 3, bool ignoreTTL = false, TQTime autoRefresh = TQTime()); RssFeed(const RssFeed &other); RssFeed &operator=(const RssFeed &other); ~RssFeed(); @@ -62,8 +63,8 @@ namespace kt KURL feedUrl() const { return m_feedUrl; } bool active() const { return m_active; } int articleAge() const { return m_articleAge; } - QString title() const { return m_title; } - QTime autoRefresh() const { return m_autoRefresh; } + TQString title() const { return m_title; } + TQTime autoRefresh() const { return m_autoRefresh; } bool ignoreTTL() const { return m_ignoreTTL; } @@ -72,28 +73,28 @@ namespace kt public slots: void refreshFeed(); - void feedLoaded(Loader *feedLoader, Document doc, Status status); + void feedLoaded(Loader *feedLoader, Document doc, tqStatus status); void clearArticles(); void setFeedUrl( const KURL& url ); - void setFeedUrl( const QString& url ); + void setFeedUrl( const TQString& url ); void setActive( bool active ); void setArticleAge( int articleAge ); - void setTitle( const QString& title ); - void setAutoRefresh( const QTime& autoRefresh ); + void setTitle( const TQString& title ); + void setAutoRefresh( const TQTime& autoRefresh ); void setIgnoreTTL( bool ignoreTTL ); void saveArticles(); - void setDownloaded(QString link, int downloaded); + void setDownloaded(TQString link, int downloaded); signals: void feedUrlChanged( const KURL& url ); void activeChanged( bool active ); void articleAgeChanged( int articleAge ); - void titleChanged( const QString& title ); - void updateTitle( const QString& title ); - void autoRefreshChanged( const QTime& autoRefresh ); + void titleChanged( const TQString& title ); + void updateTitle( const TQString& title ); + void autoRefreshChanged( const TQTime& autoRefresh ); void ignoreTTLChanged( bool ignoreTTL ); void articlesChanged( const RssArticle::List& articles ); @@ -104,23 +105,23 @@ namespace kt KURL m_feedUrl; bool m_active; int m_articleAge; - QString m_title; - QTime m_autoRefresh; + TQString m_title; + TQTime m_autoRefresh; bool m_ignoreTTL; RssArticle::List m_articles; - QTimer refreshTimer; + TQTimer refreshTimer; bool feedLoading; - QString getFilename(); + TQString getFilename(); void initialize(); void startFeed(); void cleanArticles(); void loadArticles(); }; - QDataStream &operator<<( QDataStream &out, const RssFeed &feed ); - QDataStream &operator>>( QDataStream &in, RssFeed &feed ); + TQDataStream &operator<<( TQDataStream &out, const RssFeed &feed ); + TQDataStream &operator>>( TQDataStream &in, RssFeed &feed ); } diff --git a/plugins/rssfeed/rssfeedmanager.cpp b/plugins/rssfeed/rssfeedmanager.cpp index 106ca0f..6646f06 100644 --- a/plugins/rssfeed/rssfeedmanager.cpp +++ b/plugins/rssfeed/rssfeedmanager.cpp @@ -28,19 +28,19 @@ // #include <kmimetype.h> #include <kmessagebox.h> -#include <qstring.h> -#include <qobject.h> -#include <qfile.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqfile.h> +#include <tqdatetime.h> -#include <qlineedit.h> +#include <tqlineedit.h> #include <kurlrequester.h> -#include <qspinbox.h> -#include <qcheckbox.h> -#include <qdatetimeedit.h> -#include <qtable.h> -#include <qregexp.h> -#include <qlayout.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> +#include <tqdatetimeedit.h> +#include <tqtable.h> +#include <tqregexp.h> +#include <tqlayout.h> #include <torrent/globals.h> #include <util/log.h> @@ -48,7 +48,7 @@ #include <interfaces/coreinterface.h> -#include <qapplication.h> +#include <tqapplication.h> #include "../../libktorrent/torrent/bdecoder.h" #include "../../libktorrent/torrent/bnode.h" @@ -60,7 +60,7 @@ using namespace bt; namespace kt { - RssFeedManager::RssFeedManager(CoreInterface* core, QWidget * parent) : RssFeedWidget(parent) + RssFeedManager::RssFeedManager(CoreInterface* core, TQWidget * tqparent) : RssFeedWidget(tqparent) { //Construct the manager m_core = core; @@ -75,7 +75,7 @@ namespace kt feedArticles->setLeftMargin(0); feedArticles->verticalHeader()->hide(); feedArticles->setNumCols(3); - feedArticles->setColumnLabels(QStringList() << i18n("Title") << i18n("Description") << i18n("Link")); + feedArticles->setColumnLabels(TQStringList() << i18n("Title") << i18n("Description") << i18n("Link")); feedArticles->horizontalHeader()->setStretchEnabled(true, 0); feedArticles->hideColumn(1); feedArticles->hideColumn(2); @@ -84,7 +84,7 @@ namespace kt filterMatches->setLeftMargin(0); filterMatches->verticalHeader()->hide(); filterMatches->setNumCols(4); - filterMatches->setColumnLabels(QStringList() << i18n("Season") << i18n("Episode") << i18n("Time") << i18n("Link")); + filterMatches->setColumnLabels(TQStringList() << i18n("Season") << i18n("Episode") << i18n("Time") << i18n("Link")); filterMatches->setColumnWidth(0, 60); filterMatches->setColumnWidth(1, 60); filterMatches->setColumnWidth(2, 180); @@ -94,37 +94,37 @@ namespace kt loadFilterList(); //connect the buttons - connect(newFeed, SIGNAL(clicked()), this, SLOT(addNewFeed() ) ); - connect(deleteFeed, SIGNAL(clicked()), this, SLOT(deleteSelectedFeed() ) ); + connect(newFeed, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewFeed() ) ); + connect(deleteFeed, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSelectedFeed() ) ); - connect(newAcceptFilter, SIGNAL(clicked()), this, SLOT(addNewAcceptFilter() ) ); - connect(deleteAcceptFilter, SIGNAL(clicked()), this, SLOT(deleteSelectedAcceptFilter() ) ); + connect(newAcceptFilter, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewAcceptFilter() ) ); + connect(deleteAcceptFilter, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSelectedAcceptFilter() ) ); - connect(newRejectFilter, SIGNAL(clicked()), this, SLOT(addNewRejectFilter() ) ); - connect(deleteRejectFilter, SIGNAL(clicked()), this, SLOT(deleteSelectedRejectFilter() ) ); + connect(newRejectFilter, TQT_SIGNAL(clicked()), this, TQT_SLOT(addNewRejectFilter() ) ); + connect(deleteRejectFilter, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSelectedRejectFilter() ) ); //connect the changing of the active feed - connect(feedlist, SIGNAL(selectionChanged()), this, SLOT(changedActiveFeed()) ); + connect(feedlist, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(changedActiveFeed()) ); //connect the changing of the url to enable the refresh button - connect(feedUrl, SIGNAL(textChanged(const QString &)), this, SLOT(changedFeedUrl()) ); + connect(feedUrl, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changedFeedUrl()) ); //connect the changing of the filters - connect(acceptFilterList, SIGNAL(selectionChanged()), this, SLOT(changedActiveAcceptFilter()) ); - connect(rejectFilterList, SIGNAL(selectionChanged()), this, SLOT(changedActiveRejectFilter()) ); + connect(acceptFilterList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(changedActiveAcceptFilter()) ); + connect(rejectFilterList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(changedActiveRejectFilter()) ); //connect the selection and downloading of articles - connect(feedArticles, SIGNAL(selectionChanged()), this, SLOT(changedArticleSelection()) ); - connect(downloadArticle, SIGNAL(clicked()), this, SLOT(downloadSelectedArticles()) ); + connect(feedArticles, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(changedArticleSelection()) ); + connect(downloadArticle, TQT_SIGNAL(clicked()), this, TQT_SLOT(downloadSelectedArticles()) ); //connect the selection, downloading and deletion of matches - connect(filterMatches, SIGNAL(selectionChanged()), this, SLOT(changedMatchSelection()) ); - connect(downloadFilterMatch, SIGNAL(clicked()), this, SLOT(downloadSelectedMatches()) ); - connect(deleteFilterMatch, SIGNAL(clicked()), this, SLOT(deleteSelectedMatches()) ); + connect(filterMatches, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(changedMatchSelection()) ); + connect(downloadFilterMatch, TQT_SIGNAL(clicked()), this, TQT_SLOT(downloadSelectedMatches()) ); + connect(deleteFilterMatch, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSelectedMatches()) ); //connect the test text update to the slot - connect(testText, SIGNAL(textChanged(const QString &)), this, SLOT(testTextChanged()) ); - connect(testTestText, SIGNAL(clicked()), this, SLOT(testFilter()) ); + connect(testText, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(testTextChanged()) ); + connect(testTestText, TQT_SIGNAL(clicked()), this, TQT_SLOT(testFilter()) ); changedActiveFeed(); changedActiveAcceptFilter(); @@ -138,7 +138,7 @@ namespace kt void RssFeedManager::clearArticles() { - int pos = feeds.find((RssFeed *)sender()); + int pos = feeds.tqfind((RssFeed *)sender()); if (pos >= 0) { @@ -159,65 +159,65 @@ namespace kt void RssFeedManager::connectFeed(int index) { - connect(feedTitle, SIGNAL(textChanged(const QString &)), feeds.at(index), SLOT(setTitle(const QString &) ) ); - connect(feeds.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFeedTitle(const QString &) ) ); + connect(feedTitle, TQT_SIGNAL(textChanged(const TQString &)), feeds.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + connect(feeds.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFeedTitle(const TQString &) ) ); //url - connect(feedUrl, SIGNAL(textChanged(const QString &)), feeds.at(index), SLOT(setFeedUrl(const QString&) ) ); - connect(feeds.at(index), SIGNAL(feedUrlChanged(const KURL&)), feedUrl, SLOT(setKURL(const KURL&) ) ); + connect(feedUrl, TQT_SIGNAL(textChanged(const TQString &)), feeds.at(index), TQT_SLOT(setFeedUrl(const TQString&) ) ); + connect(feeds.at(index), TQT_SIGNAL(feedUrlChanged(const KURL&)), feedUrl, TQT_SLOT(setKURL(const KURL&) ) ); //articleAge - connect(feedArticleAge, SIGNAL(valueChanged(int)), feeds.at(index), SLOT(setArticleAge(int) ) ); - connect(feeds.at(index), SIGNAL(articleAgeChanged(int)), feedArticleAge, SLOT(setValue(int) ) ); + connect(feedArticleAge, TQT_SIGNAL(valueChanged(int)), feeds.at(index), TQT_SLOT(setArticleAge(int) ) ); + connect(feeds.at(index), TQT_SIGNAL(articleAgeChanged(int)), feedArticleAge, TQT_SLOT(setValue(int) ) ); //active - connect(feedActive, SIGNAL(toggled(bool)), feeds.at(index), SLOT(setActive(bool) ) ); - connect(feeds.at(index), SIGNAL(activeChanged(bool)), feedActive, SLOT(setChecked(bool) ) ); + connect(feedActive, TQT_SIGNAL(toggled(bool)), feeds.at(index), TQT_SLOT(setActive(bool) ) ); + connect(feeds.at(index), TQT_SIGNAL(activeChanged(bool)), feedActive, TQT_SLOT(setChecked(bool) ) ); //autoRefresh - connect(feedAutoRefresh, SIGNAL(valueChanged(const QTime&)), feeds.at(index), SLOT(setAutoRefresh(const QTime&) ) ); - connect(feeds.at(index), SIGNAL(autoRefreshChanged(const QTime&)), feedAutoRefresh, SLOT(setTime(const QTime&) ) ); + connect(feedAutoRefresh, TQT_SIGNAL(valueChanged(const TQTime&)), feeds.at(index), TQT_SLOT(setAutoRefresh(const TQTime&) ) ); + connect(feeds.at(index), TQT_SIGNAL(autoRefreshChanged(const TQTime&)), feedAutoRefresh, TQT_SLOT(setTime(const TQTime&) ) ); //ignoreTTL - connect(feedIgnoreTTL, SIGNAL(toggled(bool)), feeds.at(index), SLOT(setIgnoreTTL(bool) ) ); - connect(feeds.at(index), SIGNAL(ignoreTTLChanged(bool)), feedIgnoreTTL, SLOT(setChecked(bool) ) ); + connect(feedIgnoreTTL, TQT_SIGNAL(toggled(bool)), feeds.at(index), TQT_SLOT(setIgnoreTTL(bool) ) ); + connect(feeds.at(index), TQT_SIGNAL(ignoreTTLChanged(bool)), feedIgnoreTTL, TQT_SLOT(setChecked(bool) ) ); //articles - connect(feeds.at(index), SIGNAL(articlesChanged(const RssArticle::List&)), this, SLOT(updateArticles(const RssArticle::List&) ) ); + connect(feeds.at(index), TQT_SIGNAL(articlesChanged(const RssArticle::List&)), this, TQT_SLOT(updateArticles(const RssArticle::List&) ) ); //connect the refresh button - connect(refreshFeed, SIGNAL(clicked()), feeds.at(index), SLOT(refreshFeed()) ); + connect(refreshFeed, TQT_SIGNAL(clicked()), feeds.at(index), TQT_SLOT(refreshFeed()) ); } void RssFeedManager::disconnectFeed(int index) { - disconnect(feedTitle, SIGNAL(textChanged(const QString &)), feeds.at(index), SLOT(setTitle(const QString &) ) ); - disconnect(feeds.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFeedTitle(const QString &) ) ); + disconnect(feedTitle, TQT_SIGNAL(textChanged(const TQString &)), feeds.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFeedTitle(const TQString &) ) ); //url - disconnect(feedUrl, SIGNAL(textChanged(const QString &)), feeds.at(index), SLOT(setFeedUrl(const QString&) ) ); - disconnect(feeds.at(index), SIGNAL(feedUrlChanged(const KURL&)), feedUrl, SLOT(setKURL(const KURL&) ) ); + disconnect(feedUrl, TQT_SIGNAL(textChanged(const TQString &)), feeds.at(index), TQT_SLOT(setFeedUrl(const TQString&) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(feedUrlChanged(const KURL&)), feedUrl, TQT_SLOT(setKURL(const KURL&) ) ); //articleAge - disconnect(feedArticleAge, SIGNAL(valueChanged(int)), feeds.at(index), SLOT(setArticleAge(int) ) ); - disconnect(feeds.at(index), SIGNAL(articleAgeChanged(int)), feedArticleAge, SLOT(setValue(int) ) ); + disconnect(feedArticleAge, TQT_SIGNAL(valueChanged(int)), feeds.at(index), TQT_SLOT(setArticleAge(int) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(articleAgeChanged(int)), feedArticleAge, TQT_SLOT(setValue(int) ) ); //active - disconnect(feedActive, SIGNAL(toggled(bool)), feeds.at(index), SLOT(setActive(bool) ) ); - disconnect(feeds.at(index), SIGNAL(activeChanged(bool)), feedActive, SLOT(setChecked(bool) ) ); + disconnect(feedActive, TQT_SIGNAL(toggled(bool)), feeds.at(index), TQT_SLOT(setActive(bool) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(activeChanged(bool)), feedActive, TQT_SLOT(setChecked(bool) ) ); //autoRefresh - disconnect(feedAutoRefresh, SIGNAL(valueChanged(const QTime&)), feeds.at(index), SLOT(setAutoRefresh(const QTime&) ) ); - disconnect(feeds.at(index), SIGNAL(autoRefreshChanged(const QTime&)), feedAutoRefresh, SLOT(setTime(const QTime&) ) ); + disconnect(feedAutoRefresh, TQT_SIGNAL(valueChanged(const TQTime&)), feeds.at(index), TQT_SLOT(setAutoRefresh(const TQTime&) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(autoRefreshChanged(const TQTime&)), feedAutoRefresh, TQT_SLOT(setTime(const TQTime&) ) ); //ignoreTTL - disconnect(feedIgnoreTTL, SIGNAL(toggled(bool)), feeds.at(index), SLOT(setIgnoreTTL(bool) ) ); - disconnect(feeds.at(index), SIGNAL(ignoreTTLChanged(bool)), feedIgnoreTTL, SLOT(setChecked(bool) ) ); + disconnect(feedIgnoreTTL, TQT_SIGNAL(toggled(bool)), feeds.at(index), TQT_SLOT(setIgnoreTTL(bool) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(ignoreTTLChanged(bool)), feedIgnoreTTL, TQT_SLOT(setChecked(bool) ) ); //articles - disconnect(feeds.at(index), SIGNAL(articlesChanged(const RssArticle::List&)), this, SLOT(updateArticles(const RssArticle::List&) ) ); + disconnect(feeds.at(index), TQT_SIGNAL(articlesChanged(const RssArticle::List&)), this, TQT_SLOT(updateArticles(const RssArticle::List&) ) ); - disconnect(refreshFeed, SIGNAL(clicked()), feeds.at(index), SLOT(refreshFeed()) ); + disconnect(refreshFeed, TQT_SIGNAL(clicked()), feeds.at(index), TQT_SLOT(refreshFeed()) ); } void RssFeedManager::connectFilter(int index, bool acceptFilter) @@ -225,69 +225,69 @@ namespace kt if (acceptFilter) { //title - connect(filterTitle, SIGNAL(textChanged(const QString &)), acceptFilters.at(index), SLOT(setTitle(const QString &) ) ); - connect(acceptFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFilterTitle(const QString &) ) ); + connect(filterTitle, TQT_SIGNAL(textChanged(const TQString &)), acceptFilters.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFilterTitle(const TQString &) ) ); //active - connect(filterActive, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setActive(bool) ) ); - connect(acceptFilters.at(index), SIGNAL(activeChanged(bool)), filterActive, SLOT(setChecked(bool) ) ); + connect(filterActive, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setActive(bool) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(activeChanged(bool)), filterActive, TQT_SLOT(setChecked(bool) ) ); //regExps - connect(filterRegExps, SIGNAL(changed()), this, SLOT(updateRegExps()) ); + connect(filterRegExps, TQT_SIGNAL(changed()), this, TQT_SLOT(updateRegExps()) ); //series - connect(filterSeries, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setSeries(bool) ) ); - connect(acceptFilters.at(index), SIGNAL(seriesChanged(bool)), filterSeries, SLOT(setChecked(bool) ) ); + connect(filterSeries, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setSeries(bool) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(seriesChanged(bool)), filterSeries, TQT_SLOT(setChecked(bool) ) ); //sansEpisode - connect(filterSansEpisode, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setSansEpisode(bool) ) ); - connect(acceptFilters.at(index), SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, SLOT(setChecked(bool) ) ); + connect(filterSansEpisode, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setSansEpisode(bool) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, TQT_SLOT(setChecked(bool) ) ); //minSeason - connect(filterMinSeason, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMinSeason(int) ) ); - connect(acceptFilters.at(index), SIGNAL(minSeasonChanged(int)), filterMinSeason, SLOT(setValue(int) ) ); + connect(filterMinSeason, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMinSeason(int) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(minSeasonChanged(int)), filterMinSeason, TQT_SLOT(setValue(int) ) ); //minEpisode - connect(filterMinEpisode, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMinEpisode(int) ) ); - connect(acceptFilters.at(index), SIGNAL(minEpisodeChanged(int)), filterMinEpisode, SLOT(setValue(int) ) ); + connect(filterMinEpisode, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMinEpisode(int) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(minEpisodeChanged(int)), filterMinEpisode, TQT_SLOT(setValue(int) ) ); //maxSeason - connect(filterMaxSeason, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMaxSeason(int) ) ); - connect(acceptFilters.at(index), SIGNAL(maxSeasonChanged(int)), filterMaxSeason, SLOT(setValue(int) ) ); + connect(filterMaxSeason, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMaxSeason(int) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(maxSeasonChanged(int)), filterMaxSeason, TQT_SLOT(setValue(int) ) ); //maxEpisode - connect(filterMaxEpisode, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMaxEpisode(int) ) ); - connect(acceptFilters.at(index), SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, SLOT(setValue(int) ) ); + connect(filterMaxEpisode, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMaxEpisode(int) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, TQT_SLOT(setValue(int) ) ); //matches - connect(acceptFilters.at(index), SIGNAL(matchesChanged(const QValueList<FilterMatch>&)), this, SLOT(updateMatches(const QValueList<FilterMatch>&) ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(matchesChanged(const TQValueList<FilterMatch>&)), this, TQT_SLOT(updateMatches(const TQValueList<FilterMatch>&) ) ); - connect(processFilter, SIGNAL(clicked()), acceptFilters.at(index), SIGNAL(rescanFilter()) ); + connect(processFilter, TQT_SIGNAL(clicked()), acceptFilters.at(index), TQT_SIGNAL(rescanFilter()) ); } else { //title - connect(filterTitle, SIGNAL(textChanged(const QString &)), rejectFilters.at(index), SLOT(setTitle(const QString &) ) ); - connect(rejectFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFilterTitle(const QString &) ) ); + connect(filterTitle, TQT_SIGNAL(textChanged(const TQString &)), rejectFilters.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFilterTitle(const TQString &) ) ); //active - connect(filterActive, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setActive(bool) ) ); - connect(rejectFilters.at(index), SIGNAL(activeChanged(bool)), filterActive, SLOT(setChecked(bool) ) ); + connect(filterActive, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setActive(bool) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(activeChanged(bool)), filterActive, TQT_SLOT(setChecked(bool) ) ); //regExps - connect(filterRegExps, SIGNAL(changed()), this, SLOT(updateRegExps()) ); + connect(filterRegExps, TQT_SIGNAL(changed()), this, TQT_SLOT(updateRegExps()) ); //series - connect(filterSeries, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setSeries(bool) ) ); - connect(rejectFilters.at(index), SIGNAL(seriesChanged(bool)), filterSeries, SLOT(setChecked(bool) ) ); + connect(filterSeries, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setSeries(bool) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(seriesChanged(bool)), filterSeries, TQT_SLOT(setChecked(bool) ) ); //sansEpisode - connect(filterSansEpisode, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setSansEpisode(bool) ) ); - connect(rejectFilters.at(index), SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, SLOT(setChecked(bool) ) ); + connect(filterSansEpisode, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setSansEpisode(bool) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, TQT_SLOT(setChecked(bool) ) ); //minSeason - connect(filterMinSeason, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMinSeason(int) ) ); - connect(rejectFilters.at(index), SIGNAL(minSeasonChanged(int)), filterMinSeason, SLOT(setValue(int) ) ); + connect(filterMinSeason, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMinSeason(int) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(minSeasonChanged(int)), filterMinSeason, TQT_SLOT(setValue(int) ) ); //minEpisode - connect(filterMinEpisode, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMinEpisode(int) ) ); - connect(rejectFilters.at(index), SIGNAL(minEpisodeChanged(int)), filterMinEpisode, SLOT(setValue(int) ) ); + connect(filterMinEpisode, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMinEpisode(int) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(minEpisodeChanged(int)), filterMinEpisode, TQT_SLOT(setValue(int) ) ); //maxSeason - connect(filterMaxSeason, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMaxSeason(int) ) ); - connect(rejectFilters.at(index), SIGNAL(maxSeasonChanged(int)), filterMaxSeason, SLOT(setValue(int) ) ); + connect(filterMaxSeason, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMaxSeason(int) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(maxSeasonChanged(int)), filterMaxSeason, TQT_SLOT(setValue(int) ) ); //maxEpisode - connect(filterMaxEpisode, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMaxEpisode(int) ) ); - connect(rejectFilters.at(index), SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, SLOT(setValue(int) ) ); + connect(filterMaxEpisode, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMaxEpisode(int) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, TQT_SLOT(setValue(int) ) ); //matches - connect(rejectFilters.at(index), SIGNAL(matchesChanged(const QValueList<FilterMatch>&)), this, SLOT(updateMatches(const QValueList<FilterMatch>&) ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(matchesChanged(const TQValueList<FilterMatch>&)), this, TQT_SLOT(updateMatches(const TQValueList<FilterMatch>&) ) ); - connect(processFilter, SIGNAL(clicked()), rejectFilters.at(index), SIGNAL(rescanFilter()) ); + connect(processFilter, TQT_SIGNAL(clicked()), rejectFilters.at(index), TQT_SIGNAL(rescanFilter()) ); } } @@ -297,68 +297,68 @@ namespace kt if (acceptFilter) { //title - disconnect(filterTitle, SIGNAL(textChanged(const QString &)), acceptFilters.at(index), SLOT(setTitle(const QString &) ) ); - disconnect(acceptFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFilterTitle(const QString &) ) ); + disconnect(filterTitle, TQT_SIGNAL(textChanged(const TQString &)), acceptFilters.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFilterTitle(const TQString &) ) ); //active - disconnect(filterActive, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setActive(bool) ) ); - disconnect(acceptFilters.at(index), SIGNAL(activeChanged(bool)), filterActive, SLOT(setChecked(bool) ) ); + disconnect(filterActive, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setActive(bool) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(activeChanged(bool)), filterActive, TQT_SLOT(setChecked(bool) ) ); //regExps - disconnect(filterRegExps, SIGNAL(changed()), this, SLOT(updateRegExps()) ); + disconnect(filterRegExps, TQT_SIGNAL(changed()), this, TQT_SLOT(updateRegExps()) ); //series - disconnect(filterSeries, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setSeries(bool) ) ); - disconnect(acceptFilters.at(index), SIGNAL(seriesChanged(bool)), filterSeries, SLOT(setChecked(bool) ) ); + disconnect(filterSeries, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setSeries(bool) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(seriesChanged(bool)), filterSeries, TQT_SLOT(setChecked(bool) ) ); //sansEpisode - disconnect(filterSansEpisode, SIGNAL(toggled(bool)), acceptFilters.at(index), SLOT(setSansEpisode(bool) ) ); - disconnect(acceptFilters.at(index), SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, SLOT(setChecked(bool) ) ); + disconnect(filterSansEpisode, TQT_SIGNAL(toggled(bool)), acceptFilters.at(index), TQT_SLOT(setSansEpisode(bool) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, TQT_SLOT(setChecked(bool) ) ); //minSeason - disconnect(filterMinSeason, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMinSeason(int) ) ); - disconnect(acceptFilters.at(index), SIGNAL(minSeasonChanged(int)), filterMinSeason, SLOT(setValue(int) ) ); + disconnect(filterMinSeason, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMinSeason(int) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(minSeasonChanged(int)), filterMinSeason, TQT_SLOT(setValue(int) ) ); //minEpisode - disconnect(filterMinEpisode, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMinEpisode(int) ) ); - disconnect(acceptFilters.at(index), SIGNAL(minEpisodeChanged(int)), filterMinEpisode, SLOT(setValue(int) ) ); + disconnect(filterMinEpisode, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMinEpisode(int) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(minEpisodeChanged(int)), filterMinEpisode, TQT_SLOT(setValue(int) ) ); //maxSeason - disconnect(filterMaxSeason, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMaxSeason(int) ) ); - disconnect(acceptFilters.at(index), SIGNAL(maxSeasonChanged(int)), filterMaxSeason, SLOT(setValue(int) ) ); + disconnect(filterMaxSeason, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMaxSeason(int) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(maxSeasonChanged(int)), filterMaxSeason, TQT_SLOT(setValue(int) ) ); //maxEpisode - disconnect(filterMaxEpisode, SIGNAL(valueChanged(int)), acceptFilters.at(index), SLOT(setMaxEpisode(int) ) ); - disconnect(acceptFilters.at(index), SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, SLOT(setValue(int) ) ); + disconnect(filterMaxEpisode, TQT_SIGNAL(valueChanged(int)), acceptFilters.at(index), TQT_SLOT(setMaxEpisode(int) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, TQT_SLOT(setValue(int) ) ); //matches - disconnect(acceptFilters.at(index), SIGNAL(matchesChanged(const QValueList<FilterMatch>&)), this, SLOT(updateMatches(const QValueList<FilterMatch>&) ) ); + disconnect(acceptFilters.at(index), TQT_SIGNAL(matchesChanged(const TQValueList<FilterMatch>&)), this, TQT_SLOT(updateMatches(const TQValueList<FilterMatch>&) ) ); - disconnect(processFilter, SIGNAL(clicked()), acceptFilters.at(index), SIGNAL(rescanFilter()) ); + disconnect(processFilter, TQT_SIGNAL(clicked()), acceptFilters.at(index), TQT_SIGNAL(rescanFilter()) ); } else { //title - disconnect(filterTitle, SIGNAL(textChanged(const QString &)), rejectFilters.at(index), SLOT(setTitle(const QString &) ) ); - disconnect(rejectFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(setFilterTitle(const QString &) ) ); + disconnect(filterTitle, TQT_SIGNAL(textChanged(const TQString &)), rejectFilters.at(index), TQT_SLOT(setTitle(const TQString &) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(setFilterTitle(const TQString &) ) ); //active - disconnect(filterActive, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setActive(bool) ) ); - disconnect(rejectFilters.at(index), SIGNAL(activeChanged(bool)), filterActive, SLOT(setChecked(bool) ) ); + disconnect(filterActive, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setActive(bool) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(activeChanged(bool)), filterActive, TQT_SLOT(setChecked(bool) ) ); //regExps - disconnect(filterRegExps, SIGNAL(changed()), this, SLOT(updateRegExps()) ); + disconnect(filterRegExps, TQT_SIGNAL(changed()), this, TQT_SLOT(updateRegExps()) ); //series - disconnect(filterSeries, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setSeries(bool) ) ); - disconnect(rejectFilters.at(index), SIGNAL(seriesChanged(bool)), filterSeries, SLOT(setChecked(bool) ) ); + disconnect(filterSeries, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setSeries(bool) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(seriesChanged(bool)), filterSeries, TQT_SLOT(setChecked(bool) ) ); //sansEpisode - disconnect(filterSansEpisode, SIGNAL(toggled(bool)), rejectFilters.at(index), SLOT(setSansEpisode(bool) ) ); - disconnect(rejectFilters.at(index), SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, SLOT(setChecked(bool) ) ); + disconnect(filterSansEpisode, TQT_SIGNAL(toggled(bool)), rejectFilters.at(index), TQT_SLOT(setSansEpisode(bool) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(sansEpisodeChanged(bool)), filterSansEpisode, TQT_SLOT(setChecked(bool) ) ); //minSeason - disconnect(filterMinSeason, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMinSeason(int) ) ); - disconnect(rejectFilters.at(index), SIGNAL(minSeasonChanged(int)), filterMinSeason, SLOT(setValue(int) ) ); + disconnect(filterMinSeason, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMinSeason(int) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(minSeasonChanged(int)), filterMinSeason, TQT_SLOT(setValue(int) ) ); //minEpisode - disconnect(filterMinEpisode, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMinEpisode(int) ) ); - disconnect(rejectFilters.at(index), SIGNAL(minEpisodeChanged(int)), filterMinEpisode, SLOT(setValue(int) ) ); + disconnect(filterMinEpisode, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMinEpisode(int) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(minEpisodeChanged(int)), filterMinEpisode, TQT_SLOT(setValue(int) ) ); //maxSeason - disconnect(filterMaxSeason, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMaxSeason(int) ) ); - disconnect(rejectFilters.at(index), SIGNAL(maxSeasonChanged(int)), filterMaxSeason, SLOT(setValue(int) ) ); + disconnect(filterMaxSeason, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMaxSeason(int) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(maxSeasonChanged(int)), filterMaxSeason, TQT_SLOT(setValue(int) ) ); //maxEpisode - disconnect(filterMaxEpisode, SIGNAL(valueChanged(int)), rejectFilters.at(index), SLOT(setMaxEpisode(int) ) ); - disconnect(rejectFilters.at(index), SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, SLOT(setValue(int) ) ); + disconnect(filterMaxEpisode, TQT_SIGNAL(valueChanged(int)), rejectFilters.at(index), TQT_SLOT(setMaxEpisode(int) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(maxEpisodeChanged(int)), filterMaxEpisode, TQT_SLOT(setValue(int) ) ); //matches - disconnect(rejectFilters.at(index), SIGNAL(matchesChanged(const QValueList<FilterMatch>&)), this, SLOT(updateMatches(const QValueList<FilterMatch>&) ) ); + disconnect(rejectFilters.at(index), TQT_SIGNAL(matchesChanged(const TQValueList<FilterMatch>&)), this, TQT_SLOT(updateMatches(const TQValueList<FilterMatch>&) ) ); - disconnect(processFilter, SIGNAL(clicked()), rejectFilters.at(index), SIGNAL(rescanFilter()) ); + disconnect(processFilter, TQT_SIGNAL(clicked()), rejectFilters.at(index), TQT_SIGNAL(rescanFilter()) ); } } @@ -375,27 +375,27 @@ namespace kt feedlist->setCurrentItem(index); //update the feed list - connect(feeds.at(index), SIGNAL(titleChanged(const QString&)), this, SLOT(updateFeedList()) ); + connect(feeds.at(index), TQT_SIGNAL(titleChanged(const TQString&)), this, TQT_SLOT(updateFeedList()) ); //clear the articles list when the url is changed - connect(feeds.at(index), SIGNAL(feedUrlChanged(const KURL&)), this, SLOT(clearArticles() ) ); + connect(feeds.at(index), TQT_SIGNAL(feedUrlChanged(const KURL&)), this, TQT_SLOT(clearArticles() ) ); //connect the scanArticle signal to the scanArticle slot - connect(feeds.at(index), SIGNAL(scanRssArticle(RssArticle)), this, SLOT(scanArticle(RssArticle) ) ); + connect(feeds.at(index), TQT_SIGNAL(scanRssArticle(RssArticle)), this, TQT_SLOT(scanArticle(RssArticle) ) ); //connect all the fields to the save slot //title - connect(feeds.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(saveFeedList() ) ); //url - connect(feeds.at(index), SIGNAL(feedUrlChanged(const KURL&)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(feedUrlChanged(const KURL&)), this, TQT_SLOT(saveFeedList() ) ); //articleAge - connect(feeds.at(index), SIGNAL(articleAgeChanged(int)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(articleAgeChanged(int)), this, TQT_SLOT(saveFeedList() ) ); //active - connect(feeds.at(index), SIGNAL(activeChanged(bool)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(activeChanged(bool)), this, TQT_SLOT(saveFeedList() ) ); //autoRefresh - connect(feeds.at(index), SIGNAL(autoRefreshChanged(const QTime&)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(autoRefreshChanged(const TQTime&)), this, TQT_SLOT(saveFeedList() ) ); //ignoreTTL - connect(feeds.at(index), SIGNAL(ignoreTTLChanged(bool)), this, SLOT(saveFeedList() ) ); + connect(feeds.at(index), TQT_SIGNAL(ignoreTTLChanged(bool)), this, TQT_SLOT(saveFeedList() ) ); } @@ -410,52 +410,52 @@ namespace kt acceptFilterList->insertItem(acceptFilters.at(index)->title()); acceptFilterList->setCurrentItem(index); - connect(acceptFilters.at(index), SIGNAL(titleChanged(const QString&)), this, SLOT(updateAcceptFilterList()) ); + connect(acceptFilters.at(index), TQT_SIGNAL(titleChanged(const TQString&)), this, TQT_SLOT(updateAcceptFilterList()) ); //connect all the fields to the save slot //title - connect(acceptFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(saveFilterList() ) ); //active - connect(acceptFilters.at(index), SIGNAL(activeChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(activeChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //regexps - connect(acceptFilters.at(index), SIGNAL(regExpsChanged( const QStringList& )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(regExpsChanged( const TQStringList& )), this, TQT_SLOT(saveFilterList() ) ); //series - connect(acceptFilters.at(index), SIGNAL(seriesChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(seriesChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //sansEpisode - connect(acceptFilters.at(index), SIGNAL(sansEpisodeChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(sansEpisodeChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //minSeason - connect(acceptFilters.at(index), SIGNAL(minSeasonChanged (int )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(minSeasonChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //minEpisode - connect(acceptFilters.at(index), SIGNAL(minEpisodeChanged (int )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(minEpisodeChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //maxSeason - connect(acceptFilters.at(index), SIGNAL(maxSeasonChanged (int )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(maxSeasonChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //maxEpiosde - connect(acceptFilters.at(index), SIGNAL(maxEpisodeChanged (int )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(maxEpisodeChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //matches - connect(acceptFilters.at(index), SIGNAL(matchesChanged( const QValueList<FilterMatch>& )), this, SLOT(saveFilterList() ) ); + connect(acceptFilters.at(index), TQT_SIGNAL(matchesChanged( const TQValueList<FilterMatch>& )), this, TQT_SLOT(saveFilterList() ) ); //connect the rescan signal to the rescan slot - connect(acceptFilters.at(index), SIGNAL(rescanFilter()), this, SLOT(rescanFilter()) ); + connect(acceptFilters.at(index), TQT_SIGNAL(rescanFilter()), this, TQT_SLOT(rescanFilter()) ); // //connect all except the matchesChanged to the rescanFilter slot // //title -// connect(acceptFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(rescanFilter() ) ); // //active -// connect(acceptFilters.at(index), SIGNAL(activeChanged( bool )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(activeChanged( bool )), this, TQT_SLOT(rescanFilter() ) ); // //regexps -// connect(acceptFilters.at(index), SIGNAL(regExpsChanged( const QStringList& )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(regExpsChanged( const TQStringList& )), this, TQT_SLOT(rescanFilter() ) ); // //series -// connect(acceptFilters.at(index), SIGNAL(seriesChanged( bool )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(seriesChanged( bool )), this, TQT_SLOT(rescanFilter() ) ); // //sansEpisode -// connect(acceptFilters.at(index), SIGNAL(sansEpisodeChanged( bool )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(sansEpisodeChanged( bool )), this, TQT_SLOT(rescanFilter() ) ); // //minSeason -// connect(acceptFilters.at(index), SIGNAL(minSeasonChanged (int )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(minSeasonChanged (int )), this, TQT_SLOT(rescanFilter() ) ); // //minEpisode -// connect(acceptFilters.at(index), SIGNAL(minEpisodeChanged (int )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(minEpisodeChanged (int )), this, TQT_SLOT(rescanFilter() ) ); // //maxSeason -// connect(acceptFilters.at(index), SIGNAL(maxSeasonChanged (int )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(maxSeasonChanged (int )), this, TQT_SLOT(rescanFilter() ) ); // //maxEpiosde -// connect(acceptFilters.at(index), SIGNAL(maxEpisodeChanged (int )), this, SLOT(rescanFilter() ) ); +// connect(acceptFilters.at(index), TQT_SIGNAL(maxEpisodeChanged (int )), this, TQT_SLOT(rescanFilter() ) ); } @@ -470,29 +470,29 @@ namespace kt rejectFilterList->insertItem(rejectFilters.at(index)->title()); rejectFilterList->setCurrentItem(index); - connect(rejectFilters.at(index), SIGNAL(titleChanged(const QString&)), this, SLOT(updateRejectFilterList()) ); + connect(rejectFilters.at(index), TQT_SIGNAL(titleChanged(const TQString&)), this, TQT_SLOT(updateRejectFilterList()) ); //connect all the fields to the save slot //title - connect(rejectFilters.at(index), SIGNAL(titleChanged(const QString &)), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(saveFilterList() ) ); //active - connect(rejectFilters.at(index), SIGNAL(activeChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(activeChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //regexps - connect(rejectFilters.at(index), SIGNAL(regExpsChanged( const QStringList& )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(regExpsChanged( const TQStringList& )), this, TQT_SLOT(saveFilterList() ) ); //series - connect(rejectFilters.at(index), SIGNAL(seriesChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(seriesChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //sansEpisode - connect(rejectFilters.at(index), SIGNAL(sansEpisodeChanged( bool )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(sansEpisodeChanged( bool )), this, TQT_SLOT(saveFilterList() ) ); //minSeason - connect(rejectFilters.at(index), SIGNAL(minSeasonChanged (int )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(minSeasonChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //minEpisode - connect(rejectFilters.at(index), SIGNAL(minEpisodeChanged (int )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(minEpisodeChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //maxSeason - connect(rejectFilters.at(index), SIGNAL(maxSeasonChanged (int )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(maxSeasonChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //maxEpiosde - connect(rejectFilters.at(index), SIGNAL(maxEpisodeChanged (int )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(maxEpisodeChanged (int )), this, TQT_SLOT(saveFilterList() ) ); //matches - connect(rejectFilters.at(index), SIGNAL(matchesChanged( const QValueList<FilterMatch>& )), this, SLOT(saveFilterList() ) ); + connect(rejectFilters.at(index), TQT_SIGNAL(matchesChanged( const TQValueList<FilterMatch>& )), this, TQT_SLOT(saveFilterList() ) ); } @@ -606,7 +606,7 @@ namespace kt if (item < 0) { //let's check which one sent the signal - if we can't figure it all then update them all - int pos = feeds.find((RssFeed *)sender()); + int pos = feeds.tqfind((RssFeed *)sender()); if (pos < 0) { @@ -639,7 +639,7 @@ namespace kt if (item < 0) { //let's check which one sent the signal - if we can't figure it all then update them all - int pos = acceptFilters.find((RssFilter *)sender()); + int pos = acceptFilters.tqfind((RssFilter *)sender()); if (pos < 0) { @@ -672,7 +672,7 @@ namespace kt if (item < 0) { //let's check which one sent the signal - if we can't figure it all then update them all - int pos = rejectFilters.find((RssFilter *)sender()); + int pos = rejectFilters.tqfind((RssFilter *)sender()); if (pos < 0) { @@ -704,7 +704,7 @@ namespace kt feedArticles->setNumRows(articles.count()); for (int i=0; i<articles.count(); i++) { - QString info; + TQString info; if (articles[i].downloaded()==1) { info = ": Manually downloaded"; @@ -719,13 +719,13 @@ namespace kt } } - void RssFeedManager::updateMatches(const QValueList<FilterMatch>& matches) + void RssFeedManager::updateMatches(const TQValueList<FilterMatch>& matches) { filterMatches->setNumRows(matches.count()); for (int i=0; i<matches.count(); i++) { - filterMatches->setText(i, 0, QString::number(matches[i].season())); - filterMatches->setText(i, 1, QString::number(matches[i].episode())); + filterMatches->setText(i, 0, TQString::number(matches[i].season())); + filterMatches->setText(i, 1, TQString::number(matches[i].episode())); filterMatches->setText(i, 2, matches[i].time()); filterMatches->setText(i, 3, matches[i].link()); } @@ -773,7 +773,7 @@ namespace kt curDownload = new RssLinkDownloader(m_core, feedArticles->text(j, 2)); for (int i=0; i<feeds.count(); i++) { - connect(curDownload, SIGNAL(linkDownloaded( QString, int )), feeds.at(i), SLOT(setDownloaded(QString, int)) ); + connect(curDownload, TQT_SIGNAL(linkDownloaded( TQString, int )), feeds.at(i), TQT_SLOT(setDownloaded(TQString, int)) ); } } } @@ -793,7 +793,7 @@ namespace kt void RssFeedManager::deleteSelectedMatches() { - QStringList selectedLinks; + TQStringList selectedLinks; for (int i=0; i<filterMatches->numSelections(); i++) { int endRow = filterMatches->selection(i).topRow() + filterMatches->selection(i).numRows(); @@ -883,7 +883,7 @@ namespace kt //active feedActive->setChecked(false); //autoRefresh - feedAutoRefresh->setTime(QTime()); + feedAutoRefresh->setTime(TQTime()); //ignoreTTL feedIgnoreTTL->setChecked(false); //articles @@ -1080,12 +1080,12 @@ namespace kt } } - QString RssFeedManager::getFeedListFilename() + TQString RssFeedManager::getFeedListFilename() { return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds.ktr"; } - QString RssFeedManager::getFilterListFilename() + TQString RssFeedManager::getFilterListFilename() { return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfilters.ktr"; } @@ -1097,13 +1097,13 @@ namespace kt feedListSaving = true; - QString filename = getFeedListFilename(); + TQString filename = getFeedListFilename(); //save feeds to disk - QFile file(filename); + TQFile file(filename); file.open( IO_WriteOnly ); - QDataStream out(&file); + TQDataStream out(&file); out << feeds.count(); @@ -1117,15 +1117,15 @@ namespace kt void RssFeedManager::loadFeedList() { - QString filename = getFeedListFilename(); + TQString filename = getFeedListFilename(); //load feeds from disk - QFile file(filename); + TQFile file(filename); if (file.exists()) { file.open( IO_ReadOnly ); - QDataStream in(&file); + TQDataStream in(&file); int numFeeds; @@ -1150,13 +1150,13 @@ namespace kt filterListSaving = true; - QString filename = getFilterListFilename(); + TQString filename = getFilterListFilename(); //save feeds to disk - QFile file(filename); + TQFile file(filename); file.open( IO_WriteOnly ); - QDataStream out(&file); + TQDataStream out(&file); out << acceptFilters.count(); @@ -1177,15 +1177,15 @@ namespace kt void RssFeedManager::loadFilterList() { - QString filename = getFilterListFilename(); + TQString filename = getFilterListFilename(); //load feeds from disk - QFile file(filename); + TQFile file(filename); if (file.exists()) { file.open( IO_ReadOnly ); - QDataStream in(&file); + TQDataStream in(&file); int numFilters; @@ -1232,7 +1232,7 @@ namespace kt RssLinkDownloader * curDownload = new RssLinkDownloader(m_core, article.link().prettyURL(), filter); for (int i=0; i<feeds.count(); i++) { - connect(curDownload, SIGNAL(linkDownloaded( QString, int )), feeds.at(i), SLOT(setDownloaded(QString, int)) ); + connect(curDownload, TQT_SIGNAL(linkDownloaded( TQString, int )), feeds.at(i), TQT_SLOT(setDownloaded(TQString, int)) ); } } } @@ -1245,7 +1245,7 @@ namespace kt RssLinkDownloader * curDownload = new RssLinkDownloader(m_core, article.link().prettyURL(), acceptFilters.at(i)); for (int i=0; i<feeds.count(); i++) { - connect(curDownload, SIGNAL(linkDownloaded( QString, int )), feeds.at(i), SLOT(setDownloaded(QString, int)) ); + connect(curDownload, TQT_SIGNAL(linkDownloaded( TQString, int )), feeds.at(i), TQT_SLOT(setDownloaded(TQString, int)) ); } } } @@ -1254,7 +1254,7 @@ namespace kt void RssFeedManager::rescanFilter() { - int pos = acceptFilters.find((RssFilter *)sender()); + int pos = acceptFilters.tqfind((RssFilter *)sender()); if (pos >= 0) { @@ -1270,7 +1270,7 @@ namespace kt void RssFeedManager::testTextChanged() { - testText->setPaletteBackgroundColor(QColor(255, 255, 255)); + testText->setPaletteBackgroundColor(TQColor(255, 255, 255)); testTestText->setEnabled(!testText->text().isEmpty()); } @@ -1293,22 +1293,22 @@ namespace kt if (curFilter->scanArticle(testArticle, false, false)) { - testText->setPaletteBackgroundColor(QColor(0, 255, 0)); + testText->setPaletteBackgroundColor(TQColor(0, 255, 0)); } else { - testText->setPaletteBackgroundColor(QColor(255, 0, 0)); + testText->setPaletteBackgroundColor(TQColor(255, 0, 0)); } } - void RssFeedManager::setFilterTitle(const QString& title) + void RssFeedManager::setFilterTitle(const TQString& title) { int cursorPos = filterTitle->cursorPosition(); filterTitle->setText(title); filterTitle->setCursorPosition(cursorPos); } - void RssFeedManager::setFeedTitle(const QString& title) + void RssFeedManager::setFeedTitle(const TQString& title) { int cursorPos = feedTitle->cursorPosition(); feedTitle->setText(title); diff --git a/plugins/rssfeed/rssfeedmanager.h b/plugins/rssfeed/rssfeedmanager.h index 1afc766..2d3e7cd 100644 --- a/plugins/rssfeed/rssfeedmanager.h +++ b/plugins/rssfeed/rssfeedmanager.h @@ -22,12 +22,12 @@ #include <kdirlister.h> #include <kfileitem.h> -#include <qstring.h> -#include <qobject.h> -#include <qdir.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqdir.h> -#include <qptrlist.h> -#include <qwidget.h> +#include <tqptrlist.h> +#include <tqwidget.h> #include "rssfeedwidget.h" #include "rssfeed.h" @@ -47,6 +47,7 @@ namespace kt class RssFeedManager : public RssFeedWidget { Q_OBJECT + TQ_OBJECT public: /** @@ -54,7 +55,7 @@ namespace kt * @param core Pointer to core interface * @param openSilently Wheather to open torrent silently or nor. */ - RssFeedManager(CoreInterface* core, QWidget * parent = 0); + RssFeedManager(CoreInterface* core, TQWidget * tqparent = 0); ~RssFeedManager(); public slots: @@ -85,7 +86,7 @@ namespace kt void deleteSelectedRejectFilter(); void updateRegExps(); - void updateMatches(const QValueList<FilterMatch>& matches); + void updateMatches(const TQValueList<FilterMatch>& matches); void saveFeedList(); void saveFilterList(); @@ -102,24 +103,24 @@ namespace kt void testTextChanged(); void testFilter(); - void setFilterTitle(const QString& title); - void setFeedTitle(const QString& title); + void setFilterTitle(const TQString& title); + void setFeedTitle(const TQString& title); private: CoreInterface* m_core; - QPtrList<RssFeed> feeds; + TQPtrList<RssFeed> feeds; int currentFeed; - QPtrList<RssFilter> acceptFilters; + TQPtrList<RssFilter> acceptFilters; int currentAcceptFilter; - QPtrList<RssFilter> rejectFilters; + TQPtrList<RssFilter> rejectFilters; int currentRejectFilter; - QString getFeedListFilename(); + TQString getFeedListFilename(); void loadFeedList(); - QString getFilterListFilename(); + TQString getFilterListFilename(); void loadFilterList(); bool feedListSaving; diff --git a/plugins/rssfeed/rssfeedplugin.cpp b/plugins/rssfeed/rssfeedplugin.cpp index 0d845b7..66761cc 100644 --- a/plugins/rssfeed/rssfeedplugin.cpp +++ b/plugins/rssfeed/rssfeedplugin.cpp @@ -26,8 +26,8 @@ #include <util/constants.h> #include <util/log.h> -#include <qstring.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqfile.h> #include <kmessagebox.h> #include <klocale.h> @@ -42,13 +42,13 @@ K_EXPORT_COMPONENT_FACTORY(ktrssfeedplugin,KGenericFactory<kt::RssFeedPlugin>("r namespace kt { - const QString NAME = "RSS Feeds"; - const QString AUTHOR = "Alan Jones"; - const QString EMAIL = "[email protected]"; - const QString DESCRIPTION = i18n("Automatically scans RSS feeds for torrent matching regular expressions and loads them."); + const TQString NAME = "RSS Feeds"; + const TQString AUTHOR = "Alan Jones"; + const TQString EMAIL = "[email protected]"; + const TQString DESCRIPTION = i18n("Automatically scans RSS feeds for torrent matching regular expressions and loads them."); - RssFeedPlugin::RssFeedPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("RSS Feeds"),AUTHOR,EMAIL,DESCRIPTION,"player_playlist") + RssFeedPlugin::RssFeedPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("RSS Feeds"),AUTHOR,EMAIL,DESCRIPTION,"player_playlist") { m_rssFeedManager = 0; } @@ -77,7 +77,7 @@ namespace kt m_rssFeedManager = 0; } - bool RssFeedPlugin::versionCheck(const QString & version) const + bool RssFeedPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/rssfeed/rssfeedplugin.h b/plugins/rssfeed/rssfeedplugin.h index 4ecc6af..991727f 100644 --- a/plugins/rssfeed/rssfeedplugin.h +++ b/plugins/rssfeed/rssfeedplugin.h @@ -22,7 +22,7 @@ #include <interfaces/plugin.h> -class QString; +class TQString; namespace kt @@ -37,13 +37,14 @@ namespace kt class RssFeedPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - RssFeedPlugin(QObject* parent, const char* name, const QStringList& args); + RssFeedPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~RssFeedPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; private: RssFeedManager * m_rssFeedManager; diff --git a/plugins/rssfeed/rssfeedwidget.ui b/plugins/rssfeed/rssfeedwidget.ui index 55bd27b..2a4b014 100644 --- a/plugins/rssfeed/rssfeedwidget.ui +++ b/plugins/rssfeed/rssfeedwidget.ui @@ -2,7 +2,7 @@ <class>RssFeedWidget</class> <comment>The display widget for the rssfeed tab</comment> <author>Alan Jones</author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>RssFeedWidget</cstring> </property> @@ -21,14 +21,14 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTabWidget" row="0" column="0"> + <widget class="TQTabWidget" row="0" column="0"> <property name="name"> <cstring>tabs</cstring> </property> <property name="margin"> <number>2</number> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>feeds</cstring> </property> @@ -39,22 +39,22 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QSplitter"> + <widget class="TQSplitter"> <property name="name"> <cstring>splitter16</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QListBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQListBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>feedlist</cstring> </property> @@ -67,7 +67,7 @@ </sizepolicy> </property> </widget> - <widget class="QPushButton" row="1" column="1"> + <widget class="TQPushButton" row="1" column="1"> <property name="name"> <cstring>deleteFeed</cstring> </property> @@ -78,7 +78,7 @@ <string>De&lete</string> </property> </widget> - <widget class="QPushButton" row="1" column="0"> + <widget class="TQPushButton" row="1" column="0"> <property name="name"> <cstring>newFeed</cstring> </property> @@ -88,7 +88,7 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> <cstring>feedLayout</cstring> </property> @@ -101,7 +101,7 @@ <cstring>feedUrl</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>feedUrlLabel</cstring> </property> @@ -120,7 +120,7 @@ <cstring>feedUrl</cstring> </property> </widget> - <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="3" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>feedBox</cstring> </property> @@ -152,14 +152,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>90</width> <height>21</height> </size> </property> </spacer> - <widget class="QPushButton" row="1" column="2"> + <widget class="TQPushButton" row="1" column="2"> <property name="name"> <cstring>downloadArticle</cstring> </property> @@ -173,7 +173,7 @@ <string></string> </property> </widget> - <widget class="QTable" row="0" column="0" rowspan="1" colspan="3"> + <widget class="TQTable" row="0" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>feedArticles</cstring> </property> @@ -192,15 +192,15 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>feedRefreshTimeLabel</cstring> </property> @@ -219,7 +219,7 @@ <cstring>feedAutoRefresh</cstring> </property> </widget> - <widget class="QTimeEdit"> + <widget class="TQTimeEdit"> <property name="name"> <cstring>feedAutoRefresh</cstring> </property> @@ -234,7 +234,7 @@ </time> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>feedIgnoreTTL</cstring> </property> @@ -252,14 +252,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>60</width> <height>21</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>refreshFeed</cstring> </property> @@ -275,15 +275,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>layout47</cstring> + <cstring>tqlayout47</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>feedTitleLabel</cstring> </property> @@ -302,12 +302,12 @@ <cstring>feedTitle</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>feedTitle</cstring> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>feedArticleAgeLabel</cstring> </property> @@ -323,7 +323,7 @@ <string>Keep Articles (days)</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>feedArticleAge</cstring> </property> @@ -331,7 +331,7 @@ <number>3650</number> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>feedActive</cstring> </property> @@ -354,7 +354,7 @@ </widget> </vbox> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>filters</cstring> </property> @@ -365,15 +365,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout28</cstring> + <cstring>tqlayout28</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox12</cstring> </property> @@ -392,12 +392,12 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QListBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQListBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>acceptFilterList</cstring> </property> </widget> - <widget class="QPushButton" row="1" column="1"> + <widget class="TQPushButton" row="1" column="1"> <property name="name"> <cstring>deleteAcceptFilter</cstring> </property> @@ -411,7 +411,7 @@ <string></string> </property> </widget> - <widget class="QPushButton" row="1" column="0"> + <widget class="TQPushButton" row="1" column="0"> <property name="name"> <cstring>newAcceptFilter</cstring> </property> @@ -421,7 +421,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox13</cstring> </property> @@ -443,12 +443,12 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QListBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQListBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>rejectFilterList</cstring> </property> </widget> - <widget class="QPushButton" row="1" column="1"> + <widget class="TQPushButton" row="1" column="1"> <property name="name"> <cstring>deleteRejectFilter</cstring> </property> @@ -462,7 +462,7 @@ <string></string> </property> </widget> - <widget class="QPushButton" row="1" column="0"> + <widget class="TQPushButton" row="1" column="0"> <property name="name"> <cstring>newRejectFilter</cstring> </property> @@ -474,23 +474,23 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout14</cstring> + <cstring>tqlayout14</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>filterTitleLabel</cstring> </property> @@ -509,12 +509,12 @@ <cstring>filterTitle</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>filterTitle</cstring> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>filterActive</cstring> </property> @@ -524,9 +524,9 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout12</cstring> + <cstring>tqlayout12</cstring> </property> <hbox> <property name="name"> @@ -563,23 +563,23 @@ <set>Remove|Add</set> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout28</cstring> + <cstring>tqlayout28</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>filterSeries</cstring> </property> @@ -600,21 +600,21 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>50</width> <height>21</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>processFilter</cstring> </property> <property name="enabled"> <bool>true</bool> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>60</width> <height>32767</height> @@ -629,11 +629,11 @@ </widget> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>seriesBox</cstring> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32000</width> <height>32000</height> @@ -646,9 +646,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> @@ -664,14 +664,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>21</height> </size> </property> </spacer> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>filterSansEpisode</cstring> </property> @@ -684,20 +684,20 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QSpinBox" row="0" column="1"> + <widget class="TQSpinBox" row="0" column="1"> <property name="name"> <cstring>filterMinSeason</cstring> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>filterMaxEpisodeLabel</cstring> </property> @@ -713,17 +713,17 @@ <string>Max Episode</string> </property> </widget> - <widget class="QSpinBox" row="0" column="3"> + <widget class="TQSpinBox" row="0" column="3"> <property name="name"> <cstring>filterMinEpisode</cstring> </property> </widget> - <widget class="QSpinBox" row="1" column="1"> + <widget class="TQSpinBox" row="1" column="1"> <property name="name"> <cstring>filterMaxSeason</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>filterMaxSeasonLabel</cstring> </property> @@ -742,7 +742,7 @@ <cstring>filterMinSeason</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>filterMinSeasonLabel</cstring> </property> @@ -761,12 +761,12 @@ <cstring>filterMinSeason</cstring> </property> </widget> - <widget class="QSpinBox" row="1" column="3"> + <widget class="TQSpinBox" row="1" column="3"> <property name="name"> <cstring>filterMaxEpisode</cstring> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>filterMinEpisodeLabel</cstring> </property> @@ -790,15 +790,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout33</cstring> + <cstring>tqlayout33</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>testTextLabel</cstring> </property> @@ -817,7 +817,7 @@ <cstring>testText</cstring> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>testText</cstring> </property> @@ -829,7 +829,7 @@ </color> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>testTestText</cstring> </property> @@ -842,7 +842,7 @@ </widget> </hbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>filterMatchesBox</cstring> </property> @@ -861,7 +861,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTable"> + <widget class="TQTable"> <property name="name"> <cstring>filterMatches</cstring> </property> @@ -878,15 +878,15 @@ <enum>MultiRow</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>downloadFilterMatch</cstring> </property> @@ -910,14 +910,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>170</width> <height>21</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>deleteFilterMatch</cstring> </property> @@ -958,7 +958,7 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="2" margin="2"/> +<tqlayoutdefaults spacing="2" margin="2"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> diff --git a/plugins/rssfeed/rssfilter.cpp b/plugins/rssfeed/rssfilter.cpp index 6cf1f1f..e7c4925 100644 --- a/plugins/rssfeed/rssfilter.cpp +++ b/plugins/rssfeed/rssfilter.cpp @@ -22,7 +22,7 @@ namespace kt { - FilterMatch::FilterMatch(int season, int episode, QString link, QString time) + FilterMatch::FilterMatch(int season, int episode, TQString link, TQString time) { m_season = season; m_episode = episode; @@ -53,7 +53,7 @@ namespace kt return m_link==other.link() && m_season==other.season() && m_episode==other.episode(); } - RssFilter::RssFilter(QObject * parent) : QObject(parent) + RssFilter::RssFilter(TQObject * tqparent) : TQObject(tqparent) { m_title = "New"; m_active = false; @@ -62,9 +62,9 @@ namespace kt m_minSeason = m_minEpisode = m_maxSeason = m_maxEpisode = 0; } - RssFilter::RssFilter(QString title, bool active, QStringList regExps, bool series, bool sansEpisode, + RssFilter::RssFilter(TQString title, bool active, TQStringList regExps, bool series, bool sansEpisode, int minSeason, int minEpisode, int maxSeason, int maxEpisode, - QValueList<FilterMatch> matches) + TQValueList<FilterMatch> matches) { m_title = title; m_active = active; @@ -78,7 +78,7 @@ namespace kt m_matches = matches; } - RssFilter::RssFilter(const RssFilter &other) : QObject() + RssFilter::RssFilter(const RssFilter &other) : TQObject() { *this = other; } @@ -102,7 +102,7 @@ namespace kt return *this; } - void RssFilter::setTitle( const QString& title ) + void RssFilter::setTitle( const TQString& title ) { if (m_title != title) { @@ -121,7 +121,7 @@ namespace kt } } - void RssFilter::setRegExps( const QStringList& regExps ) + void RssFilter::setRegExps( const TQStringList& regExps ) { if (regExps != m_regExps) { @@ -191,7 +191,7 @@ namespace kt } } - void RssFilter::setMatches( const QValueList<FilterMatch>& matches ) + void RssFilter::setMatches( const TQValueList<FilterMatch>& matches ) { if (matches != m_matches) { @@ -252,7 +252,7 @@ namespace kt if (!m_active && saveMatch) return false; - QRegExp regEx; + TQRegExp regEx; regEx.setCaseSensitive(false); if (!m_regExps.count()) @@ -263,7 +263,7 @@ namespace kt if (m_regExps[i].isEmpty()) continue; - QString curExp = m_regExps[i]; + TQString curExp = m_regExps[i]; bool invert=false; if (curExp.startsWith( "!" )) @@ -276,14 +276,14 @@ namespace kt if (!invert) { - if (!article.title().contains(regEx) && !article.link().prettyURL().contains(regEx) && !article.description().contains(regEx) ) + if (!article.title().tqcontains(regEx) && !article.link().prettyURL().tqcontains(regEx) && !article.description().tqcontains(regEx) ) { return false; } } else { - if (article.title().contains(regEx) || article.link().prettyURL().contains(regEx) || article.description().contains(regEx) ) + if (article.title().tqcontains(regEx) || article.link().prettyURL().tqcontains(regEx) || article.description().tqcontains(regEx) ) { return false; } @@ -295,15 +295,15 @@ namespace kt if (m_series) { - QStringList episodeFormats; + TQStringList episodeFormats; episodeFormats << "s([0-9]{1,2})[de]([0-9]{1,2})[^0-9]" << "[^0-9]([0-9]{1,2})x([0-9]{1,2})[^0-9]" << "[^0-9]([0-9]{1,2})([0-9]{2})[^0-9]"; for (int i=0; i<episodeFormats.count(); i++) { regEx.setPattern(*episodeFormats.at(i)); if (regEx.search(article.title()) >= 0) { - season = (*regEx.capturedTexts().at(1)).toInt(); - episode = (*regEx.capturedTexts().at(2)).toInt(); + season = (*regEx.tqcapturedTexts().at(1)).toInt(); + episode = (*regEx.tqcapturedTexts().at(2)).toInt(); if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) { return false; @@ -313,8 +313,8 @@ namespace kt if (regEx.search(article.link().prettyURL()) >= 0) { - season = (*regEx.capturedTexts().at(1)).toInt(); - episode = (*regEx.capturedTexts().at(2)).toInt(); + season = (*regEx.tqcapturedTexts().at(1)).toInt(); + episode = (*regEx.tqcapturedTexts().at(2)).toInt(); if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) { return false; @@ -324,8 +324,8 @@ namespace kt if (regEx.search(article.description()) >= 0) { - season = (*regEx.capturedTexts().at(1)).toInt(); - episode = (*regEx.capturedTexts().at(2)).toInt(); + season = (*regEx.tqcapturedTexts().at(1)).toInt(); + episode = (*regEx.tqcapturedTexts().at(2)).toInt(); if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) { return false; @@ -354,10 +354,10 @@ namespace kt return true; } - void RssFilter::deleteMatch(const QString& link) + void RssFilter::deleteMatch(const TQString& link) { - QValueList<FilterMatch>::iterator it = m_matches.begin(); + TQValueList<FilterMatch>::iterator it = m_matches.begin(); while (it != m_matches.end()) { if ((*it).link() == link) @@ -372,43 +372,43 @@ namespace kt } - QDataStream &operator<<( QDataStream &out, const FilterMatch &filterMatch ) + TQDataStream &operator<<( TQDataStream &out, const FilterMatch &filterMatch ) { out << filterMatch.season() << filterMatch.episode() << filterMatch.time() << filterMatch.link(); return out; } - QDataStream &operator>>( QDataStream &in, FilterMatch &filterMatch ) + TQDataStream &operator>>( TQDataStream &in, FilterMatch &filterMatch ) { int season, episode; - QString time; - QString link; + TQString time; + TQString link; in >> season >> episode >> time >> link; filterMatch = FilterMatch(season, episode, link, time); return in; } - QDataStream &operator<<( QDataStream &out, const RssFilter &filter ) + TQDataStream &operator<<( TQDataStream &out, const RssFilter &filter ) { out << filter.title() << int(filter.active()) << filter.regExps() << int(filter.series()) << int(filter.sansEpisode()) << filter.minSeason() << filter.minEpisode() << filter.maxSeason() << filter.maxEpisode() << filter.matches(); return out; } - QDataStream &operator>>( QDataStream &in, RssFilter &filter ) + TQDataStream &operator>>( TQDataStream &in, RssFilter &filter ) { - QString title; + TQString title; int active; - QStringList regExps; + TQStringList regExps; int series; int sansEpisode; int minSeason; int minEpisode; int maxSeason; int maxEpisode; - QValueList<FilterMatch> matches; + TQValueList<FilterMatch> matches; in >> title >> active >> regExps >> series >> sansEpisode >> minSeason >> minEpisode >> maxSeason >> maxEpisode >> matches; filter = RssFilter(title, active, regExps, series, sansEpisode, minSeason, minEpisode, maxSeason, maxEpisode, matches); diff --git a/plugins/rssfeed/rssfilter.h b/plugins/rssfeed/rssfilter.h index be31d18..2bf3dca 100644 --- a/plugins/rssfeed/rssfilter.h +++ b/plugins/rssfeed/rssfilter.h @@ -20,11 +20,11 @@ #ifndef RSSFILTER_H #define RSSFILTER_H -#include <qobject.h> -#include <qstring.h> -#include <qtimer.h> -#include <qdatastream.h> -#include <qregexp.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqdatastream.h> +#include <tqregexp.h> #include "rssarticle.h" @@ -42,109 +42,110 @@ namespace kt { public: - FilterMatch() { m_season = 0; m_episode = 0; m_time = QDateTime::currentDateTime().toString(); m_link=QString(); }; - FilterMatch(int season, int episode, QString link, QString time = QDateTime::currentDateTime().toString()); + FilterMatch() { m_season = 0; m_episode = 0; m_time = TQDateTime::tqcurrentDateTime().toString(); m_link=TQString(); }; + FilterMatch(int season, int episode, TQString link, TQString time = TQDateTime::tqcurrentDateTime().toString()); FilterMatch(const FilterMatch &other); FilterMatch &operator=(const FilterMatch &other); bool operator==(const FilterMatch &other) const; ~FilterMatch() {}; - QString link() const { return m_link; } + TQString link() const { return m_link; } int season() const { return m_season; } int episode() const { return m_episode; } - QString time() const { return m_time; } + TQString time() const { return m_time; } - void setLink(const QString& link) { m_link = link; } + void setLink(const TQString& link) { m_link = link; } void setSeason(int season) { m_season = season; } void setEpisode(int episode) { m_episode = episode; } - void setTime(QString time) { m_time = time; } + void setTime(TQString time) { m_time = time; } private: int m_season; int m_episode; - QString m_link; - QString m_time; + TQString m_link; + TQString m_time; }; - class RssFilter : public QObject + class RssFilter : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. */ - RssFilter(QObject * parent = 0); + RssFilter(TQObject * tqparent = 0); RssFilter(const RssFilter &other); - RssFilter(QString title, bool active, QStringList regexps, bool series, bool sansEpisode, + RssFilter(TQString title, bool active, TQStringList regexps, bool series, bool sansEpisode, int minSeason, int minEpisode, int maxSeason, int maxEpisode, - QValueList<FilterMatch> matches); + TQValueList<FilterMatch> matches); RssFilter &operator=(const RssFilter &other); ~RssFilter(); - QString title() const { return m_title; } + TQString title() const { return m_title; } bool active() const { return m_active; } - QStringList regExps() const { return m_regExps; } + TQStringList regExps() const { return m_regExps; } bool series() const { return m_series; } bool sansEpisode() const { return m_sansEpisode; } int minSeason() const { return m_minSeason; } int minEpisode() const { return m_minEpisode; } int maxSeason() const { return m_maxSeason; } int maxEpisode() const { return m_maxEpisode; } - QValueList<FilterMatch> matches() const { return m_matches; } + TQValueList<FilterMatch> matches() const { return m_matches; } bool scanArticle(RssArticle article, bool ignoreMatches = true, bool saveMatch = true); - void deleteMatch(const QString& link); + void deleteMatch(const TQString& link); public slots: - void setTitle( const QString& title ); + void setTitle( const TQString& title ); void setActive( bool active ); - void setRegExps ( const QStringList& regexps ); + void setRegExps ( const TQStringList& regexps ); void setSeries ( bool series ); void setSansEpisode ( bool sansEpisode ); void setMinSeason( int minSeason ); void setMinEpisode( int minEpisode ); void setMaxSeason( int maxSeason ); void setMaxEpisode( int maxEpisode ); - void setMatches( const QValueList<FilterMatch>& matches ); + void setMatches( const TQValueList<FilterMatch>& matches ); //void scanFilter(); signals: - void titleChanged( const QString& title ); + void titleChanged( const TQString& title ); void activeChanged( bool active ); - void regExpsChanged( const QStringList& regexps ); + void regExpsChanged( const TQStringList& regexps ); void seriesChanged( bool series ); void sansEpisodeChanged( bool sansEpisode ); void minSeasonChanged (int minSeason); void minEpisodeChanged (int minEpisode); void maxSeasonChanged (int maxSeason); void maxEpisodeChanged (int maxEpisode); - void matchesChanged( const QValueList<FilterMatch>& matches ); + void matchesChanged( const TQValueList<FilterMatch>& matches ); void rescanFilter(); private: - QString m_title; + TQString m_title; bool m_active; - QStringList m_regExps; + TQStringList m_regExps; bool m_series; bool m_sansEpisode; int m_minSeason; int m_minEpisode; int m_maxSeason; int m_maxEpisode; - QValueList<FilterMatch> m_matches; + TQValueList<FilterMatch> m_matches; bool episodeInRange(int season, int episode, bool ignoreMatches, bool& alreadyDownloaded); }; - QDataStream &operator<<( QDataStream &out, const FilterMatch &filterMatch ); - QDataStream &operator>>( QDataStream &in, FilterMatch &filterMatch ); + TQDataStream &operator<<( TQDataStream &out, const FilterMatch &filterMatch ); + TQDataStream &operator>>( TQDataStream &in, FilterMatch &filterMatch ); - QDataStream &operator<<( QDataStream &out, const RssFilter &filter ); - QDataStream &operator>>( QDataStream &in, RssFilter &filter ); + TQDataStream &operator<<( TQDataStream &out, const RssFilter &filter ); + TQDataStream &operator>>( TQDataStream &in, RssFilter &filter ); } diff --git a/plugins/rssfeed/rsslinkdownloader.cpp b/plugins/rssfeed/rsslinkdownloader.cpp index 4b0f390..467055e 100644 --- a/plugins/rssfeed/rsslinkdownloader.cpp +++ b/plugins/rssfeed/rsslinkdownloader.cpp @@ -23,7 +23,7 @@ #include <kmimetype.h> #include <kmessagebox.h> -#include <qfile.h> +#include <tqfile.h> #include "../../libktorrent/torrent/bdecoder.h" #include "../../libktorrent/torrent/bnode.h" @@ -33,7 +33,7 @@ using namespace bt; namespace kt { - RssLinkDownloader::RssLinkDownloader(CoreInterface* core, QString link, RssFilter * filter, QObject * parent) : QObject (parent) + RssLinkDownloader::RssLinkDownloader(CoreInterface* core, TQString link, RssFilter * filter, TQObject * tqparent) : TQObject (tqparent) { //tempFile.setAutoDelete(true); m_core = core; @@ -42,15 +42,15 @@ namespace kt if (!KURL(link).isValid()) { // no valid URL, so just display an error message - KMessageBox::error(0,i18n("Failed to find and download a valid torrent for %1").arg(curLink)); - QTimer::singleShot(50,this,SLOT(suicide())); + KMessageBox::error(0,i18n("Failed to find and download a valid torrent for %1").tqarg(curLink)); + TQTimer::singleShot(50,this,TQT_SLOT(suicide())); } else { //first let's download the link so we can process it to check for the actual torrent curLink = curSubLink = link; curFile = KIO::storedGet(link,false,false); - connect(curFile, SIGNAL(result(KIO::Job*)),this,SLOT(processLink( KIO::Job* ))); + connect(curFile, TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(processLink( KIO::Job* ))); } } @@ -59,10 +59,10 @@ namespace kt } - void RssLinkDownloader::processLink(KIO::Job* jobStatus) + void RssLinkDownloader::processLink(KIO::Job* jobtqStatus) { - if (!jobStatus->error()) + if (!jobtqStatus->error()) { //the file downloaded ok - so let's check if it's a torrent KMimeType linkType = *KMimeType::findByContent(curFile->data()); @@ -72,22 +72,22 @@ namespace kt { KURL url = curLink; //let's go through the data and populate our sublink array - QTextStream html(curFile->data(), IO_ReadOnly); + TQTextStream html(curFile->data(), IO_ReadOnly); //go through a line at a time checking for a torrent - QString htmlline = html.readLine(); + TQString htmlline = html.readLine(); while (!htmlline.isNull()) { - QRegExp hrefTags = QString("<A.*HREF.*</A"); + TQRegExp hrefTags = TQString("<A.*HREF.*</A"); hrefTags.setCaseSensitive(false); hrefTags.setMinimal(true); int matchPos = 0; - while (htmlline.find(hrefTags, matchPos) >= 0) + while (htmlline.tqfind(hrefTags, matchPos) >= 0) { matchPos += hrefTags.matchedLength(); //we're found an <a href tag - let's check it if contains download - QRegExp hrefText = QString("d(own)?load"); + TQRegExp hrefText = TQString("d(own)?load"); hrefText.setCaseSensitive(false); if (!hrefTags.capturedTexts()[0].contains(hrefText)) @@ -97,20 +97,20 @@ namespace kt } //we're found an <a href tag - now let's the the url out of it - hrefText = QString("HREF=\"?([^\">< ]*)[\" ]"); + hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]"); hrefText.setCaseSensitive(false); - hrefTags.capturedTexts()[0].find(hrefText); + hrefTags.tqcapturedTexts()[0].tqfind(hrefText); //lets get the captured - QString hrefLink = hrefText.capturedTexts()[1]; + TQString hrefLink = hrefText.capturedTexts()[1]; - if (hrefLink.startsWith("/")) + if (hrefLink.tqstartsWith("/")) { hrefLink = url.protocol() + "://" + url.host() + hrefLink; } - else if (!hrefLink.startsWith("http://", false)) + else if (!hrefLink.tqstartsWith("http://", false)) { - hrefLink = url.url().left(url.url().findRev("/")+1) + hrefLink; + hrefLink = url.url().left(url.url().tqfindRev("/")+1) + hrefLink; } subLinks.append(hrefLink); @@ -180,7 +180,7 @@ namespace kt else { //failed to download a selected article from a feed - KMessageBox::error(0,i18n("Failed to find and download a valid torrent for %1").arg(curLink)); + KMessageBox::error(0,i18n("Failed to find and download a valid torrent for %1").tqarg(curLink)); } deleteLater(); } @@ -189,7 +189,7 @@ namespace kt curSubLink = subLinks.first(); subLinks.pop_front(); curFile = KIO::storedGet(curSubLink,false,false); - connect(curFile, SIGNAL(result(KIO::Job*)),this,SLOT(processLink( KIO::Job* ))); + connect(curFile, TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(processLink( KIO::Job* ))); } } diff --git a/plugins/rssfeed/rsslinkdownloader.h b/plugins/rssfeed/rsslinkdownloader.h index 2266f29..0c5541f 100644 --- a/plugins/rssfeed/rsslinkdownloader.h +++ b/plugins/rssfeed/rsslinkdownloader.h @@ -28,7 +28,7 @@ #include <util/log.h> #include <util/constants.h> -#include <qstring.h> +#include <tqstring.h> #include "rssfilter.h" #include "rssarticle.h" @@ -44,30 +44,31 @@ namespace kt * */ - class RssLinkDownloader : public QObject + class RssLinkDownloader : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. */ - RssLinkDownloader(CoreInterface* core, QString link, RssFilter * filter = 0, QObject * parent = 0); + RssLinkDownloader(CoreInterface* core, TQString link, RssFilter * filter = 0, TQObject * tqparent = 0); ~RssLinkDownloader(); public slots: - void processLink(KIO::Job* jobStatus); + void processLink(KIO::Job* jobtqStatus); void suicide(); signals: - void linkDownloaded( QString link, int downloaded ); + void linkDownloaded( TQString link, int downloaded ); private: KIO::StoredTransferJob * curFile; - QString curLink, curSubLink; - QStringList subLinks; + TQString curLink, curSubLink; + TQStringList subLinks; RssFilter * curFilter; bool firstLink; diff --git a/plugins/scanfolder/scanfolder.cpp b/plugins/scanfolder/scanfolder.cpp index 3c30299..36b1ce2 100644 --- a/plugins/scanfolder/scanfolder.cpp +++ b/plugins/scanfolder/scanfolder.cpp @@ -24,10 +24,10 @@ #include <klocale.h> #include <kio/job.h> -#include <qstring.h> -#include <qobject.h> -#include <qfile.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqfile.h> +#include <tqvaluelist.h> #include <torrent/globals.h> #include <util/log.h> @@ -45,7 +45,7 @@ using namespace bt; namespace kt { - ScanFolder::ScanFolder(CoreInterface* core, QString& dir, LoadedTorrentAction action, bool openSilently) + ScanFolder::ScanFolder(CoreInterface* core, TQString& dir, LoadedTorrentAction action, bool openSilently) : m_core(core), m_dir(0), m_loadedAction(action), m_openSilently(openSilently) { m_dir = new KDirLister(); @@ -58,9 +58,9 @@ namespace kt m_dir->setShowingDotFiles(true); - connect(m_dir, SIGNAL(newItems( const KFileItemList& )), this, SLOT(onNewItems( const KFileItemList& ))); - connect(m_core, SIGNAL(loadingFinished( const KURL&, bool, bool )), this, SLOT(onLoadingFinished( const KURL&, bool, bool ))); - connect(&m_incomplePollingTimer,SIGNAL(timeout()),this,SLOT(onIncompletePollingTimeout())); + connect(m_dir, TQT_SIGNAL(newItems( const KFileItemList& )), this, TQT_SLOT(onNewItems( const KFileItemList& ))); + connect(m_core, TQT_SIGNAL(loadingFinished( const KURL&, bool, bool )), this, TQT_SLOT(onLoadingFinished( const KURL&, bool, bool ))); + connect(&m_incomplePollingTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(onIncompletePollingTimeout())); } @@ -76,9 +76,9 @@ namespace kt KFileItem* file; for(file=list.first(); file; file=list.next()) { - QString name = file->name(); - QString dirname = m_dir->url().path(); - QString filename = dirname + bt::DirSeparator() + name; + TQString name = file->name(); + TQString dirname = m_dir->url().path(); + TQString filename = dirname + bt::DirSeparator() + name; if(!name.endsWith(".torrent")) continue; @@ -86,8 +86,8 @@ namespace kt if(name.startsWith(".")) { //Check if corresponding torrent exists - if(!QFile::exists(m_dir->url().path() + bt::DirSeparator() + name.right(name.length() - 1)) && (m_loadedAction == defaultAction)) - QFile::remove(filename); + if(!TQFile::exists(m_dir->url().path() + bt::DirSeparator() + name.right(name.length() - 1)) && (m_loadedAction == defaultAction)) + TQFile::remove(filename); continue; } @@ -96,7 +96,7 @@ namespace kt source.setPath(filename); //If torrent has it's hidden complement - skip it. - if(QFile::exists(dirname + "/." + name)) + if(TQFile::exists(dirname + "/." + name)) continue; if (incomplete(source)) @@ -132,7 +132,7 @@ namespace kt return; //search for entry - QValueList<KURL>::iterator it = m_pendingURLs.find(url); + TQValueList<KURL>::iterator it = m_pendingURLs.tqfind(url); //if no entry is found than this torrent was not started by this plugin so - quit if(it == m_pendingURLs.end()) @@ -144,30 +144,30 @@ namespace kt if(canceled) return; - QString name = url.filename(false); - QString dirname = m_dir->url().path(); - QString filename = dirname + "/" + name; + TQString name = url.filename(false); + TQString dirname = m_dir->url().path(); + TQString filename = dirname + "/" + name; KURL destination(dirname + "/" + i18n("loaded") + "/" + name); switch(m_loadedAction) { case deleteAction: //If torrent has it's hidden complement - remove it too. - if(QFile::exists(dirname + "/." + name)) - QFile::remove(dirname + "/." + name); + if(TQFile::exists(dirname + "/." + name)) + TQFile::remove(dirname + "/." + name); // Out() << "Deleting: " << name.ascii() << endl; - QFile::remove(filename); + TQFile::remove(filename); break; case moveAction: // Out() << "Moving: " << name.ascii() << endl; //If torrent has it's hidden complement - remove it too. - if(QFile::exists(dirname + "/." + name)) - QFile::remove(dirname + "/." + name); + if(TQFile::exists(dirname + "/." + name)) + TQFile::remove(dirname + "/." + name); // NetAccess considered harmfull !!! KIO::file_move(url, destination); break; case defaultAction: - QFile f(dirname + "/." + name); + TQFile f(dirname + "/." + name); f.open(IO_WriteOnly); f.close(); break; @@ -183,13 +183,13 @@ namespace kt { m_loadedAction = theValue; - QDir tmp(m_dir->url().path()); + TQDir tmp(m_dir->url().path()); if( (m_loadedAction == moveAction) && !tmp.exists(i18n("loaded"), false)) tmp.mkdir(i18n("loaded"), false); } - void ScanFolder::setFolderUrl(QString& url) + void ScanFolder::setFolderUrl(TQString& url) { if(!m_dir->openURL(url)) { m_valid = false; @@ -201,13 +201,13 @@ namespace kt bool ScanFolder::incomplete(const KURL & src) { // try to decode file, if it is syntactically correct, we can try to load it - QFile fptr(src.path()); + TQFile fptr(src.path()); if (!fptr.open(IO_ReadOnly)) return false; try { - QByteArray data(fptr.size()); + TQByteArray data(fptr.size()); fptr.readBlock(data.data(),fptr.size()); bt::BDecoder dec(data,false); bt::BNode* n = dec.decode(); @@ -234,7 +234,7 @@ namespace kt void ScanFolder::onIncompletePollingTimeout() { bt::Out(SYS_SNF|LOG_NOTICE) << "ScanFolder : checking incomplete files" << endl; - for (QValueList<KURL>::iterator i = m_incompleteURLs.begin(); i != m_incompleteURLs.end();) + for (TQValueList<KURL>::iterator i = m_incompleteURLs.begin(); i != m_incompleteURLs.end();) { KURL source = *i; if (!bt::Exists(source.path())) diff --git a/plugins/scanfolder/scanfolder.h b/plugins/scanfolder/scanfolder.h index 8e8c27c..fdae09a 100644 --- a/plugins/scanfolder/scanfolder.h +++ b/plugins/scanfolder/scanfolder.h @@ -22,11 +22,11 @@ #include <kdirlister.h> #include <kfileitem.h> -#include <qstring.h> -#include <qobject.h> -#include <qdir.h> -#include <qvaluelist.h> -#include <qtimer.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqdir.h> +#include <tqvaluelist.h> +#include <tqtimer.h> #include <kurl.h> namespace kt @@ -53,9 +53,10 @@ namespace kt * @see LoadedTorrentAction * */ - class ScanFolder : public QObject + class ScanFolder : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -65,7 +66,7 @@ namespace kt * @param action Action to perform on loaded torrents. * @param openSilently Wheather to open torrent silently or not. */ - ScanFolder(CoreInterface* core, QString& dir, LoadedTorrentAction action = defaultAction, bool openSilently = true); + ScanFolder(CoreInterface* core, TQString& dir, LoadedTorrentAction action = defaultAction, bool openSilently = true); ~ScanFolder(); ///Accessor method for m_openSilently. @@ -82,7 +83,7 @@ namespace kt bool isValid() const { return m_valid; } ///Sets directory path - void setFolderUrl(QString& url); + void setFolderUrl(TQString& url); public slots: void onNewItems(const KFileItemList &items); @@ -102,10 +103,10 @@ namespace kt LoadedTorrentAction m_loadedAction; bool m_openSilently; - QValueList<KURL> m_pendingURLs; - QValueList<KURL> m_incompleteURLs; + TQValueList<KURL> m_pendingURLs; + TQValueList<KURL> m_incompleteURLs; - QTimer m_incomplePollingTimer; + TQTimer m_incomplePollingTimer; }; } #endif diff --git a/plugins/scanfolder/scanfolderplugin.cpp b/plugins/scanfolder/scanfolderplugin.cpp index a994243..b4bcd5c 100644 --- a/plugins/scanfolder/scanfolderplugin.cpp +++ b/plugins/scanfolder/scanfolderplugin.cpp @@ -25,8 +25,8 @@ #include <util/constants.h> #include <util/log.h> -#include <qstring.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqfile.h> #include <kmessagebox.h> #include <klocale.h> @@ -43,13 +43,13 @@ K_EXPORT_COMPONENT_FACTORY(ktscanfolderplugin,KGenericFactory<kt::ScanFolderPlug namespace kt { - const QString NAME = "Scan Folder"; - const QString AUTHOR = "Ivan Vasic"; - const QString EMAIL = "[email protected]"; - const QString DESCRIPTION = i18n("Automatically scans directories for torrent files and loads them."); + const TQString NAME = "Scan Folder"; + const TQString AUTHOR = "Ivan Vasic"; + const TQString EMAIL = "[email protected]"; + const TQString DESCRIPTION = i18n("Automatically scans directories for torrent files and loads them."); - ScanFolderPlugin::ScanFolderPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Scan Folder"),AUTHOR,EMAIL,DESCRIPTION,"view_sidetree") + ScanFolderPlugin::ScanFolderPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Scan Folder"),AUTHOR,EMAIL,DESCRIPTION,"view_sidetree") { // setXMLFile("ktscanfolderpluginui.rc"); m_sf1 = 0; @@ -90,13 +90,13 @@ namespace kt void ScanFolderPlugin::updateScanFolders() { - QString sfPath1 = ScanFolderPluginSettings::folder1(); - QString sfPath2 = ScanFolderPluginSettings::folder2(); - QString sfPath3 = ScanFolderPluginSettings::folder3(); + TQString sfPath1 = ScanFolderPluginSettings::folder1(); + TQString sfPath2 = ScanFolderPluginSettings::folder2(); + TQString sfPath3 = ScanFolderPluginSettings::folder3(); - bool valid1 = QFile::exists(sfPath1); - bool valid2 = QFile::exists(sfPath2); - bool valid3 = QFile::exists(sfPath3); + bool valid1 = TQFile::exists(sfPath1); + bool valid2 = TQFile::exists(sfPath2); + bool valid3 = TQFile::exists(sfPath3); bool usesf1 = ScanFolderPluginSettings::useFolder1() && valid1; bool usesf2 = ScanFolderPluginSettings::useFolder2() && valid2; @@ -180,7 +180,7 @@ namespace kt } - bool ScanFolderPlugin::versionCheck(const QString & version) const + bool ScanFolderPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/scanfolder/scanfolderplugin.h b/plugins/scanfolder/scanfolderplugin.h index 2ef50c1..64f2f5b 100644 --- a/plugins/scanfolder/scanfolderplugin.h +++ b/plugins/scanfolder/scanfolderplugin.h @@ -22,7 +22,7 @@ #include <interfaces/plugin.h> -class QString; +class TQString; namespace kt @@ -38,13 +38,14 @@ namespace kt class ScanFolderPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - ScanFolderPlugin(QObject* parent, const char* name, const QStringList& args); + ScanFolderPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~ScanFolderPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; void updateScanFolders(); diff --git a/plugins/scanfolder/scanfolderprefpage.cpp b/plugins/scanfolder/scanfolderprefpage.cpp index 9abbf0d..f5a462b 100644 --- a/plugins/scanfolder/scanfolderprefpage.cpp +++ b/plugins/scanfolder/scanfolderprefpage.cpp @@ -49,9 +49,9 @@ namespace kt return true; } - void ScanFolderPrefPage::createWidget(QWidget* parent) + void ScanFolderPrefPage::createWidget(TQWidget* tqparent) { - m_widget = new ScanFolderPrefPageWidget(parent); + m_widget = new ScanFolderPrefPageWidget(tqparent); } void ScanFolderPrefPage::updateData() diff --git a/plugins/scanfolder/scanfolderprefpage.h b/plugins/scanfolder/scanfolderprefpage.h index 539a5fe..e09210b 100644 --- a/plugins/scanfolder/scanfolderprefpage.h +++ b/plugins/scanfolder/scanfolderprefpage.h @@ -39,7 +39,7 @@ namespace kt virtual ~ScanFolderPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/scanfolder/scanfolderprefpagewidget.cpp b/plugins/scanfolder/scanfolderprefpagewidget.cpp index b577a88..b1a6125 100644 --- a/plugins/scanfolder/scanfolderprefpagewidget.cpp +++ b/plugins/scanfolder/scanfolderprefpagewidget.cpp @@ -20,10 +20,10 @@ #include "scanfolderprefpagewidget.h" #include "scanfolderpluginsettings.h" -#include <qwidget.h> -#include <qstring.h> -#include <qcheckbox.h> -#include <qfile.h> +#include <tqwidget.h> +#include <tqstring.h> +#include <tqcheckbox.h> +#include <tqfile.h> #include <kglobal.h> #include <klocale.h> @@ -32,8 +32,8 @@ namespace kt { - ScanFolderPrefPageWidget::ScanFolderPrefPageWidget(QWidget *parent, const char *name) - :SfPrefPageWidgetBase(parent, name) + ScanFolderPrefPageWidget::ScanFolderPrefPageWidget(TQWidget *tqparent, const char *name) + :SfPrefPageWidgetBase(tqparent, name) { use1->setChecked(ScanFolderPluginSettings::useFolder1()); use2->setChecked(ScanFolderPluginSettings::useFolder2()); @@ -58,9 +58,9 @@ namespace kt bool usesf2 = use2->isChecked(); bool usesf3 = use3->isChecked(); - QString sfPath1 = url1->url(); - QString sfPath2 = url2->url(); - QString sfPath3 = url3->url(); + TQString sfPath1 = url1->url(); + TQString sfPath2 = url2->url(); + TQString sfPath3 = url3->url(); bool silently = openSilently->isChecked(); bool deleteChecked = deleteCheck->isChecked(); @@ -70,26 +70,26 @@ namespace kt ScanFolderPluginSettings::setActionDelete(deleteChecked); ScanFolderPluginSettings::setActionMove(moveChecked); - QString message = i18n( "ScanFolder - Folder %1: Invalid URL or folder does not exist. Please, choose a valid directory." ); - if(!QFile::exists(sfPath1) && usesf1) + TQString message = i18n( "ScanFolder - Folder %1: Invalid URL or folder does not exist. Please, choose a valid directory." ); + if(!TQFile::exists(sfPath1) && usesf1) { - KMessageBox::sorry(0, message.arg( 1 ) ); + KMessageBox::sorry(0, message.tqarg( 1 ) ); usesf1 = false; } else ScanFolderPluginSettings::setFolder1(sfPath1); - if(!QFile::exists(sfPath2) && usesf2) + if(!TQFile::exists(sfPath2) && usesf2) { - KMessageBox::sorry(0, message.arg( 2 ) ); + KMessageBox::sorry(0, message.tqarg( 2 ) ); usesf2 = false; } else ScanFolderPluginSettings::setFolder2(sfPath2); - if(!QFile::exists(sfPath3) && usesf3) + if(!TQFile::exists(sfPath3) && usesf3) { - KMessageBox::sorry(0, message.arg( 3 ) ); + KMessageBox::sorry(0, message.tqarg( 3 ) ); usesf3 = false; } else diff --git a/plugins/scanfolder/scanfolderprefpagewidget.h b/plugins/scanfolder/scanfolderprefpagewidget.h index 480b3b0..6419e1c 100644 --- a/plugins/scanfolder/scanfolderprefpagewidget.h +++ b/plugins/scanfolder/scanfolderprefpagewidget.h @@ -27,8 +27,9 @@ namespace kt class ScanFolderPrefPageWidget: public SfPrefPageWidgetBase { Q_OBJECT + TQ_OBJECT public: - ScanFolderPrefPageWidget(QWidget *parent = 0, const char *name = 0); + ScanFolderPrefPageWidget(TQWidget *tqparent = 0, const char *name = 0); void apply(); }; diff --git a/plugins/scanfolder/sfprefwidgetbase.ui b/plugins/scanfolder/sfprefwidgetbase.ui index 8b2c83a..a6263be 100644 --- a/plugins/scanfolder/sfprefwidgetbase.ui +++ b/plugins/scanfolder/sfprefwidgetbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SfPrefPageWidgetBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SfPrefPageWidgetBase</cstring> </property> @@ -19,15 +19,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout16</cstring> + <cstring>tqlayout16</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>use1</cstring> </property> @@ -38,7 +38,7 @@ <string>Alt+1</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>use2</cstring> </property> @@ -49,7 +49,7 @@ <string>Alt+2</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>use3</cstring> </property> @@ -62,7 +62,7 @@ </widget> </vbox> </widget> - <widget class="QButtonGroup" row="3" column="0"> + <widget class="TQButtonGroup" row="3" column="0"> <property name="name"> <cstring>buttonGroup1</cstring> </property> @@ -73,7 +73,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="2" column="0"> + <widget class="TQCheckBox" row="2" column="0"> <property name="name"> <cstring>moveCheck</cstring> </property> @@ -84,7 +84,7 @@ <string>Move torrent to "loaded" directory after loading it</string> </property> </widget> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>openSilently</cstring> </property> @@ -95,7 +95,7 @@ <string>Do not show 'Select files to download' dialog</string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>deleteCheck</cstring> </property> @@ -108,7 +108,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="2" column="0"> + <widget class="TQGroupBox" row="2" column="0"> <property name="name"> <cstring>groupBox9</cstring> </property> @@ -143,7 +143,7 @@ <bool>false</bool> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -154,7 +154,7 @@ <cstring>kURLRequester1</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -165,7 +165,7 @@ <cstring>kURLRequester4</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -188,7 +188,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -205,7 +205,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>90</height> @@ -257,7 +257,7 @@ <tabstop>deleteCheck</tabstop> <tabstop>moveCheck</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> diff --git a/plugins/scheduler/bwscheduler.cpp b/plugins/scheduler/bwscheduler.cpp index 56375b5..a669360 100644 --- a/plugins/scheduler/bwscheduler.cpp +++ b/plugins/scheduler/bwscheduler.cpp @@ -31,9 +31,9 @@ #include <util/constants.h> #include <util/log.h> -#include <qdatetime.h> -#include <qfile.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqptrlist.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -160,9 +160,9 @@ namespace kt if(!m_enabled) return; - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); - QString prefix = QString("BWS: %1 :: ").arg(now.toString()); + TQString prefix = TQString("BWS: %1 :: ").tqarg(now.toString()); int t1 = now.date().dayOfWeek(); int t2 = now.time().hour(); @@ -172,8 +172,8 @@ namespace kt { case CAT_NORMAL: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to NORMAL category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_core->getMaxUploadSpeed()).arg(m_core->getMaxDownloadSpeed()) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_core->getMaxUploadSpeed()).tqarg(m_core->getMaxDownloadSpeed()) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -182,8 +182,8 @@ namespace kt break; case CAT_FIRST: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to FIRST category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(0)).arg(m_schedule.getDownload(0)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(0)).tqarg(m_schedule.getDownload(0)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -192,8 +192,8 @@ namespace kt break; case CAT_SECOND: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to SECOND category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(1)).arg(m_schedule.getDownload(1)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(1)).tqarg(m_schedule.getDownload(1)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -202,8 +202,8 @@ namespace kt break; case CAT_THIRD: Out(SYS_SCD|LOG_NOTICE) << prefix << "Switching to THIRD category" << endl; - Out(SYS_SCD|LOG_NOTICE) << prefix << QString("%1 Up, %2 Down") - .arg(m_schedule.getUpload(2)).arg(m_schedule.getDownload(2)) << endl; + Out(SYS_SCD|LOG_NOTICE) << prefix << TQString("%1 Up, %2 Down") + .tqarg(m_schedule.getUpload(2)).tqarg(m_schedule.getDownload(2)) << endl; if(!m_core) break; m_core->setPausedState(false); @@ -222,13 +222,13 @@ namespace kt void BWScheduler::loadSchedule() { - QFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); + TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); if(!file.exists()) return; file.open(IO_ReadOnly); - QDataStream stream(&file); + TQDataStream stream(&file); int tmp; @@ -256,10 +256,10 @@ namespace kt void BWScheduler::saveSchedule() { - QFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); + TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"); file.open(IO_WriteOnly); - QDataStream stream(&file); + TQDataStream stream(&file); for(int i=0; i<3; ++i) { diff --git a/plugins/scheduler/bwspage.ui b/plugins/scheduler/bwspage.ui index af0e771..c4fb9db 100644 --- a/plugins/scheduler/bwspage.ui +++ b/plugins/scheduler/bwspage.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>BWSPage</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>BWSPage</cstring> </property> @@ -12,13 +12,13 @@ <height>530</height> </rect> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>750</width> <height>540</height> @@ -34,15 +34,15 @@ <property name="resizeMode"> <enum>Fixed</enum> </property> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout21</cstring> + <cstring>tqlayout21</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroup1</cstring> </property> @@ -53,7 +53,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton" row="1" column="1"> + <widget class="TQRadioButton" row="1" column="1"> <property name="name"> <cstring>radio2</cstring> </property> @@ -61,7 +61,7 @@ <string>Categor&y 1</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>pix1</cstring> </property> @@ -73,7 +73,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -83,7 +83,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>pix2</cstring> </property> @@ -95,7 +95,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -105,7 +105,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>pix3</cstring> </property> @@ -117,7 +117,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -127,7 +127,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>pix5</cstring> </property> @@ -139,7 +139,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -149,7 +149,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton" row="4" column="1"> + <widget class="TQRadioButton" row="4" column="1"> <property name="name"> <cstring>radio5</cstring> </property> @@ -157,7 +157,7 @@ <string>T&urn off</string> </property> </widget> - <widget class="QRadioButton" row="0" column="1"> + <widget class="TQRadioButton" row="0" column="1"> <property name="name"> <cstring>radio1</cstring> </property> @@ -165,7 +165,7 @@ <string>&Normal</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>pix4</cstring> </property> @@ -177,7 +177,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -187,7 +187,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton" row="3" column="1"> + <widget class="TQRadioButton" row="3" column="1"> <property name="name"> <cstring>radio4</cstring> </property> @@ -198,7 +198,7 @@ <string>Alt+3</string> </property> </widget> - <widget class="QRadioButton" row="2" column="1"> + <widget class="TQRadioButton" row="2" column="1"> <property name="name"> <cstring>radio3</cstring> </property> @@ -211,7 +211,7 @@ </widget> </grid> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroup1_2</cstring> </property> @@ -222,7 +222,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton" row="1" column="1"> + <widget class="TQRadioButton" row="1" column="1"> <property name="name"> <cstring>radio22</cstring> </property> @@ -233,7 +233,7 @@ <string>Alt+1</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>pix12</cstring> </property> @@ -245,7 +245,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -255,7 +255,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>pix22</cstring> </property> @@ -267,7 +267,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -277,7 +277,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>pix32</cstring> </property> @@ -289,7 +289,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -299,7 +299,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>pix52</cstring> </property> @@ -311,7 +311,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -321,7 +321,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton" row="4" column="1"> + <widget class="TQRadioButton" row="4" column="1"> <property name="name"> <cstring>radio52</cstring> </property> @@ -329,7 +329,7 @@ <string>T&urn off</string> </property> </widget> - <widget class="QRadioButton" row="0" column="1"> + <widget class="TQRadioButton" row="0" column="1"> <property name="name"> <cstring>radio12</cstring> </property> @@ -337,7 +337,7 @@ <string>&Normal</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>pix42</cstring> </property> @@ -349,7 +349,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>15</height> @@ -359,7 +359,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton" row="3" column="1"> + <widget class="TQRadioButton" row="3" column="1"> <property name="name"> <cstring>radio42</cstring> </property> @@ -367,7 +367,7 @@ <string>&Category 3</string> </property> </widget> - <widget class="QRadioButton" row="2" column="1"> + <widget class="TQRadioButton" row="2" column="1"> <property name="name"> <cstring>radio32</cstring> </property> @@ -382,7 +382,7 @@ </widget> </hbox> </widget> - <widget class="QGroupBox" row="1" column="1"> + <widget class="TQGroupBox" row="1" column="1"> <property name="name"> <cstring>groupCategories_2</cstring> </property> @@ -393,7 +393,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel8_4</cstring> </property> @@ -401,7 +401,7 @@ <string><b>1. Category</b></string> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel8_3_2</cstring> </property> @@ -409,15 +409,15 @@ <string><b>3. Category</b></string> </property> </widget> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> - <cstring>layout8</cstring> + <cstring>tqlayout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_5</cstring> </property> @@ -433,7 +433,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_4_4</cstring> </property> @@ -449,7 +449,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel9_4</cstring> </property> @@ -459,15 +459,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="3" column="0"> + <widget class="TQLayoutWidget" row="3" column="0"> <property name="name"> - <cstring>layout9</cstring> + <cstring>tqlayout9</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_2_2</cstring> </property> @@ -483,7 +483,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_4_2_2</cstring> </property> @@ -499,7 +499,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel9_2_2</cstring> </property> @@ -509,15 +509,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="5" column="0"> + <widget class="TQLayoutWidget" row="5" column="0"> <property name="name"> - <cstring>layout10</cstring> + <cstring>tqlayout10</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_3_2</cstring> </property> @@ -533,7 +533,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel6_4_3_2</cstring> </property> @@ -549,7 +549,7 @@ <number>30000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel9_3_2</cstring> </property> @@ -559,7 +559,7 @@ </widget> </hbox> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel8_2_2</cstring> </property> @@ -581,36 +581,36 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>379</width> <height>510</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>379</width> <height>508</height> </size> </property> </widget> - <widget class="QLayoutWidget" row="2" column="1"> + <widget class="TQLayoutWidget" row="2" column="1"> <property name="name"> - <cstring>layout34</cstring> + <cstring>tqlayout34</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> - <cstring>lblStatus</cstring> + <cstring>lbltqStatus</cstring> </property> <property name="text"> <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel10</cstring> </property> @@ -625,7 +625,7 @@ <property name="text"> <string>* zero means no limit</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -641,24 +641,24 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="4" column="1"> + <widget class="TQLayoutWidget" row="4" column="1"> <property name="name"> - <cstring>layout32</cstring> + <cstring>tqlayout32</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout31</cstring> + <cstring>tqlayout31</cstring> </property> <vbox> <property name="name"> @@ -700,14 +700,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>36</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>pix_icon</cstring> </property> @@ -728,16 +728,16 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>35</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout29</cstring> + <cstring>tqlayout29</cstring> </property> <vbox> <property name="name"> @@ -850,15 +850,15 @@ <tabstop>dlCat3</tabstop> <tabstop>ulCat3</tabstop> </tabstops> -<slots> +<Q_SLOTS> <slot>btnOk_clicked()</slot> <slot>btnApply_clicked()</slot> <slot>btnCancel_clicked()</slot> <slot>btnSave_clicked()</slot> <slot>btnLoad_clicked()</slot> <slot>btnReset_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> diff --git a/plugins/scheduler/bwsprefpagewidget.cpp b/plugins/scheduler/bwsprefpagewidget.cpp index 0c44a43..96e0613 100644 --- a/plugins/scheduler/bwsprefpagewidget.cpp +++ b/plugins/scheduler/bwsprefpagewidget.cpp @@ -33,25 +33,25 @@ #include <kstdguiitem.h> #include <kpushbutton.h> -#include <qcombobox.h> -#include <qfile.h> -#include <qdatastream.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qradiobutton.h> +#include <tqcombobox.h> +#include <tqfile.h> +#include <tqdatastream.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> namespace kt { /* PREF PAGE WIDGET --------------------------------------------------------*/ - BWSPrefPageWidget::BWSPrefPageWidget(QWidget* parent, const char* name, WFlags fl) - : BWSPage(parent,name,fl) + BWSPrefPageWidget::BWSPrefPageWidget(TQWidget* tqparent, const char* name, WFlags fl) + : BWSPage(tqparent,name,fl) { loadDefault(); - lblStatus->clear(); + lbltqStatus->clear(); pix_icon->setPixmap(KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup)); @@ -67,42 +67,42 @@ namespace kt if(use_colors) //set up colors { - pix1->setPaletteBackgroundColor(QColor(30,165,105)); - pix2->setPaletteBackgroundColor(QColor(195,195,70)); - pix3->setPaletteBackgroundColor(QColor(195,195,70)); - pix4->setPaletteBackgroundColor(QColor(195,195,70)); - pix5->setPaletteBackgroundColor(QColor(190,30,30)); + pix1->setPaletteBackgroundColor(TQColor(30,165,105)); + pix2->setPaletteBackgroundColor(TQColor(195,195,70)); + pix3->setPaletteBackgroundColor(TQColor(195,195,70)); + pix4->setPaletteBackgroundColor(TQColor(195,195,70)); + pix5->setPaletteBackgroundColor(TQColor(190,30,30)); - pix12->setPaletteBackgroundColor(QColor(30,165,105)); - pix22->setPaletteBackgroundColor(QColor(195,195,70)); - pix32->setPaletteBackgroundColor(QColor(195,195,70)); - pix42->setPaletteBackgroundColor(QColor(195,195,70)); - pix52->setPaletteBackgroundColor(QColor(190,30,30)); + pix12->setPaletteBackgroundColor(TQColor(30,165,105)); + pix22->setPaletteBackgroundColor(TQColor(195,195,70)); + pix32->setPaletteBackgroundColor(TQColor(195,195,70)); + pix42->setPaletteBackgroundColor(TQColor(195,195,70)); + pix52->setPaletteBackgroundColor(TQColor(190,30,30)); } else //set up pixmaps { - pix1->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png")))); - pix2->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png")))); - pix3->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png")))); - pix4->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png")))); - pix5->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png")))); - - pix12->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png")))); - pix22->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png")))); - pix32->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png")))); - pix42->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png")))); - pix52->setPixmap(QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png")))); + pix1->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png")))); + pix2->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png")))); + pix3->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png")))); + pix4->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png")))); + pix5->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png")))); + + pix12->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png")))); + pix22->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png")))); + pix32->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png")))); + pix42->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png")))); + pix52->setPixmap(TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png")))); } - connect(radio1, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio2, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio3, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio4, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio5, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio12, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio22, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio32, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio42, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); - connect(radio52, SIGNAL(stateChanged(int)), this, SLOT(categoryChanged(int))); + connect(radio1, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio2, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio3, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio4, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio5, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio12, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio22, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio32, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio42, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); + connect(radio52, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(categoryChanged(int))); //pre-check default categories (say 1 for left and 0 for right) radio2->setChecked(true); @@ -116,7 +116,7 @@ namespace kt void BWSPrefPageWidget::btnSave_clicked() { - QString sf = KFileDialog::getSaveFileName("/home","*",this,i18n("Choose a filename to save under")); + TQString sf = KFileDialog::getSaveFileName("/home","*",this,i18n("Choose a filename to save under")); if(sf.isEmpty()) return; @@ -126,7 +126,7 @@ namespace kt void BWSPrefPageWidget::btnLoad_clicked() { - QString lf = KFileDialog::getOpenFileName("/home", "*",this,i18n("Choose a file")); + TQString lf = KFileDialog::getOpenFileName("/home", "*",this,i18n("Choose a file")); if(lf.isEmpty()) return; @@ -135,14 +135,14 @@ namespace kt loadSchedule(lf); } - void BWSPrefPageWidget::saveSchedule(QString& fn) + void BWSPrefPageWidget::saveSchedule(TQString& fn) { schedule = m_bwsWidget->schedule(); - QFile file(fn); + TQFile file(fn); file.open(IO_WriteOnly); - QDataStream stream(&file); + TQDataStream stream(&file); //First category stream << dlCat1->value(); @@ -162,12 +162,12 @@ namespace kt stream << (int) schedule.getCategory(i, j); file.close(); - lblStatus->setText(i18n("Schedule saved.")); + lbltqStatus->setText(i18n("Schedule saved.")); } - void BWSPrefPageWidget::loadSchedule(QString& fn, bool showmsg) + void BWSPrefPageWidget::loadSchedule(TQString& fn, bool showmsg) { - QFile file(fn); + TQFile file(fn); if(!file.exists()) { if(showmsg) @@ -176,7 +176,7 @@ namespace kt } file.open(IO_ReadOnly); - QDataStream stream(&file); + TQDataStream stream(&file); int tmp; @@ -205,13 +205,13 @@ namespace kt file.close(); m_bwsWidget->setSchedule(schedule); - lblStatus->setText(i18n("Schedule loaded.")); + lbltqStatus->setText(i18n("Schedule loaded.")); } void BWSPrefPageWidget::loadDefault() { //read schedule from HD - QString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"; + TQString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule"; loadSchedule(fn, false); } @@ -228,7 +228,7 @@ namespace kt ulCat2->setValue(0); ulCat3->setValue(0); - lblStatus->clear(); + lbltqStatus->clear(); } void BWSPrefPageWidget::apply() diff --git a/plugins/scheduler/bwsprefpagewidget.h b/plugins/scheduler/bwsprefpagewidget.h index ca0e80b..7529887 100644 --- a/plugins/scheduler/bwsprefpagewidget.h +++ b/plugins/scheduler/bwsprefpagewidget.h @@ -20,7 +20,7 @@ #ifndef KTBWSPREFPAGEWIDGET_H #define KTBWSPREFPAGEWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> #include "bwspage.h" #include "bwscheduler.h" @@ -34,8 +34,9 @@ namespace kt class BWSPrefPageWidget : public BWSPage { Q_OBJECT + TQ_OBJECT public: - BWSPrefPageWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + BWSPrefPageWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~BWSPrefPageWidget(); /*$PUBLIC_FUNCTIONS$*/ @@ -52,13 +53,13 @@ namespace kt * @ref BWSPrefPageWidget::btnLoad_clicked() * @ref BWSPrefPageWidget::loadDefault() */ - void loadSchedule(QString& fn, bool showmsg = true); + void loadSchedule(TQString& fn, bool showmsg = true); /** * Saves current schedule to HD. * @param fn Schedule filename. */ - void saveSchedule(QString& fn); + void saveSchedule(TQString& fn); public slots: diff --git a/plugins/scheduler/bwswidget.cpp b/plugins/scheduler/bwswidget.cpp index b430de3..4cfb3f4 100644 --- a/plugins/scheduler/bwswidget.cpp +++ b/plugins/scheduler/bwswidget.cpp @@ -21,26 +21,26 @@ #include "schedulerpluginsettings.h" #include <klocale.h> -#include <qstringlist.h> -#include <qpixmap.h> -#include <qtable.h> -#include <qpainter.h> -#include <qrect.h> -#include <qfont.h> -#include <qcolor.h> +#include <tqstringlist.h> +#include <tqpixmap.h> +#include <tqtable.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqfont.h> +#include <tqcolor.h> #include <kglobal.h> #include <kstandarddirs.h> namespace kt { - BWSWidget::BWSWidget(QWidget* parent, const char* name, bool useColors) - : QTable(parent,name), m_leftCategory(1), m_rightCategory(0), draw_focus(true), right_click(false), use_colors(useColors) + BWSWidget::BWSWidget(TQWidget* tqparent, const char* name, bool useColors) + : TQTable(tqparent,name), m_leftCategory(1), m_rightCategory(0), draw_focus(true), right_click(false), use_colors(useColors) { use_colors = SchedulerPluginSettings::useColors(); - QStringList days; - QStringList hours; + TQStringList days; + TQStringList hours; days << i18n("MON") << i18n("TUE") << i18n("WED") << i18n("THU") << i18n("FRI") << i18n("SAT") << i18n("SUN"); hours << @@ -63,9 +63,9 @@ namespace kt setColumnLabels(days); setRowLabels(hours); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); - QFont f; + TQFont f; f.setPointSize(8); setFont(f); @@ -96,13 +96,13 @@ namespace kt resetSchedule(); - setSelectionMode(QTable::NoSelection); + setSelectionMode(TQTable::NoSelection); - setHScrollBarMode(QTable::AlwaysOff); - setVScrollBarMode(QTable::AlwaysOff); + setHScrollBarMode(TQTable::AlwaysOff); + setVScrollBarMode(TQTable::AlwaysOff); - connect(this, SIGNAL(currentChanged( int, int )), this, SLOT(cellSelectionChanged( int, int ))); - connect(this, SIGNAL(pressed(int, int, int, const QPoint&)), this, SLOT(cellMouseDown(int, int, int, const QPoint& ))); + connect(this, TQT_SIGNAL(currentChanged( int, int )), this, TQT_SLOT(cellSelectionChanged( int, int ))); + connect(this, TQT_SIGNAL(pressed(int, int, int, const TQPoint&)), this, TQT_SLOT(cellMouseDown(int, int, int, const TQPoint& ))); } BWSWidget::~BWSWidget() @@ -115,7 +115,7 @@ namespace kt } } - void BWSWidget::paintFocus(QPainter* p, const QRect& cr) + void BWSWidget::paintFocus(TQPainter* p, const TQRect& cr) { int x = rowAt(cr.y()); int y = columnAt(cr.x()); @@ -146,12 +146,12 @@ namespace kt void BWSWidget::cellSelectionChanged(int row, int col) { if(right_click) - setText(row, col, QString::number(m_rightCategory)); + setText(row, col, TQString::number(m_rightCategory)); else - setText(row, col, QString::number(m_leftCategory)); + setText(row, col, TQString::number(m_leftCategory)); } - void BWSWidget::paintCell(QPainter* p, int row, int col, const QRect& cr, bool selected) + void BWSWidget::paintCell(TQPainter* p, int row, int col, const TQRect& cr, bool selected) { if(selected) return; @@ -161,8 +161,8 @@ namespace kt if((ok || cat == 0) && cat >= 0 && cat <= 4) drawCell(p, cat); else - setText(row,col,QString::number(0)); - // QTable::paintCell(p,row,col,cr,selected); + setText(row,col,TQString::number(0)); + // TQTable::paintCell(p,row,col,cr,selected); } void BWSWidget::resetSchedule() @@ -175,14 +175,14 @@ namespace kt updateHeaderStates(); } - void BWSWidget::repaintWidget() + void BWSWidget::tqrepaintWidget() { for(int i=0; i<7; ++i) for(int j=0; j<24; ++j) updateCell(j,i); } - void BWSWidget::cellMouseDown(int row, int col, int button, const QPoint& mousePos) + void BWSWidget::cellMouseDown(int row, int col, int button, const TQPoint& mousePos) { right_click = button == 2; draw_focus = true; @@ -194,7 +194,7 @@ namespace kt draw_focus = false; clearSelection(); updateHeaderStates(); - repaintWidget(); + tqrepaintWidget(); } void BWSWidget::setLeftCategory(const int& theValue) @@ -213,7 +213,7 @@ namespace kt use_colors = theValue; } - void BWSWidget::drawCell(QPainter* p, int category, bool focus) + void BWSWidget::drawCell(TQPainter* p, int category, bool focus) { if(use_colors) { if(focus) { @@ -224,15 +224,15 @@ namespace kt switch(category) { case 0: - // p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, "normalllll"); + // p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, "normalllll"); break; case 1: case 2: case 3: - p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, QString::number(category)); + p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, TQString::number(category)); break; case 4: - p->drawText(QRect(0,0,40,20), Qt::AlignCenter | Qt::SingleLine, "off"); + p->drawText(TQRect(0,0,40,20), TQt::AlignCenter | TQt::SingleLine, "off"); break; } @@ -258,17 +258,17 @@ namespace kt m_pixf[i] = 0; } - m_color[0] = new QColor(30,165,105); - m_color[1] = new QColor(195,195,70); - m_color[2] = new QColor(195,195,70); - m_color[3] = new QColor(195,195,70); - m_color[4] = new QColor(190,30,30); + m_color[0] = new TQColor(30,165,105); + m_color[1] = new TQColor(195,195,70); + m_color[2] = new TQColor(195,195,70); + m_color[3] = new TQColor(195,195,70); + m_color[4] = new TQColor(190,30,30); - m_colorf[0] = new QColor(40,200,130); - m_colorf[1] = new QColor(210,220,130); - m_colorf[2] = new QColor(210,220,130); - m_colorf[3] = new QColor(210,220,130); - m_colorf[4] = new QColor(230,40,40); + m_colorf[0] = new TQColor(40,200,130); + m_colorf[1] = new TQColor(210,220,130); + m_colorf[2] = new TQColor(210,220,130); + m_colorf[3] = new TQColor(210,220,130); + m_colorf[4] = new TQColor(230,40,40); } else { for(int i=0; i<5; ++i) { @@ -281,22 +281,22 @@ namespace kt m_colorf[i] = 0; } - m_pix[0] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0000.png"))); - m_pix[1] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0001.png"))); - m_pix[2] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0002.png"))); - m_pix[3] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0003.png"))); - m_pix[4] = new QPixmap(locate("data", QString("ktorrent/icons/cell-a-0004.png"))); - - m_pixf[0] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0000.png"))); - m_pixf[1] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0001.png"))); - m_pixf[2] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0002.png"))); - m_pixf[3] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0003.png"))); - m_pixf[4] = new QPixmap(locate("data", QString("ktorrent/icons/cell-b-0004.png"))); + m_pix[0] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0000.png"))); + m_pix[1] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0001.png"))); + m_pix[2] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0002.png"))); + m_pix[3] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0003.png"))); + m_pix[4] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-a-0004.png"))); + + m_pixf[0] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0000.png"))); + m_pixf[1] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0001.png"))); + m_pixf[2] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0002.png"))); + m_pixf[3] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0003.png"))); + m_pixf[4] = new TQPixmap(locate("data", TQString("ktorrent/icons/cell-b-0004.png"))); } use_colors = color; - repaintWidget(); + tqrepaintWidget(); } void BWSWidget::setSchedule(const BWS& theValue) @@ -304,7 +304,7 @@ namespace kt m_schedule = theValue; for(int i=0; i<7; ++i) for(int j=0; j<24; ++j) - setText(j,i, QString::number((int) m_schedule.getCategory(i,j))); + setText(j,i, TQString::number((int) m_schedule.getCategory(i,j))); } const BWS& BWSWidget::schedule() @@ -326,7 +326,7 @@ namespace kt return m_schedule; } - void BWSWidget::focusOutEvent(QFocusEvent* e) + void BWSWidget::focusOutEvent(TQFocusEvent* e) { if(e->lostFocus()) clearSelect(); diff --git a/plugins/scheduler/bwswidget.h b/plugins/scheduler/bwswidget.h index c035edb..bd0a94d 100644 --- a/plugins/scheduler/bwswidget.h +++ b/plugins/scheduler/bwswidget.h @@ -20,10 +20,10 @@ #ifndef KTBWSWIDGET_H #define KTBWSWIDGET_H -#include <qtable.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qcolor.h> +#include <tqtable.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqcolor.h> #include "bwscheduler.h" @@ -39,17 +39,18 @@ namespace kt /** * @brief Bandwidth scheduler widget. * @author Ivan Vasić <[email protected]> - * This class is a QTable with customized cells. It's used for bandwidth scheduling by painting each cell with mouse moves or keyboard. + * This class is a TQTable with customized cells. It's used for bandwidth scheduling by painting each cell with mouse moves or keyboard. */ - class BWSWidget : public QTable + class BWSWidget : public TQTable { Q_OBJECT + TQ_OBJECT public: - BWSWidget(QWidget* parent = 0, const char* name = 0, bool useColors = true); + BWSWidget(TQWidget* tqparent = 0, const char* name = 0, bool useColors = true); ~BWSWidget(); ///Repaints the whole widget - void repaintWidget(); + void tqrepaintWidget(); ///Clears selection (removes focus) void clearSelect(); @@ -77,19 +78,19 @@ namespace kt private slots: void cellSelectionChanged(int row, int col); - void cellMouseDown(int row, int col, int button, const QPoint& mousePos); + void cellMouseDown(int row, int col, int button, const TQPoint& mousePos); private: - void paintFocus(QPainter* p, const QRect& cr); - void paintCell(QPainter* p, int row, int col, const QRect& cr, bool selected); - void drawCell(QPainter* p, int category, bool focus = false); - void focusOutEvent(QFocusEvent*); + void paintFocus(TQPainter* p, const TQRect& cr); + void paintCell(TQPainter* p, int row, int col, const TQRect& cr, bool selected); + void drawCell(TQPainter* p, int category, bool focus = false); + void focusOutEvent(TQFocusEvent*); - QPixmap* m_pix[5]; - QPixmap* m_pixf[5]; + TQPixmap* m_pix[5]; + TQPixmap* m_pixf[5]; - QColor* m_color[5]; - QColor* m_colorf[5]; + TQColor* m_color[5]; + TQColor* m_colorf[5]; int m_leftCategory; int m_rightCategory; diff --git a/plugins/scheduler/schedulerpage.ui b/plugins/scheduler/schedulerpage.ui index 01a4f47..1a42edf 100644 --- a/plugins/scheduler/schedulerpage.ui +++ b/plugins/scheduler/schedulerpage.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SchedulerPage</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SchedulerPage</cstring> </property> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>useBS</cstring> </property> @@ -27,7 +27,7 @@ <string>Use &bandwidth scheduler?</string> </property> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupBWS</cstring> </property> @@ -38,7 +38,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>useColors</cstring> </property> @@ -46,7 +46,7 @@ <string>Use colors instead of pi&xmaps?</string> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -54,7 +54,7 @@ <string>(Recommended for slower systems)</string> </property> </widget> - <widget class="QPushButton" row="2" column="0"> + <widget class="TQPushButton" row="2" column="0"> <property name="name"> <cstring>btnEditBWS</cstring> </property> @@ -72,7 +72,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -89,7 +89,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>80</height> @@ -108,7 +108,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -137,10 +137,10 @@ <slot>useColors_toggled(bool)</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnEditBWS_toggled(bool)</slot> <slot>btnEditBWS_clicked()</slot> <slot>useColors_toggled(bool)</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/scheduler/schedulerplugin.cpp b/plugins/scheduler/schedulerplugin.cpp index 7639293..9177ebb 100644 --- a/plugins/scheduler/schedulerplugin.cpp +++ b/plugins/scheduler/schedulerplugin.cpp @@ -24,9 +24,9 @@ #include <util/constants.h> #include <util/log.h> -#include <qstring.h> -#include <qtimer.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqdatetime.h> #include <kmessagebox.h> #include <klocale.h> @@ -50,17 +50,17 @@ K_EXPORT_COMPONENT_FACTORY(ktschedulerplugin,KGenericFactory<kt::SchedulerPlugin namespace kt { - const QString NAME = "Bandwith Scheduler"; - const QString AUTHOR = "Ivan Vasic"; - const QString EMAIL = "[email protected]"; - const QString DESCRIPTION = i18n("Bandwidth scheduling plugin"); + const TQString NAME = "Bandwith Scheduler"; + const TQString AUTHOR = "Ivan Vasic"; + const TQString EMAIL = "[email protected]"; + const TQString DESCRIPTION = i18n("Bandwidth scheduling plugin"); - SchedulerPlugin::SchedulerPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Bandwidth Scheduler"),AUTHOR,EMAIL,DESCRIPTION, "clock") + SchedulerPlugin::SchedulerPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Bandwidth Scheduler"),AUTHOR,EMAIL,DESCRIPTION, "clock") { setXMLFile("ktschedulerpluginui.rc"); bws_action = 0; - connect(&m_timer, SIGNAL(timeout()), this, SLOT(timer_triggered())); + connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timer_triggered())); } @@ -74,17 +74,17 @@ namespace kt getGUI()->addPrefPage(Pref); BWScheduler::instance().setCoreInterface(getCore()); - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); //each hour - QDateTime hour = now.addSecs(3600); - QTime t(hour.time().hour(), 0); + TQDateTime hour = now.addSecs(3600); + TQTime t(hour.time().hour(), 0); //each minute -// QDateTime hour = now.addSecs(60); -// QTime t(hour.time().hour(), hour.time().minute()); +// TQDateTime hour = now.addSecs(60); +// TQTime t(hour.time().hour(), hour.time().minute()); - QDateTime round(hour.date(), t); + TQDateTime round(hour.date(), t); // add a 5 second safety margin (BUG: 131246) int secs_to = now.secsTo(round) + 5; @@ -95,7 +95,7 @@ namespace kt // updateEnabledBWS(); bws_action = new KAction(i18n("Open Bandwidth Scheduler" ), "clock", 0, this, - SLOT(openBWS()), actionCollection(), "bwscheduler" ); + TQT_SLOT(openBWS()), actionCollection(), "bwscheduler" ); } void SchedulerPlugin::unload() @@ -115,7 +115,7 @@ namespace kt void SchedulerPlugin::timer_triggered() { m_timer.changeInterval(3600*1000); - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::tqcurrentDateTime(); BWScheduler::instance().trigger(); } @@ -135,7 +135,7 @@ namespace kt if(SchedulerPluginSettings::enableBWS()) { bws_action = new KAction(i18n("Open Bandwidth Scheduler" ), "clock", 0, this, - SLOT(openBWS()), actionCollection(), "bwscheduler" ); + TQT_SLOT(openBWS()), actionCollection(), "bwscheduler" ); } else { @@ -145,7 +145,7 @@ namespace kt } } - bool SchedulerPlugin::versionCheck(const QString & version) const + bool SchedulerPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/scheduler/schedulerplugin.h b/plugins/scheduler/schedulerplugin.h index 6828d0d..96dad21 100644 --- a/plugins/scheduler/schedulerplugin.h +++ b/plugins/scheduler/schedulerplugin.h @@ -24,11 +24,11 @@ #include "schedulerprefpage.h" -#include <qtimer.h> +#include <tqtimer.h> #include <kstdaction.h> -class QString; +class TQString; namespace kt @@ -43,13 +43,14 @@ namespace kt class SchedulerPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - SchedulerPlugin(QObject* parent, const char* name, const QStringList& args); + SchedulerPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~SchedulerPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; void updateEnabledBWS(); @@ -58,7 +59,7 @@ namespace kt void openBWS(); private: - QTimer m_timer; + TQTimer m_timer; /* BANDWIDTH SCHEDULE PLUGIN */ SchedulerPrefPage* Pref; diff --git a/plugins/scheduler/schedulerprefpage.cpp b/plugins/scheduler/schedulerprefpage.cpp index fe82f34..076fb5c 100644 --- a/plugins/scheduler/schedulerprefpage.cpp +++ b/plugins/scheduler/schedulerprefpage.cpp @@ -48,9 +48,9 @@ namespace kt return true; } - void SchedulerPrefPage::createWidget( QWidget * parent ) + void SchedulerPrefPage::createWidget( TQWidget * tqparent ) { - widget = new SchedulerPrefPageWidget(parent); + widget = new SchedulerPrefPageWidget(tqparent); } void SchedulerPrefPage::updateData() diff --git a/plugins/scheduler/schedulerprefpage.h b/plugins/scheduler/schedulerprefpage.h index a10a98a..a2efa21 100644 --- a/plugins/scheduler/schedulerprefpage.h +++ b/plugins/scheduler/schedulerprefpage.h @@ -40,7 +40,7 @@ namespace kt virtual ~SchedulerPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/scheduler/schedulerprefpagewidget.cpp b/plugins/scheduler/schedulerprefpagewidget.cpp index d6e73dd..ad12e73 100644 --- a/plugins/scheduler/schedulerprefpagewidget.cpp +++ b/plugins/scheduler/schedulerprefpagewidget.cpp @@ -22,16 +22,16 @@ #include "bwscheduler.h" #include "schedulerpluginsettings.h" -#include <qcheckbox.h> -#include <qtimer.h> -#include <qpushbutton.h> -#include <qgroupbox.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> namespace kt { - SchedulerPrefPageWidget::SchedulerPrefPageWidget(QWidget* parent, const char* name, WFlags fl) - : SchedulerPage(parent,name,fl) + SchedulerPrefPageWidget::SchedulerPrefPageWidget(TQWidget* tqparent, const char* name, WFlags fl) + : SchedulerPage(tqparent,name,fl) { groupBWS->setEnabled(false); bool useit = SchedulerPluginSettings::enableBWS(); @@ -59,9 +59,9 @@ namespace kt SchedulerPluginSettings::writeConfig(); /* force trigger since the schedule has changed but after KTorrent::apply() - * Used QTimer with fixed interval - not very nice solution... */ + * Used TQTimer with fixed interval - not very nice solution... */ if(useBS->isChecked()) - QTimer::singleShot(1000, this, SLOT(scheduler_trigger())); + TQTimer::singleShot(1000, this, TQT_SLOT(scheduler_trigger())); BWScheduler::instance().setEnabled(use_bws); } diff --git a/plugins/scheduler/schedulerprefpagewidget.h b/plugins/scheduler/schedulerprefpagewidget.h index 9f62c20..5274f3d 100644 --- a/plugins/scheduler/schedulerprefpagewidget.h +++ b/plugins/scheduler/schedulerprefpagewidget.h @@ -20,7 +20,7 @@ #ifndef KTSCHEDULERPREFPAGEWIDGET_H #define KTSCHEDULERPREFPAGEWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> #include "schedulerpage.h" namespace kt @@ -32,8 +32,9 @@ namespace kt class SchedulerPrefPageWidget : public SchedulerPage { Q_OBJECT + TQ_OBJECT public: - SchedulerPrefPageWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + SchedulerPrefPageWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~SchedulerPrefPageWidget(); diff --git a/plugins/search/htmlpart.cpp b/plugins/search/htmlpart.cpp index b1c6b23..00d5326 100644 --- a/plugins/search/htmlpart.cpp +++ b/plugins/search/htmlpart.cpp @@ -20,9 +20,9 @@ #include <kmessagebox.h> #include <kio/job.h> #include <kio/jobclasses.h> -//#include <qfile.h> -#include <qclipboard.h> -#include <qapplication.h> +//#include <tqfile.h> +#include <tqclipboard.h> +#include <tqapplication.h> #include <kio/netaccess.h> #include <klocale.h> #include <kfiledialog.h> @@ -36,8 +36,8 @@ using namespace bt; namespace kt { - HTMLPart::HTMLPart(QWidget *parent) - : KHTMLPart(parent) + HTMLPart::HTMLPart(TQWidget *tqparent) + : KHTMLPart(tqparent) { setJScriptEnabled(true); setJavaEnabled(true); @@ -45,8 +45,8 @@ namespace kt setPluginsEnabled(false); setStatusMessagesEnabled(false); KParts::BrowserExtension* ext = this->browserExtension(); - connect(ext,SIGNAL(openURLRequest(const KURL&,const KParts::URLArgs&)), - this,SLOT(openURLRequest(const KURL&, const KParts::URLArgs& ))); + connect(ext,TQT_SIGNAL(openURLRequest(const KURL&,const KParts::URLArgs&)), + this,TQT_SLOT(openURLRequest(const KURL&, const KParts::URLArgs& ))); ext->enableAction("copy",true); ext->enableAction("paste",true); @@ -59,11 +59,11 @@ namespace kt void HTMLPart::copy() { - QString txt = selectedText(); - QClipboard *cb = QApplication::clipboard(); + TQString txt = selectedText(); + TQClipboard *cb = TQApplication::tqclipboard(); // Copy text into the clipboard if (cb) - cb->setText(txt,QClipboard::Clipboard); + cb->setText(txt,TQClipboard::Clipboard); } void HTMLPart::openURLRequest(const KURL &u,const KParts::URLArgs &) @@ -75,15 +75,15 @@ namespace kt } KIO::TransferJob* j = KIO::get(u,false,false); - connect(j,SIGNAL(data(KIO::Job*,const QByteArray &)), - this,SLOT(dataRecieved(KIO::Job*, const QByteArray& ))); - connect(j,SIGNAL(result(KIO::Job*)),this,SLOT(jobDone(KIO::Job* ))); - connect(j,SIGNAL(mimetype(KIO::Job*, const QString &)), - this,SLOT(mimetype(KIO::Job*, const QString& ))); + connect(j,TQT_SIGNAL(data(KIO::Job*,const TQByteArray &)), + this,TQT_SLOT(dataRecieved(KIO::Job*, const TQByteArray& ))); + connect(j,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(jobDone(KIO::Job* ))); + connect(j,TQT_SIGNAL(mimetype(KIO::Job*, const TQString &)), + this,TQT_SLOT(mimetype(KIO::Job*, const TQString& ))); active_job = j; curr_data.resize(0); - mime_type = QString::null; + mime_type = TQString(); curr_url = u; } @@ -115,7 +115,7 @@ namespace kt openURL(url()); } - void HTMLPart::dataRecieved(KIO::Job* job,const QByteArray & data) + void HTMLPart::dataRecieved(KIO::Job* job,const TQByteArray & data) { if (job != active_job) { @@ -134,7 +134,7 @@ namespace kt } } - void HTMLPart::mimetype(KIO::Job* job,const QString & mt) + void HTMLPart::mimetype(KIO::Job* job,const TQString & mt) { if (job != active_job) { @@ -191,7 +191,7 @@ namespace kt active_job = 0; curr_data.resize(0); curr_url = KURL(); - mime_type = QString::null; + mime_type = TQString(); } } diff --git a/plugins/search/htmlpart.h b/plugins/search/htmlpart.h index f5b78ee..8b400dc 100644 --- a/plugins/search/htmlpart.h +++ b/plugins/search/htmlpart.h @@ -37,8 +37,9 @@ namespace kt class HTMLPart : public KHTMLPart { Q_OBJECT + TQ_OBJECT public: - HTMLPart(QWidget *parent = 0); + HTMLPart(TQWidget *tqparent = 0); virtual ~HTMLPart(); public slots: @@ -49,8 +50,8 @@ namespace kt private slots: void addToHistory(const KURL & url); - void dataRecieved(KIO::Job* job,const QByteArray & data); - void mimetype(KIO::Job* job,const QString & mt); + void dataRecieved(KIO::Job* job,const TQByteArray & data); + void mimetype(KIO::Job* job,const TQString & mt); void jobDone(KIO::Job* job); @@ -63,8 +64,8 @@ namespace kt private: KURL::List history; KIO::Job* active_job; - QByteArray curr_data; - QString mime_type; + TQByteArray curr_data; + TQString mime_type; KURL curr_url; }; } diff --git a/plugins/search/searchbar.ui b/plugins/search/searchbar.ui index 2b91ea0..a0e0db0 100644 --- a/plugins/search/searchbar.ui +++ b/plugins/search/searchbar.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SearchBar</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SearchBar</cstring> </property> @@ -63,14 +63,14 @@ <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>60</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -87,7 +87,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/plugins/search/searchenginelist.cpp b/plugins/search/searchenginelist.cpp index cf7a11b..9e22990 100644 --- a/plugins/search/searchenginelist.cpp +++ b/plugins/search/searchenginelist.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstringlist.h> #include "searchenginelist.h" using namespace bt; @@ -34,36 +34,36 @@ namespace kt SearchEngineList::~SearchEngineList() {} - void SearchEngineList::save(const QString& file) + void SearchEngineList::save(const TQString& file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "# PLEASE DO NOT MODIFY THIS FILE. Use KTorrent configuration dialog for adding new search engines." << ::endl; out << "# SEARCH ENGINES list" << ::endl; - QValueList<SearchEngine>::iterator i = m_search_engines.begin(); + TQValueList<SearchEngine>::iterator i = m_search_engines.begin(); while (i != m_search_engines.end()) { SearchEngine & e = *i; // replace spaces by %20 - QString name = e.name; - name = name.replace(" ","%20"); - QString u = e.url.prettyURL(); - u = u.replace(" ","%20"); + TQString name = e.name; + name = name.tqreplace(" ","%20"); + TQString u = e.url.prettyURL(); + u = u.tqreplace(" ","%20"); out << name << " " << u << ::endl; i++; } } - void SearchEngineList::load(const QString& file) + void SearchEngineList::load(const TQString& file) { m_search_engines.clear(); - QFile fptr(file); + TQFile fptr(file); if(!fptr.exists()) makeDefaultFile(file); @@ -71,21 +71,21 @@ namespace kt if (!fptr.open(IO_ReadOnly)) return; - QTextStream in(&fptr); + TQTextStream in(&fptr); int id = 0; while (!in.atEnd()) { - QString line = in.readLine(); + TQString line = in.readLine(); if(line.startsWith("#") || line.startsWith(" ") || line.isEmpty() ) continue; - QStringList tokens = QStringList::split(" ", line); + TQStringList tokens = TQStringList::split(" ", line); SearchEngine se; se.name = tokens[0]; - se.name = se.name.replace("%20"," "); + se.name = se.name.tqreplace("%20"," "); se.url = KURL::fromPathOrURL(tokens[1]); for(Uint32 i=2; i<tokens.count(); ++i) @@ -95,13 +95,13 @@ namespace kt } } - void SearchEngineList::makeDefaultFile(const QString& file) + void SearchEngineList::makeDefaultFile(const TQString& file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "# PLEASE DO NOT MODIFY THIS FILE. Use KTorrent configuration dialog for adding new search engines." << ::endl; out << "# SEARCH ENGINES list" << ::endl; out << "KTorrents http://www.ktorrents.com/search.php?lg=0&sourceid=ktorrent&q=FOOBAR&f=0" << ::endl; @@ -123,10 +123,10 @@ namespace kt return m_search_engines[engine].url; } - QString SearchEngineList::getEngineName(bt::Uint32 engine) const + TQString SearchEngineList::getEngineName(bt::Uint32 engine) const { if (engine >= m_search_engines.count()) - return QString::null; + return TQString(); else return m_search_engines[engine].name; } diff --git a/plugins/search/searchenginelist.h b/plugins/search/searchenginelist.h index 236b8eb..4b4d68e 100644 --- a/plugins/search/searchenginelist.h +++ b/plugins/search/searchenginelist.h @@ -21,7 +21,7 @@ #define KTSEARCHENGINELIST_H #include <kurl.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <util/constants.h> namespace kt @@ -35,21 +35,21 @@ namespace kt { struct SearchEngine { - QString name; + TQString name; KURL url; }; - QValueList<SearchEngine> m_search_engines; + TQValueList<SearchEngine> m_search_engines; public: SearchEngineList(); virtual ~SearchEngineList(); - void save(const QString& file); - void load(const QString& file); - void makeDefaultFile(const QString& file); + void save(const TQString& file); + void load(const TQString& file); + void makeDefaultFile(const TQString& file); KURL getSearchURL(bt::Uint32 engine) const; - QString getEngineName(bt::Uint32 engine) const; + TQString getEngineName(bt::Uint32 engine) const; /// Get the number of engines bt::Uint32 getNumEngines() const {return m_search_engines.count();} diff --git a/plugins/search/searchplugin.cpp b/plugins/search/searchplugin.cpp index c674369..8638dfe 100644 --- a/plugins/search/searchplugin.cpp +++ b/plugins/search/searchplugin.cpp @@ -46,8 +46,8 @@ K_EXPORT_COMPONENT_FACTORY(ktsearchplugin,KGenericFactory<kt::SearchPlugin>("kts namespace kt { - SearchPlugin::SearchPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Search"),AUTHOR,EMAIL, + SearchPlugin::SearchPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Search"),AUTHOR,EMAIL, i18n("Search for torrents on several popular torrent search engines"),"viewmag") { // setXMLFile("ktsearchpluginui.rc"); @@ -65,8 +65,8 @@ namespace kt engines.load(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines"); KToolBar* tb = getGUI()->addToolBar("search"); tab = new SearchTab(tb); - connect(tab,SIGNAL(search( const QString&, int, bool )), - this,SLOT(search( const QString&, int, bool ))); + connect(tab,TQT_SIGNAL(search( const TQString&, int, bool )), + this,TQT_SLOT(search( const TQString&, int, bool ))); pref = new SearchPrefPage(this); getGUI()->addPrefPage(pref); @@ -92,7 +92,7 @@ namespace kt tab = 0; } - void SearchPlugin::search(const QString & text,int engine,bool external) + void SearchPlugin::search(const TQString & text,int engine,bool external) { if(external) { @@ -101,14 +101,14 @@ namespace kt if (engine < 0 || engine >= sl.getNumEngines()) engine = 0; - QString s_url = sl.getSearchURL(engine).prettyURL(); - s_url.replace("FOOBAR", KURL::encode_string(text), true); + TQString s_url = sl.getSearchURL(engine).prettyURL(); + s_url.tqreplace("FOOBAR", KURL::encode_string(text), true); KURL url = KURL::fromPathOrURL(s_url); if(SearchPluginSettings::useDefaultBrowser()) kapp->invokeBrowser(url.url()); else - KRun::runCommand(QString("%1 \"%2\"").arg(SearchPluginSettings::customBrowser()).arg(url.url()), SearchPluginSettings::customBrowser(), "viewmag" ); + KRun::runCommand(TQString("%1 \"%2\"").tqarg(SearchPluginSettings::customBrowser()).tqarg(url.url()), SearchPluginSettings::customBrowser(), "viewmag" ); return; } @@ -118,7 +118,7 @@ namespace kt SearchWidget* search = new SearchWidget(this); getGUI()->addTabPage(search,iload->loadIconSet("viewmag", KIcon::Small),text,this); - KAction* copy_act = KStdAction::copy(search,SLOT(copy()),actionCollection()); + KAction* copy_act = KStdAction::copy(TQT_TQOBJECT(search),TQT_SLOT(copy()),actionCollection()); copy_act->plug(search->rightClickMenu(),0); searches.append(search); @@ -132,16 +132,16 @@ namespace kt if (tab) tab->updateSearchEngines(engines); - for (QPtrList<SearchWidget>::iterator i = searches.begin(); i != searches.end();i++) + for (TQPtrList<SearchWidget>::iterator i = searches.begin(); i != searches.end();i++) { SearchWidget* w = *i; w->updateSearchEngines(engines); } } - void SearchPlugin::tabCloseRequest(kt::GUIInterface* gui,QWidget* tab) + void SearchPlugin::tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab) { - if (searches.contains((SearchWidget*)tab)) + if (searches.tqcontains((SearchWidget*)tab)) { searches.remove((SearchWidget*)tab); gui->removeTabPage(tab); @@ -149,7 +149,7 @@ namespace kt } } - bool SearchPlugin::versionCheck(const QString & version) const + bool SearchPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/search/searchplugin.h b/plugins/search/searchplugin.h index ce65499..9bfbb0b 100644 --- a/plugins/search/searchplugin.h +++ b/plugins/search/searchplugin.h @@ -20,7 +20,7 @@ #ifndef KTSEARCHPLUGIN_H #define KTSEARCHPLUGIN_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <interfaces/plugin.h> #include <interfaces/guiinterface.h> #include "searchenginelist.h" @@ -37,28 +37,29 @@ namespace kt class SearchPlugin : public Plugin, public kt::CloseTabListener { Q_OBJECT + TQ_OBJECT public: - SearchPlugin(QObject* parent, const char* name, const QStringList& args); + SearchPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~SearchPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; void preferencesUpdated(); const SearchEngineList & getSearchEngineList() const {return engines;} private slots: - void search(const QString & text,int engine,bool external); + void search(const TQString & text,int engine,bool external); private: - virtual void tabCloseRequest(kt::GUIInterface* gui,QWidget* tab); + virtual void tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab); private: SearchPrefPage* pref; SearchTab* tab; SearchEngineList engines; - QPtrList<SearchWidget> searches; + TQPtrList<SearchWidget> searches; }; } diff --git a/plugins/search/searchpref.ui b/plugins/search/searchpref.ui index 8c8c026..5e68f1e 100644 --- a/plugins/search/searchpref.ui +++ b/plugins/search/searchpref.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SEPreferences</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SEPreferences</cstring> </property> @@ -20,7 +20,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>500</width> <height>350</height> @@ -33,7 +33,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroup1</cstring> </property> @@ -44,7 +44,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>openExternal</cstring> </property> @@ -52,7 +52,7 @@ <string>Open searches in external browser</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>useDefaultBrowser</cstring> </property> @@ -63,15 +63,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout29</cstring> + <cstring>tqlayout29</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>useCustomBrowser</cstring> </property> @@ -97,7 +97,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> @@ -108,7 +108,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox8</cstring> </property> @@ -127,15 +127,15 @@ <string></string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout22</cstring> + <cstring>tqlayout22</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -150,15 +150,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout23</cstring> + <cstring>tqlayout23</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -171,7 +171,7 @@ <cstring>m_engine_url</cstring> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnAdd</cstring> </property> @@ -189,7 +189,7 @@ </widget> </hbox> </widget> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Engines</string> @@ -223,7 +223,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>50</height> @@ -233,15 +233,15 @@ <enum>AllColumns</enum> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnRemove</cstring> </property> @@ -249,7 +249,7 @@ <string>&Remove</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btnRemoveAll</cstring> </property> @@ -267,14 +267,14 @@ <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>btn_add_default</cstring> </property> @@ -306,10 +306,10 @@ <slot>btnUpdate_clicked()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnUpdate_clicked()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klineedit.h</includehint> <includehint>kactivelabel.h</includehint> diff --git a/plugins/search/searchprefpage.cpp b/plugins/search/searchprefpage.cpp index 2285ead..e7ee9c3 100644 --- a/plugins/search/searchprefpage.cpp +++ b/plugins/search/searchprefpage.cpp @@ -19,8 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <kurl.h> -#include <qtooltip.h> -#include <qfile.h> +#include <tqtooltip.h> +#include <tqfile.h> #include <klocale.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -33,9 +33,9 @@ #include <kio/netaccess.h> #include <klineedit.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qradiobutton.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> #include <util/constants.h> #include "searchprefpage.h" @@ -47,25 +47,25 @@ using namespace bt; namespace kt { - SearchPrefPageWidget::SearchPrefPageWidget(QWidget *parent) : SEPreferences(parent) + SearchPrefPageWidget::SearchPrefPageWidget(TQWidget *tqparent) : SEPreferences(tqparent) { - QString info = i18n("Use your web browser to search for the string %1" + TQString info = i18n("Use your web browser to search for the string %1" " (capital letters) on the search engine you want to add. <br> " "Then copy the URL in the addressbar after the search is finished, and paste it here.<br><br>Searching for %1" " on Google for example, will result in http://www.google.com/search?q=FOOBAR&ie=UTF-8&oe=UTF-8. <br> " - "If you add this URL here, ktorrent can search using Google.").arg("FOOBAR").arg("FOOBAR"); - QString info_short = i18n("Use your web browser to search for the string %1 (capital letters) " - "on the search engine you want to add. Use the resulting URL below.").arg("FOOBAR"); + "If you add this URL here, ktorrent can search using Google.").tqarg("FOOBAR").tqarg("FOOBAR"); + TQString info_short = i18n("Use your web browser to search for the string %1 (capital letters) " + "on the search engine you want to add. Use the resulting URL below.").tqarg("FOOBAR"); m_infoLabel->setText(info_short); - QToolTip::add(m_infoLabel,info); - QToolTip::add(m_engine_name,info); + TQToolTip::add(m_infoLabel,info); + TQToolTip::add(m_engine_name,info); - connect(btnAdd, SIGNAL(clicked()), this, SLOT(addClicked())); - connect(btnRemove, SIGNAL(clicked()), this, SLOT(removeClicked())); - connect(btn_add_default, SIGNAL(clicked()), this, SLOT(addDefaultClicked())); - connect(btnRemoveAll, SIGNAL(clicked()), this, SLOT(removeAllClicked())); + connect(btnAdd, TQT_SIGNAL(clicked()), this, TQT_SLOT(addClicked())); + connect(btnRemove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeClicked())); + connect(btn_add_default, TQT_SIGNAL(clicked()), this, TQT_SLOT(addDefaultClicked())); + connect(btnRemoveAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeAllClicked())); - connect(useCustomBrowser, SIGNAL(toggled(bool)), this, SLOT(customToggled( bool ))); + connect(useCustomBrowser, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(customToggled( bool ))); useCustomBrowser->setChecked(SearchPluginSettings::useCustomBrowser()); useDefaultBrowser->setChecked(SearchPluginSettings::useDefaultBrowser()); @@ -81,7 +81,7 @@ namespace kt for (Uint32 i = 0;i < se.getNumEngines();i++) { - new QListViewItem(m_engines,se.getEngineName(i),se.getSearchURL(i).prettyURL()); + new TQListViewItem(m_engines,se.getEngineName(i),se.getSearchURL(i).prettyURL()); } } @@ -99,20 +99,20 @@ namespace kt void SearchPrefPageWidget::saveSearchEngines() { - QFile fptr(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines"); + TQFile fptr(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines"); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); out << "# PLEASE DO NOT MODIFY THIS FILE. Use KTorrent configuration dialog for adding new search engines." << ::endl; out << "# SEARCH ENGINES list" << ::endl; - QListViewItemIterator itr(m_engines); + TQListViewItemIterator itr(m_engines); while (itr.current()) { - QListViewItem* item = itr.current(); - QString u = item->text(1); - QString name = item->text(0); - out << name.replace(" ","%20") << " " << u.replace(" ","%20") << endl; + TQListViewItem* item = itr.current(); + TQString u = item->text(1); + TQString name = item->text(0); + out << name.tqreplace(" ","%20") << " " << u.tqreplace(" ","%20") << endl; itr++; } } @@ -123,7 +123,7 @@ namespace kt { KMessageBox::error(this, i18n("You must enter the search engine's name and URL")); } - else if ( m_engine_url->text().contains("FOOBAR") ) + else if ( m_engine_url->text().tqcontains("FOOBAR") ) { KURL url = KURL::fromPathOrURL(m_engine_url->text()); if ( !url.isValid() ) @@ -132,12 +132,12 @@ namespace kt return; } - if (m_engines->findItem(m_engine_name->text(), 0)) + if (m_engines->tqfindItem(m_engine_name->text(), 0)) { KMessageBox::error(this, i18n("A search engine with the same name already exists. Please use a different name.")); return; } - new QListViewItem(m_engines, m_engine_name->text(), m_engine_url->text()); + new TQListViewItem(m_engines, m_engine_name->text(), m_engine_url->text()); m_engine_url->setText(""); m_engine_name->setText(""); } @@ -152,30 +152,30 @@ namespace kt if ( m_engines->selectedItem() == 0 ) return; - QListViewItem* item = m_engines->selectedItem(); + TQListViewItem* item = m_engines->selectedItem(); m_engines->takeItem(item); delete item; } void SearchPrefPageWidget::addDefaultClicked() { - QListViewItem* se = new QListViewItem(m_engines, "KTorrents", "http://www.ktorrents.com/search.php?lg=0&sourceid=ktorrent&q=FOOBAR&f=0"); + TQListViewItem* se = new TQListViewItem(m_engines, "KTorrents", "http://www.ktorrents.com/search.php?lg=0&sourceid=ktorrent&q=FOOBAR&f=0"); - se = new QListViewItem(m_engines, "bittorrent.com", "http://search.bittorrent.com/search.jsp?query=FOOBAR"); + se = new TQListViewItem(m_engines, "bittorrent.com", "http://search.bittorrent.com/search.jsp?query=FOOBAR"); - se = new QListViewItem(m_engines, "isohunt.com", "http://isohunt.com/torrents.php?ihq=FOOBAR&op=and"); + se = new TQListViewItem(m_engines, "isohunt.com", "http://isohunt.com/torrents.php?ihq=FOOBAR&op=and"); - se = new QListViewItem(m_engines, "mininova.org", "http://www.mininova.org/search.php?search=FOOBAR"); + se = new TQListViewItem(m_engines, "mininova.org", "http://www.mininova.org/search.php?search=FOOBAR"); - se = new QListViewItem(m_engines, "thepiratebay.org", "http://thepiratebay.org/search.php?q=FOOBAR"); + se = new TQListViewItem(m_engines, "thepiratebay.org", "http://thepiratebay.org/search.php?q=FOOBAR"); - se = new QListViewItem(m_engines, "bitoogle.com", "http://bitoogle.com/search.php?q=FOOBAR"); + se = new TQListViewItem(m_engines, "bitoogle.com", "http://bitoogle.com/search.php?q=FOOBAR"); - se = new QListViewItem(m_engines, "bytenova.org", "http://www.bitenova.org/search.php?search=FOOBAR&start=0&start=0&ie=utf-8&oe=utf-8"); + se = new TQListViewItem(m_engines, "bytenova.org", "http://www.bitenova.org/search.php?search=FOOBAR&start=0&start=0&ie=utf-8&oe=utf-8"); - se = new QListViewItem(m_engines, "torrentspy.com", "http://torrentspy.com/search.asp?query=FOOBAR"); + se = new TQListViewItem(m_engines, "torrentspy.com", "http://torrentspy.com/search.asp?query=FOOBAR"); - se = new QListViewItem(m_engines, "torrentz.com", "http://www.torrentz.com/search_FOOBAR"); + se = new TQListViewItem(m_engines, "torrentz.com", "http://www.torrentz.com/search_FOOBAR"); } void SearchPrefPageWidget::removeAllClicked() @@ -185,7 +185,7 @@ namespace kt void SearchPrefPageWidget::btnUpdate_clicked() { - QString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines.tmp"; + TQString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines.tmp"; KURL source("http://www.ktorrent.org/downloads/search_engines"); if (KIO::NetAccess::download(source,fn,NULL)) @@ -197,27 +197,27 @@ namespace kt } } - void SearchPrefPageWidget::updateList(QString& source) + void SearchPrefPageWidget::updateList(TQString& source) { - QFile fptr(source); + TQFile fptr(source); if (!fptr.open(IO_ReadOnly)) return; - QTextStream in(&fptr); + TQTextStream in(&fptr); - QMap<QString,KURL> engines; + TQMap<TQString,KURL> engines; while (!in.atEnd()) { - QString line = in.readLine(); + TQString line = in.readLine(); if(line.startsWith("#") || line.startsWith(" ") || line.isEmpty() ) continue; - QStringList tokens = QStringList::split(" ", line); - QString name = tokens[0]; - name = name.replace("%20"," "); + TQStringList tokens = TQStringList::split(" ", line); + TQString name = tokens[0]; + name = name.tqreplace("%20"," "); KURL url = KURL::fromPathOrURL(tokens[1]); for(Uint32 i=2; i<tokens.count(); ++i) @@ -226,15 +226,15 @@ namespace kt engines.insert(name,url); } - QMap<QString,KURL>::iterator i = engines.begin(); + TQMap<TQString,KURL>::iterator i = engines.begin(); while (i != engines.end()) { - QListViewItem* item = m_engines->findItem(i.key(),0); + TQListViewItem* item = m_engines->tqfindItem(i.key(),0); // if we have found the item, replace it if not make a new one if (item) item->setText(1, i.data().prettyURL()); else - new QListViewItem(m_engines,i.key(),i.data().prettyURL()); + new TQListViewItem(m_engines,i.key(),i.data().prettyURL()); i++; } @@ -264,9 +264,9 @@ namespace kt return ret; } - void SearchPrefPage::createWidget(QWidget* parent) + void SearchPrefPage::createWidget(TQWidget* tqparent) { - widget = new SearchPrefPageWidget(parent); + widget = new SearchPrefPageWidget(tqparent); } void SearchPrefPage::deleteWidget() diff --git a/plugins/search/searchprefpage.h b/plugins/search/searchprefpage.h index a8d647d..748b378 100644 --- a/plugins/search/searchprefpage.h +++ b/plugins/search/searchprefpage.h @@ -24,7 +24,7 @@ #include <interfaces/prefpageinterface.h> #include "searchpref.h" -#include <qstring.h> +#include <tqstring.h> namespace kt { @@ -34,12 +34,13 @@ namespace kt class SearchPrefPageWidget : public SEPreferences { Q_OBJECT + TQ_OBJECT public: - SearchPrefPageWidget(QWidget *parent = 0); + SearchPrefPageWidget(TQWidget *tqparent = 0); bool apply(); void saveSearchEngines(); - void updateList(QString& source); + void updateList(TQString& source); void updateSearchEngines(const SearchEngineList & se); @@ -64,7 +65,7 @@ namespace kt virtual ~SearchPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/search/searchtab.cpp b/plugins/search/searchtab.cpp index 1beaa6a..02f3acf 100644 --- a/plugins/search/searchtab.cpp +++ b/plugins/search/searchtab.cpp @@ -17,17 +17,17 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> -#include <qapplication.h> -#include <qlistbox.h> -#include <qcheckbox.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqapplication.h> +#include <tqlistbox.h> +#include <tqcheckbox.h> #include <kglobal.h> #include <kpushbutton.h> #include <kiconloader.h> #include <kcombobox.h> #include <kcompletion.h> -#include <qlabel.h> +#include <tqlabel.h> #include <klocale.h> #include "searchtab.h" #include "searchenginelist.h" @@ -48,21 +48,21 @@ namespace kt m_search_new_tab = new KPushButton(i18n("Search"),tb); m_search_engine = new KComboBox(tb); - m_clear_button->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); + m_clear_button->setIconSet(SmallIconSet(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); m_clear_button->setEnabled(false); - connect(m_search_new_tab,SIGNAL(clicked()),this,SLOT(searchNewTabPressed())); - connect(m_search_text,SIGNAL(returnPressed(const QString&)),this,SLOT(searchBoxReturn( const QString& ))); - connect(m_search_text,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged( const QString& ))); - connect(m_clear_button,SIGNAL(clicked()),this,SLOT(clearButtonPressed())); + connect(m_search_new_tab,TQT_SIGNAL(clicked()),this,TQT_SLOT(searchNewTabPressed())); + connect(m_search_text,TQT_SIGNAL(returnPressed(const TQString&)),this,TQT_SLOT(searchBoxReturn( const TQString& ))); + connect(m_search_text,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(textChanged( const TQString& ))); + connect(m_clear_button,TQT_SIGNAL(clicked()),this,TQT_SLOT(clearButtonPressed())); m_search_text->setMaxCount(20); m_search_new_tab->setEnabled(false); - m_search_text->setInsertionPolicy(QComboBox::NoInsertion); + m_search_text->setInsertionPolicy(TQComboBox::NoInsertion); tb->insertWidget(1,-1,m_clear_button); tb->insertWidget(2,-1,m_search_text); tb->insertWidget(3,-1,m_search_new_tab); - tb->insertWidget(4,-1,new QLabel(i18n(" Engine: "),tb)); + tb->insertWidget(4,-1,new TQLabel(i18n(" Engine: "),tb)); tb->insertWidget(5,-1,m_search_engine); loadSearchHistory(); } @@ -93,7 +93,7 @@ namespace kt m_search_engine->setCurrentItem(ci); } - void SearchTab::searchBoxReturn(const QString & str) + void SearchTab::searchBoxReturn(const TQString & str) { KCompletion *comp = m_search_text->completionObject(); if (!m_search_text->contains(str)) @@ -116,7 +116,7 @@ namespace kt searchBoxReturn(m_search_text->currentText()); } - void SearchTab::textChanged(const QString & str) + void SearchTab::textChanged(const TQString & str) { m_search_new_tab->setEnabled(str.length() > 0); m_clear_button->setEnabled(str.length() > 0); @@ -124,17 +124,17 @@ namespace kt void SearchTab::loadSearchHistory() { - QFile fptr(kt::DataDir() + "search_history"); + TQFile fptr(kt::DataDir() + "search_history"); if (!fptr.open(IO_ReadOnly)) return; KCompletion *comp = m_search_text->completionObject(); Uint32 cnt = 0; - QTextStream in(&fptr); + TQTextStream in(&fptr); while (!in.atEnd() && cnt < 50) { - QString line = in.readLine(); + TQString line = in.readLine(); if (line.isNull()) break; @@ -151,14 +151,14 @@ namespace kt void SearchTab::saveSearchHistory() { - QFile fptr(kt::DataDir() + "search_history"); + TQFile fptr(kt::DataDir() + "search_history"); if (!fptr.open(IO_WriteOnly)) return; - QTextStream out(&fptr); + TQTextStream out(&fptr); KCompletion *comp = m_search_text->completionObject(); - QStringList items = comp->items(); - for (QStringList::iterator i = items.begin();i != items.end();i++) + TQStringList items = comp->items(); + for (TQStringList::iterator i = items.begin();i != items.end();i++) { out << *i << endl; } diff --git a/plugins/search/searchtab.h b/plugins/search/searchtab.h index c392de9..9c62bf3 100644 --- a/plugins/search/searchtab.h +++ b/plugins/search/searchtab.h @@ -33,9 +33,10 @@ namespace kt /** Holds all widgets of the toolbar of the search plugin. */ - class SearchTab : public QObject + class SearchTab : public TQObject { Q_OBJECT + TQ_OBJECT public: SearchTab(KToolBar* toolbar); @@ -53,12 +54,12 @@ namespace kt protected slots: void clearButtonPressed(); void searchNewTabPressed(); - void searchBoxReturn(const QString & str); - void textChanged(const QString & str); + void searchBoxReturn(const TQString & str); + void textChanged(const TQString & str); signals: /// Emitted when the user presses enter or clicks search - void search(const QString & text,int engine,bool external); + void search(const TQString & text,int engine,bool external); private: void loadSearchHistory(); diff --git a/plugins/search/searchwidget.cpp b/plugins/search/searchwidget.cpp index 2ed19e8..b7e2627 100644 --- a/plugins/search/searchwidget.cpp +++ b/plugins/search/searchwidget.cpp @@ -21,11 +21,11 @@ #include <kapplication.h> #include <khtmlview.h> -#include <qlayout.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <klineedit.h> #include <kpushbutton.h> #include <kglobal.h> @@ -59,55 +59,55 @@ namespace kt SearchWidget::SearchWidget(SearchPlugin* sp) : html_part(0),sp(sp) { - QVBoxLayout* layout = new QVBoxLayout(this); - layout->setAutoAdd(true); + TQVBoxLayout* tqlayout = new TQVBoxLayout(this); + tqlayout->setAutoAdd(true); sbar = new SearchBar(this); html_part = new HTMLPart(this); right_click_menu = new KPopupMenu(this); right_click_menu->insertSeparator(); back_id = right_click_menu->insertItem( - KGlobal::iconLoader()->loadIconSet(QApplication::reverseLayout() + KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout() ? "forward" : "back",KIcon::Small), - i18n("Back"),html_part,SLOT(back())); + i18n("Back"),html_part,TQT_SLOT(back())); right_click_menu->insertItem( KGlobal::iconLoader()->loadIconSet("reload",KIcon::Small), - i18n("Reload"),html_part,SLOT(reload())); + i18n("Reload"),html_part,TQT_SLOT(reload())); right_click_menu->setItemEnabled(back_id,false); sbar->m_back->setEnabled(false); - connect(sbar->m_search_button,SIGNAL(clicked()),this,SLOT(searchPressed())); - connect(sbar->m_clear_button,SIGNAL(clicked()),this,SLOT(clearPressed())); - connect(sbar->m_search_text,SIGNAL(returnPressed()),this,SLOT(searchPressed())); - connect(sbar->m_back,SIGNAL(clicked()),html_part,SLOT(back())); - connect(sbar->m_reload,SIGNAL(clicked()),html_part,SLOT(reload())); + connect(sbar->m_search_button,TQT_SIGNAL(clicked()),this,TQT_SLOT(searchPressed())); + connect(sbar->m_clear_button,TQT_SIGNAL(clicked()),this,TQT_SLOT(clearPressed())); + connect(sbar->m_search_text,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(searchPressed())); + connect(sbar->m_back,TQT_SIGNAL(clicked()),html_part,TQT_SLOT(back())); + connect(sbar->m_reload,TQT_SIGNAL(clicked()),html_part,TQT_SLOT(reload())); sbar->m_clear_button->setIconSet( - KGlobal::iconLoader()->loadIconSet(QApplication::reverseLayout() + KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase",KIcon::Small)); sbar->m_back->setIconSet( - KGlobal::iconLoader()->loadIconSet(QApplication::reverseLayout() + KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout() ? "forward" : "back", KIcon::Small)); sbar->m_reload->setIconSet( KGlobal::iconLoader()->loadIconSet("reload",KIcon::Small)); - connect(html_part,SIGNAL(backAvailable(bool )), - this,SLOT(onBackAvailable(bool ))); - connect(html_part,SIGNAL(onURL(const QString& )), - this,SLOT(onURLHover(const QString& ))); - connect(html_part,SIGNAL(openTorrent(const KURL& )), - this,SLOT(onOpenTorrent(const KURL& ))); - connect(html_part,SIGNAL(popupMenu(const QString&, const QPoint& )), - this,SLOT(showPopupMenu(const QString&, const QPoint& ))); - connect(html_part,SIGNAL(searchFinished()),this,SLOT(onFinished())); - connect(html_part,SIGNAL(saveTorrent(const KURL& )), - this,SLOT(onSaveTorrent(const KURL& ))); + connect(html_part,TQT_SIGNAL(backAvailable(bool )), + this,TQT_SLOT(onBackAvailable(bool ))); + connect(html_part,TQT_SIGNAL(onURL(const TQString& )), + this,TQT_SLOT(onURLHover(const TQString& ))); + connect(html_part,TQT_SIGNAL(openTorrent(const KURL& )), + this,TQT_SLOT(onOpenTorrent(const KURL& ))); + connect(html_part,TQT_SIGNAL(popupMenu(const TQString&, const TQPoint& )), + this,TQT_SLOT(showPopupMenu(const TQString&, const TQPoint& ))); + connect(html_part,TQT_SIGNAL(searchFinished()),this,TQT_SLOT(onFinished())); + connect(html_part,TQT_SIGNAL(saveTorrent(const KURL& )), + this,TQT_SLOT(onSaveTorrent(const KURL& ))); KParts::PartManager* pman = html_part->partManager(); - connect(pman,SIGNAL(partAdded(KParts::Part*)),this,SLOT(onFrameAdded(KParts::Part* ))); + connect(pman,TQT_SIGNAL(partAdded(KParts::Part*)),this,TQT_SLOT(onFrameAdded(KParts::Part* ))); - connect(html_part->browserExtension(),SIGNAL(loadingProgress(int)),this,SLOT(loadingProgress(int))); + connect(html_part->browserExtension(),TQT_SIGNAL(loadingProgress(int)),this,TQT_SLOT(loadingProgress(int))); prog = 0; } @@ -143,8 +143,8 @@ namespace kt KHTMLPart* frame = dynamic_cast<KHTMLPart*>(p); if (frame) { - connect(frame,SIGNAL(popupMenu(const QString&, const QPoint& )), - this,SLOT(showPopupMenu(const QString&, const QPoint& ))); + connect(frame,TQT_SIGNAL(popupMenu(const TQString&, const TQPoint& )), + this,TQT_SLOT(showPopupMenu(const TQString&, const TQPoint& ))); } } @@ -155,7 +155,7 @@ namespace kt html_part->copy(); } - void SearchWidget::search(const QString & text,int engine) + void SearchWidget::search(const TQString & text,int engine) { if (!html_part) return; @@ -171,11 +171,11 @@ namespace kt if (engine < 0 || (Uint32)engine >= sl.getNumEngines()) engine = sbar->m_search_engine->currentItem(); - QString s_url = sl.getSearchURL(engine).prettyURL(); - s_url.replace("FOOBAR", KURL::encode_string(text), true); + TQString s_url = sl.getSearchURL(engine).prettyURL(); + s_url.tqreplace("FOOBAR", KURL::encode_string(text), true); KURL url = KURL::fromPathOrURL(s_url); - statusBarMsg(i18n("Searching for %1...").arg(text)); + statusBarMsg(i18n("Searching for %1...").tqarg(text)); //html_part->openURL(url); html_part->openURLRequest(url,KParts::URLArgs()); } @@ -190,7 +190,7 @@ namespace kt sbar->m_search_text->clear(); } - void SearchWidget::onURLHover(const QString & url) + void SearchWidget::onURLHover(const TQString & url) { statusBarMsg(url); } @@ -206,10 +206,10 @@ namespace kt void SearchWidget::onSaveTorrent(const KURL & url) { - KFileDialog fdlg(QString::null,"*.torrent | " + i18n("torrent files"),this,0,true); + KFileDialog fdlg(TQString(),"*.torrent | " + i18n("torrent files"),this,0,true); fdlg.setSelection(url.fileName()); fdlg.setOperationMode(KFileDialog::Saving); - if (fdlg.exec() == QDialog::Accepted) + if (fdlg.exec() == TQDialog::Accepted) { KURL save_url = fdlg.selectedURL(); // start a copy job @@ -219,7 +219,7 @@ namespace kt } } - void SearchWidget::showPopupMenu(const QString & url,const QPoint & p) + void SearchWidget::showPopupMenu(const TQString & url,const TQPoint & p) { right_click_menu->popup(p); } @@ -235,7 +235,7 @@ namespace kt html_part = 0; } - void SearchWidget::statusBarMsg(const QString & url) + void SearchWidget::statusBarMsg(const TQString & url) { sp->getGUI()->changeStatusbar(url); } diff --git a/plugins/search/searchwidget.h b/plugins/search/searchwidget.h index 36fb73e..fc03a06 100644 --- a/plugins/search/searchwidget.h +++ b/plugins/search/searchwidget.h @@ -20,8 +20,8 @@ #ifndef BTSEARCHWIDGET_H #define BTSEARCHWIDGET_H -#include <qwidget.h> -#include <qvaluevector.h> +#include <tqwidget.h> +#include <tqvaluevector.h> #include <kurl.h> class SearchBar; @@ -45,9 +45,10 @@ namespace kt Widget which shows a KHTML window with the users search in it */ - class SearchWidget : public QWidget + class SearchWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: SearchWidget(SearchPlugin* sp); virtual ~SearchWidget(); @@ -57,21 +58,21 @@ namespace kt void updateSearchEngines(const SearchEngineList & sl); public slots: - void search(const QString & text,int engine = 0); + void search(const TQString & text,int engine = 0); void copy(); void onShutDown(); private slots: void searchPressed(); void clearPressed(); - void onURLHover(const QString & url); + void onURLHover(const TQString & url); void onFinished(); void onOpenTorrent(const KURL & url); void onSaveTorrent(const KURL & url); - void showPopupMenu(const QString & s,const QPoint & p); + void showPopupMenu(const TQString & s,const TQPoint & p); void onBackAvailable(bool available); void onFrameAdded(KParts::Part* p); - void statusBarMsg(const QString & url); + void statusBarMsg(const TQString & url); void openTorrent(const KURL & url); void loadingProgress(int perc); diff --git a/plugins/stats/ChartDrawer.cc b/plugins/stats/ChartDrawer.cc index 75142e6..5824684 100644 --- a/plugins/stats/ChartDrawer.cc +++ b/plugins/stats/ChartDrawer.cc @@ -28,7 +28,7 @@ int isinf(double x) { return !finite(x) && x==x; } namespace kt { -ChartDrawer::ChartDrawer(QWidget *p, wgtsize_t x_max, wgtsize_t y_max, bool autom, const QString & uname) : QWidget(p), mXMax(x_max), mYMax(y_max), mAutoMax(autom), +ChartDrawer::ChartDrawer(TQWidget *p, wgtsize_t x_max, wgtsize_t y_max, bool autom, const TQString & uname) : TQWidget(p), mXMax(x_max), mYMax(y_max), mAutoMax(autom), mUnitName(uname), mMMode(MaxModeExact) { setBackgroundColor("white"); @@ -36,7 +36,7 @@ ChartDrawer::ChartDrawer(QWidget *p, wgtsize_t x_max, wgtsize_t y_max, bool auto ChartDrawer::~ChartDrawer() { - QToolTip::remove(this); + TQToolTip::remove(this); } ChartDrawer::wgtsize_t ChartDrawer::GetXMax() const @@ -75,9 +75,9 @@ inline ChartDrawer::wgtunit_t ChartDrawer::TrY(const ChartDrawer::wgtunit_t y) c return height() - y; } -void ChartDrawer::paintEvent ( QPaintEvent *) +void ChartDrawer::paintEvent ( TQPaintEvent *) { - QPainter pnt( this ); + TQPainter pnt( this ); DrawScale(pnt); DrawFrame(pnt); @@ -87,25 +87,25 @@ void ChartDrawer::paintEvent ( QPaintEvent *) inline ChartDrawer::wgtunit_t ChartDrawer::height() const { - return QWidget::height() - 15; + return TQWidget::height() - 15; } inline ChartDrawer::wgtunit_t ChartDrawer::width() const { - return QWidget::width() - 65; + return TQWidget::width() - 65; } -void ChartDrawer::DrawFrame(QPainter & rPnt ) +void ChartDrawer::DrawFrame(TQPainter & rPnt ) { - QPen op = rPnt.pen(); - rPnt.setPen(QPen("#000", 3)); + TQPen op = rPnt.pen(); + rPnt.setPen(TQPen("#000", 3)); rPnt.drawLine(0, TrY(0), width()+3, TrY(0)); - rPnt.drawLine(width()+1, TrY(0), width()+1, TrY(QWidget::height())); + rPnt.drawLine(width()+1, TrY(0), width()+1, TrY(TQWidget::height())); - QFont oldf(rPnt.font()); - QFont newf(oldf); - newf.setWeight(QFont::Bold); + TQFont oldf(rPnt.font()); + TQFont newf(oldf); + newf.setWeight(TQFont::Bold); newf.setPointSize(10); newf.setUnderline(1); @@ -116,7 +116,7 @@ void ChartDrawer::DrawFrame(QPainter & rPnt ) rPnt.setPen(op); } -void ChartDrawer::DrawScale(QPainter & rPnt ) +void ChartDrawer::DrawScale(TQPainter & rPnt ) { if(!mYMax) @@ -124,10 +124,10 @@ void ChartDrawer::DrawScale(QPainter & rPnt ) return; } - QPen op = rPnt.pen(); - QPen ep("#eee", 1, Qt::DashLine); - QPen lp("#666", 2, Qt::DotLine); - QPen tp("#000"); + TQPen op = rPnt.pen(); + TQPen ep("#eee", 1, TQt::DashLine); + TQPen lp("#666", 2, TQt::DotLine); + TQPen tp("#000"); rPnt.setPen(ep); @@ -144,23 +144,23 @@ void ChartDrawer::DrawScale(QPainter & rPnt ) rPnt.setPen(lp); rPnt.drawLine(0, TrY(height() - 10), width(), TrY(height() - 10)); rPnt.setPen(tp); - rPnt.drawText(width() + 4, TrY(height() - 10) + 4, QString::number (mYMax)); + rPnt.drawText(width() + 4, TrY(height() - 10) + 4, TQString::number (mYMax)); for(wgtsize_t i = 0; i < height() - 15 ; i += GetYScale()) { rPnt.setPen(lp); rPnt.drawLine(0, TrY(i), width(), TrY(i)); rPnt.setPen(tp); - rPnt.drawText(width() + 4, TrY(i) + 4, QString::number ( (mYMax / 8.0 ) * ( i / static_cast<double>(GetYScale() )), 'f', 1 ) ); + rPnt.drawText(width() + 4, TrY(i) + 4, TQString::number ( (mYMax / 8.0 ) * ( i / static_cast<double>(GetYScale() )), 'f', 1 ) ); } rPnt.setPen(op); } -void ChartDrawer::DrawChart(QPainter & rPnt) +void ChartDrawer::DrawChart(TQPainter & rPnt) { - QPen op = rPnt.pen(); + TQPen op = rPnt.pen(); uint32_t skip_max = 0; @@ -188,20 +188,20 @@ void ChartDrawer::DrawChart(QPainter & rPnt) // -------------------- // Line on top // ------------ - QPen myop(rPnt.pen()); - QPen topl(myop); + TQPen myop(rPnt.pen()); + TQPen topl(myop); topl.setStyle(Qt::DotLine); rPnt.setPen(topl); rPnt.drawLine(0, TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))), width(), TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))) ); rPnt.setPen(myop); - QFont oldf(rPnt.font()); - QFont newf(oldf); - newf.setWeight(QFont::Bold); + TQFont oldf(rPnt.font()); + TQFont newf(oldf); + newf.setWeight(TQFont::Bold); newf.setPointSize(8); rPnt.setFont(newf); - rPnt.drawText(5 + (i * 50), TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))) + 11, QString::number (mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1), 'f', 2 ) ); + rPnt.drawText(5 + (i * 50), TrY(FindYScreenCoords(mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1))) + 11, TQString::number (mEls[i].pmVals -> at(mEls[i].pmVals -> size() - 1), 'f', 2 ) ); //------------------ @@ -220,7 +220,7 @@ void ChartDrawer::DrawChart(QPainter & rPnt) rPnt.setPen(myop); rPnt.setFont(newf); - QString maxv(QString::number (max.first, 'f', 2)); + TQString maxv(TQString::number (max.first, 'f', 2)); if(FindXScreenCoords(max.second) < 35) { @@ -336,7 +336,7 @@ void ChartDrawer::AddValues(ChartDrawerData Cdd, const size_t idx, const bool ma MakeLegendTooltip(); } -void ChartDrawer::AddValuesCnt(const QString & rN, const bool max) +void ChartDrawer::AddValuesCnt(const TQString & rN, const bool max) { mEls.push_back(ChartDrawerData(mXMax, rN)); mMarkMax.push_back(max); @@ -344,7 +344,7 @@ void ChartDrawer::AddValuesCnt(const QString & rN, const bool max) MakeLegendTooltip(); } -void ChartDrawer::AddValuesCnt(const QPen & rP, const QString & rN, const bool max) +void ChartDrawer::AddValuesCnt(const TQPen & rP, const TQString & rN, const bool max) { mEls.push_back(ChartDrawerData(rP, mXMax, rN)); mMarkMax.push_back(max); @@ -352,17 +352,17 @@ void ChartDrawer::AddValuesCnt(const QPen & rP, const QString & rN, const bool m MakeLegendTooltip(); } -void ChartDrawer::SetUnitName(const QString & rN) +void ChartDrawer::SetUnitName(const TQString & rN) { mUnitName = rN; } -QString ChartDrawer::GetUnitName() const +TQString ChartDrawer::GetUnitName() const { return mUnitName; } -void ChartDrawer::mouseDoubleClickEvent ( QMouseEvent * evt ) +void ChartDrawer::mouseDoubleClickEvent ( TQMouseEvent * evt ) { FindSetMax(); @@ -414,16 +414,16 @@ void ChartDrawer::Zero(const size_t idx) void ChartDrawer::MakeLegendTooltip() { - QToolTip::remove(this); + TQToolTip::remove(this); - QString helpstr(QString("<b>%1:</b><br><br>").arg(i18n("Legend"))); - QMimeSourceFactory* factory = QMimeSourceFactory::defaultFactory(); - std::vector<QImage> img; + TQString helpstr(TQString("<b>%1:</b><br><br>").tqarg(i18n("Legend"))); + TQMimeSourceFactory* factory = TQMimeSourceFactory::defaultFactory(); + std::vector<TQImage> img; for(size_t i = 0; i < mEls.size(); i++) { - img.push_back(QImage(16,16, 32)); - img[i].fill(mEls[i].GetPen() -> color().pixel()); + img.push_back(TQImage(16,16, 32)); + img[i].fill(TQColor(mEls[i].GetPen() -> color()).pixel()); for(uint8_t px = 0; px < 16; px++) { @@ -433,11 +433,11 @@ void ChartDrawer::MakeLegendTooltip() img[i].setPixel(15, px, 0); //r } - factory->setImage(mEls[i].GetName().replace(' ', '_') + "-" + QString::number(i), img[i]); - helpstr += QString("<img src='%1'> - %2<br>").arg(mEls[i].GetName().replace(" ", "_") + "-" + QString::number(i)).arg( mEls[i].GetName() ); + factory->setImage(mEls[i].GetName().tqreplace(' ', '_') + "-" + TQString::number(i), img[i]); + helpstr += TQString("<img src='%1'> - %2<br>").tqarg(mEls[i].GetName().tqreplace(" ", "_") + "-" + TQString::number(i)).tqarg( mEls[i].GetName() ); } - QToolTip::add(this, helpstr); + TQToolTip::add(this, helpstr); } void ChartDrawer::FindSetMax() diff --git a/plugins/stats/ChartDrawer.h b/plugins/stats/ChartDrawer.h index 44b8d9f..2345f14 100644 --- a/plugins/stats/ChartDrawer.h +++ b/plugins/stats/ChartDrawer.h @@ -23,12 +23,12 @@ #include <stdint.h> -#include <qwidget.h> -#include <qpainter.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qmime.h> -#include <qimage.h> +#include <tqwidget.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqmime.h> +#include <tqimage.h> #include <klocale.h> @@ -44,9 +44,10 @@ namespace kt { \brief Widget for drawing line charts \author Krzysztof Kundzicz <[email protected]> */ -class ChartDrawer : public QWidget +class ChartDrawer : public TQWidget { Q_OBJECT + TQ_OBJECT public: ///Type used as widget size unit @@ -71,29 +72,29 @@ class ChartDrawer : public QWidget ///Chart data val_t mEls; ///Name of the chart unit - QString mUnitName; + TQString mUnitName; ///Mark max std::vector<bool> mMarkMax; ///Max mode MaxMode mMMode; ///Paint event handler - void paintEvent ( QPaintEvent * ); + void paintEvent ( TQPaintEvent * ); /** \brief Draws chart's frame \param rPnt Painter on which things will be drawn */ - void DrawFrame(QPainter &rPnt); + void DrawFrame(TQPainter &rPnt); /** \brief Draws chart's scale \param rPnt Painter on which things will be drawn */ - void DrawScale(QPainter &rPnt); + void DrawScale(TQPainter &rPnt); /** \brief Draws chart \param rPnt Painter on which things will be drawn */ - void DrawChart(QPainter &rPnt); + void DrawChart(TQPainter &rPnt); /** \brief Gets distance between two values on OY @@ -149,7 +150,7 @@ class ChartDrawer : public QWidget \param autom Whether athomagically set the maximum Y size \param uname Unit name */ - ChartDrawer(QWidget *p = 0, wgtsize_t x_max = 2, wgtsize_t y_max = 1, bool autom = true, const QString & uname = "KB/s"); + ChartDrawer(TQWidget *p = 0, wgtsize_t x_max = 2, wgtsize_t y_max = 1, bool autom = true, const TQString & uname = "KB/s"); ~ChartDrawer(); /** @@ -169,18 +170,18 @@ class ChartDrawer : public QWidget \note It'l be drawn on the chart */ - void SetUnitName(const QString & rN); + void SetUnitName(const TQString & rN); /** \brief Gets unit name \return name */ - QString GetUnitName() const; + TQString GetUnitName() const; /** \brief Doubleclick handler \param evt Mouse event */ - void mouseDoubleClickEvent ( QMouseEvent * evt ); + void mouseDoubleClickEvent ( TQMouseEvent * evt ); /** \brief Gets mode of OY axis maximum drawing @@ -215,14 +216,14 @@ class ChartDrawer : public QWidget \param rN Set's data name \param max Whether mark maximum of this dataset */ - void AddValuesCnt(const QString & rN, const bool max = true); + void AddValuesCnt(const TQString & rN, const bool max = true); /** \brief Adds empty dataset \param rP Pen that will be used to drawing \param rN Dataset name \param max Whether mark maximum of this dataset */ - void AddValuesCnt(const QPen & rP, const QString & rN, const bool max = true ); + void AddValuesCnt(const TQPen & rP, const TQString & rN, const bool max = true ); /** \brief Removes dataset @@ -273,7 +274,7 @@ class ChartDrawer : public QWidget \brief Emited when widget is doubleclicked \param evt Mouse event */ - void DoubleClicked(QMouseEvent * evt); + void DoubleClicked(TQMouseEvent * evt); }; diff --git a/plugins/stats/ChartDrawerData.cc b/plugins/stats/ChartDrawerData.cc index 9a49a95..ba03261 100644 --- a/plugins/stats/ChartDrawerData.cc +++ b/plugins/stats/ChartDrawerData.cc @@ -22,25 +22,25 @@ namespace kt { -ChartDrawerData::ChartDrawerData(const QString & rN) : pmQp(new QPen("#000", 1, Qt::SolidLine)), pmVals(new val_t(2, 0.0)), mName(rN) +ChartDrawerData::ChartDrawerData(const TQString & rN) : pmQp(new TQPen("#000", 1, TQt::SolidLine)), pmVals(new val_t(2, 0.0)), mName(rN) { } -ChartDrawerData::ChartDrawerData(const size_t s, const QString & rN) : pmQp(new QPen("#000", 1, Qt::SolidLine)), pmVals(new val_t(s, 0.0)), mName(rN) +ChartDrawerData::ChartDrawerData(const size_t s, const TQString & rN) : pmQp(new TQPen("#000", 1, TQt::SolidLine)), pmVals(new val_t(s, 0.0)), mName(rN) { } -ChartDrawerData::ChartDrawerData(const QPen & rQp, const QString & rN) : pmQp(new QPen(rQp)), pmVals(new val_t(2, 0.0)), mName(rN) +ChartDrawerData::ChartDrawerData(const TQPen & rQp, const TQString & rN) : pmQp(new TQPen(rQp)), pmVals(new val_t(2, 0.0)), mName(rN) { } -ChartDrawerData::ChartDrawerData(const QPen & rQp, const size_t s, const QString & rN) : pmQp(new QPen(rQp)), pmVals(new val_t(s, 0.0)), mName(rN) +ChartDrawerData::ChartDrawerData(const TQPen & rQp, const size_t s, const TQString & rN) : pmQp(new TQPen(rQp)), pmVals(new val_t(s, 0.0)), mName(rN) { } ChartDrawerData::ChartDrawerData(const ChartDrawerData & rS) { - pmQp = new QPen(*rS.pmQp); + pmQp = new TQPen(*rS.pmQp); pmVals = new val_t(*rS.pmVals); mName = rS.mName; } @@ -56,15 +56,15 @@ const ChartDrawerData::val_t * ChartDrawerData::GetVals() const return pmVals; } -const QPen * ChartDrawerData::GetPen() const +const TQPen * ChartDrawerData::GetPen() const { return pmQp; } -void ChartDrawerData::SetPen(const QPen & rQp) +void ChartDrawerData::SetPen(const TQPen & rQp) { delete pmQp; - pmQp = new QPen(rQp); + pmQp = new TQPen(rQp); } std::pair<double, size_t> ChartDrawerData::Max() const @@ -88,11 +88,11 @@ std::pair<double, size_t> ChartDrawerData::Max() const return std::make_pair(max, maxpos); } -QString ChartDrawerData::GetName() const +TQString ChartDrawerData::GetName() const { return mName; } -void ChartDrawerData::SetName( const QString & rN ) +void ChartDrawerData::SetName( const TQString & rN ) { mName = rN; } diff --git a/plugins/stats/ChartDrawerData.h b/plugins/stats/ChartDrawerData.h index 561e76a..19d16e5 100644 --- a/plugins/stats/ChartDrawerData.h +++ b/plugins/stats/ChartDrawerData.h @@ -21,7 +21,7 @@ #ifndef CHARTDRAWERDATA_H_ #define CHARTDRAWERDATA_H_ -#include <qpen.h> +#include <tqpen.h> #include <vector> #include <map> @@ -43,18 +43,18 @@ class ChartDrawerData private: ///Pen used for drawing - QPen * pmQp; + TQPen * pmQp; ///Values val_t * pmVals; ///Name of set - QString mName; + TQString mName; public: /** \brief Constructor \param rN Name */ - ChartDrawerData(const QString & rN); + ChartDrawerData(const TQString & rN); /** \brief Copy constructor \param rS Source @@ -65,20 +65,20 @@ class ChartDrawerData \param s Size \param rN Name */ - ChartDrawerData(const size_t s, const QString & rN); + ChartDrawerData(const size_t s, const TQString & rN); /** \brief Constructor \param rQp Pen used for drawing \param rN Name */ - ChartDrawerData(const QPen & rQp, const QString & rN); + ChartDrawerData(const TQPen & rQp, const TQString & rN); /** \brief Constructor \param rQp Pen used for drawing \param s Size \param rN Name */ - ChartDrawerData(const QPen & rQp, const size_t s, const QString & rN); + ChartDrawerData(const TQPen & rQp, const size_t s, const TQString & rN); ///Destructor ~ChartDrawerData(); @@ -92,23 +92,23 @@ class ChartDrawerData \brief Gets pen \return Pointer pen */ - const QPen * GetPen() const; + const TQPen * GetPen() const; /** \brief Gets name \return Name */ - QString GetName() const; + TQString GetName() const; /** \brief Sets pen \param rQp Pen */ - void SetPen(const QPen & rQp); + void SetPen(const TQPen & rQp); /** \brief Sets name \param rN Name */ - void SetName( const QString & rN ); + void SetName( const TQString & rN ); /** \brief Finds maximum value diff --git a/plugins/stats/PeerMonitor.cc b/plugins/stats/PeerMonitor.cc index a4cf449..935efda 100644 --- a/plugins/stats/PeerMonitor.cc +++ b/plugins/stats/PeerMonitor.cc @@ -22,7 +22,7 @@ namespace kt { -PeerMonitor::PeerMonitor(kt::TorrentInterface * pTi, std::map<bt::SHA1Hash, PeerMonitor *> * pM) : kt::MonitorInterface(), QObject(), pmTorIface(pTi), pmPeerMMgr(pM) +PeerMonitor::PeerMonitor(kt::TorrentInterface * pTi, std::map<bt::SHA1Hash, PeerMonitor *> * pM) : kt::MonitorInterface(), TQObject(), pmTorIface(pTi), pmPeerMMgr(pM) { } @@ -33,7 +33,7 @@ PeerMonitor::~PeerMonitor() void PeerMonitor::peerAdded (kt::PeerInterface *peer) { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); mPeers.push_back( peer ); } @@ -41,9 +41,9 @@ void PeerMonitor::peerAdded (kt::PeerInterface *peer) void PeerMonitor::peerRemoved (kt::PeerInterface *peer) { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); - data_t::iterator it = std::find(mPeers.begin(), mPeers.end(), peer); + data_t::iterator it = std::tqfind(mPeers.begin(), mPeers.end(), peer); if(it != mPeers.end()) { @@ -65,7 +65,7 @@ void PeerMonitor::downloadRemoved (kt::ChunkDownloadInterface *) void PeerMonitor::stopped () { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); std::fill(mPeers.begin(), mPeers.end(), static_cast<PeerInterface*>( 0 ) ); // mPeers.clear(); @@ -73,7 +73,7 @@ void PeerMonitor::stopped () void PeerMonitor::destroyed () { - if(pmPeerMMgr -> find(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() ) + if(pmPeerMMgr -> tqfind(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() ) { pmTorIface -> setMonitor(0); pmPeerMMgr -> erase(pmTorIface -> getInfoHash()); @@ -84,12 +84,12 @@ void PeerMonitor::destroyed () double PeerMonitor::LeechersUpSpeed() { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); double spd = 0.0; //without it'll segfault/SIGABRT on stop as in meantime the iterator from - // mPeers will be invalidated + // mPeers will be tqinvalidated for( data_t::const_iterator it = mPeers.begin(); it != mPeers.end(); it++) { @@ -104,7 +104,7 @@ double PeerMonitor::LeechersUpSpeed() double PeerMonitor::LeechersDownSpeed() { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); double spd = 0.0; @@ -123,7 +123,7 @@ double PeerMonitor::LeechersDownSpeed() double PeerMonitor::SeedersUpSpeed() { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); double spd = 0.0; @@ -143,7 +143,7 @@ double PeerMonitor::SeedersUpSpeed() uint64_t PeerMonitor::GetLeechers() { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); uint64_t l = 0; @@ -162,7 +162,7 @@ uint64_t PeerMonitor::GetLeechers() uint64_t PeerMonitor::GetSeeders() { - QMutexLocker lock(&mtx); + TQMutexLocker lock(&mtx); uint64_t s = 0; diff --git a/plugins/stats/PeerMonitor.h b/plugins/stats/PeerMonitor.h index d1ef4fc..3489378 100644 --- a/plugins/stats/PeerMonitor.h +++ b/plugins/stats/PeerMonitor.h @@ -21,7 +21,7 @@ #ifndef PEERMONITOR_H_ #define PEERMONITOR_H_ -#include <qmutex.h> +#include <tqmutex.h> #include <interfaces/monitorinterface.h> #include <interfaces/peerinterface.h> @@ -43,7 +43,7 @@ Used for peers statistics \warning Don't use it, as There Can Be Only One™ and the infowidgetplugin relays on it */ -class PeerMonitor : public MonitorInterface, public QObject +class PeerMonitor : public MonitorInterface, public TQObject { public: ///Type of conteiner of pointers to peers @@ -55,7 +55,7 @@ class PeerMonitor : public MonitorInterface, public QObject Used for locking conteiner with pointers to peers */ - QMutex mtx; + TQMutex mtx; ///Container with pointers to peers data_t mPeers; ///Monitored torrent diff --git a/plugins/stats/StatsCon.cc b/plugins/stats/StatsCon.cc index 069ba75..548b38a 100644 --- a/plugins/stats/StatsCon.cc +++ b/plugins/stats/StatsCon.cc @@ -22,20 +22,20 @@ namespace kt { -StatsCon::StatsCon(QWidget * p) : StatsConWgt(p), pmPeersConCht(new ChartDrawer(PeersConGbw, StatsPluginSettings::connectionsMeasurements())), +StatsCon::StatsCon(TQWidget * p) : StatsConWgt(p), pmPeersConCht(new ChartDrawer(PeersConGbw, StatsPluginSettings::connectionsMeasurements())), pmDHTCht(new ChartDrawer(DHTGbw, StatsPluginSettings::dHTMeasurements())) { PeersConGbw->setColumnLayout(0, Qt::Vertical ); - PeersConGbw->layout()->setSpacing( 6 ); - PeersConGbw->layout()->setMargin( 11 ); + PeersConGbw->tqlayout()->setSpacing( 6 ); + PeersConGbw->tqlayout()->setMargin( 11 ); - pmPeersConLay = new QVBoxLayout(PeersConGbw -> layout()); + pmPeersConLay = new TQVBoxLayout(PeersConGbw -> tqlayout()); DHTGbw->setColumnLayout(0, Qt::Vertical ); - DHTGbw->layout()->setSpacing( 6 ); - DHTGbw->layout()->setMargin( 11 ); + DHTGbw->tqlayout()->setSpacing( 6 ); + DHTGbw->tqlayout()->setMargin( 11 ); - pmDHTLay = new QVBoxLayout(DHTGbw -> layout()); + pmDHTLay = new TQVBoxLayout(DHTGbw -> tqlayout()); //------------- @@ -46,20 +46,20 @@ StatsCon::StatsCon(QWidget * p) : StatsConWgt(p), pmPeersConCht(new ChartDrawer pmPeersConCht -> SetUnitName("n"); - pmPeersConCht -> AddValuesCnt(QPen("#f00"), i18n("Leechers connected")); - pmPeersConCht -> AddValuesCnt(QPen("#900"), i18n("Leechers in swarms")); - pmPeersConCht -> AddValuesCnt(QPen("#00f"), i18n("Seeders connected")); - pmPeersConCht -> AddValuesCnt(QPen("#009"), i18n("Seeders in swarms")); - pmPeersConCht -> AddValuesCnt(QPen("#0a0"), i18n("Average connected leechers per torrent")); - pmPeersConCht -> AddValuesCnt(QPen("#060"), i18n("Average connected seeders per torrent")); - pmPeersConCht -> AddValuesCnt(QPen("#099"), i18n("Average connected leechers per running torrent")); - pmPeersConCht -> AddValuesCnt(QPen("#055"), i18n("Average connected seeders per running torrent")); + pmPeersConCht -> AddValuesCnt(TQPen("#f00"), i18n("Leechers connected")); + pmPeersConCht -> AddValuesCnt(TQPen("#900"), i18n("Leechers in swarms")); + pmPeersConCht -> AddValuesCnt(TQPen("#00f"), i18n("Seeders connected")); + pmPeersConCht -> AddValuesCnt(TQPen("#009"), i18n("Seeders in swarms")); + pmPeersConCht -> AddValuesCnt(TQPen("#0a0"), i18n("Average connected leechers per torrent")); + pmPeersConCht -> AddValuesCnt(TQPen("#060"), i18n("Average connected seeders per torrent")); + pmPeersConCht -> AddValuesCnt(TQPen("#099"), i18n("Average connected leechers per running torrent")); + pmPeersConCht -> AddValuesCnt(TQPen("#055"), i18n("Average connected seeders per running torrent")); pmDHTCht -> SetUnitName("n"); - pmDHTCht -> AddValuesCnt(QPen("#f00"), i18n("Nodes")); - pmDHTCht -> AddValuesCnt(QPen("#00f"), i18n("Tasks")); + pmDHTCht -> AddValuesCnt(TQPen("#f00"), i18n("Nodes")); + pmDHTCht -> AddValuesCnt(TQPen("#00f"), i18n("Tasks")); } StatsCon::~StatsCon() diff --git a/plugins/stats/StatsCon.h b/plugins/stats/StatsCon.h index 9d60048..da984f1 100644 --- a/plugins/stats/StatsCon.h +++ b/plugins/stats/StatsCon.h @@ -21,10 +21,10 @@ #ifndef STATSCON_H_ #define STATSCON_H_ -#include <qwidget.h> -#include <qlayout.h> -#include <qtabwidget.h> -#include <qgroupbox.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqtabwidget.h> +#include <tqgroupbox.h> #include "statspluginsettings.h" #include "statsconwgt.h" @@ -35,11 +35,12 @@ namespace kt { class StatsCon : public StatsConWgt { Q_OBJECT + TQ_OBJECT private: ///Layout of peers connections - QVBoxLayout * pmPeersConLay; + TQVBoxLayout * pmPeersConLay; ///Layout of DHT stats - QVBoxLayout * pmDHTLay; + TQVBoxLayout * pmDHTLay; ///Chart widget of peers connted ChartDrawer * pmPeersConCht; @@ -47,7 +48,7 @@ class StatsCon : public StatsConWgt ChartDrawer * pmDHTCht; public: - StatsCon(QWidget * p = 0); + StatsCon(TQWidget * p = 0); virtual ~StatsCon(); /** \brief Adds value to peers connections chart diff --git a/plugins/stats/StatsPluginPrefs.cc b/plugins/stats/StatsPluginPrefs.cc index 07cfa23..1d501a6 100644 --- a/plugins/stats/StatsPluginPrefs.cc +++ b/plugins/stats/StatsPluginPrefs.cc @@ -54,9 +54,9 @@ bool StatsPluginPrefs::apply () return true; } -void StatsPluginPrefs::createWidget (QWidget *parent) +void StatsPluginPrefs::createWidget (TQWidget *tqparent) { - pmUi = new StatsPluginPrefsPage(parent); + pmUi = new StatsPluginPrefsPage(tqparent); } void StatsPluginPrefs::updateData () diff --git a/plugins/stats/StatsPluginPrefs.h b/plugins/stats/StatsPluginPrefs.h index 6d563ec..2eabcac 100644 --- a/plugins/stats/StatsPluginPrefs.h +++ b/plugins/stats/StatsPluginPrefs.h @@ -21,9 +21,9 @@ #ifndef STATSPLUGINPREFS_H_ #define STATSPLUGINPREFS_H_ -#include <qspinbox.h> -#include <qcheckbox.h> -#include <qcombobox.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> #include <klocale.h> #include <kglobal.h> @@ -40,9 +40,10 @@ namespace kt { \brief Prefs page \author Krzysztof Kundzicz <[email protected]> */ -class StatsPluginPrefs : public QObject, public PrefPageInterface +class StatsPluginPrefs : public TQObject, public PrefPageInterface { Q_OBJECT + TQ_OBJECT private: ///Widget @@ -54,7 +55,7 @@ class StatsPluginPrefs : public QObject, public PrefPageInterface virtual ~StatsPluginPrefs(); virtual bool apply (); - virtual void createWidget (QWidget *parent); + virtual void createWidget (TQWidget *tqparent); virtual void updateData (); virtual void deleteWidget (); signals: diff --git a/plugins/stats/StatsPluginPrefsPage.cc b/plugins/stats/StatsPluginPrefsPage.cc index 1278127..e641349 100644 --- a/plugins/stats/StatsPluginPrefsPage.cc +++ b/plugins/stats/StatsPluginPrefsPage.cc @@ -22,7 +22,7 @@ namespace kt { -StatsPluginPrefsPage::StatsPluginPrefsPage(QWidget *p) : sprefwgt(p) +StatsPluginPrefsPage::StatsPluginPrefsPage(TQWidget *p) : sprefwgt(p) { } diff --git a/plugins/stats/StatsPluginPrefsPage.h b/plugins/stats/StatsPluginPrefsPage.h index 59bd9f1..eca849f 100644 --- a/plugins/stats/StatsPluginPrefsPage.h +++ b/plugins/stats/StatsPluginPrefsPage.h @@ -36,7 +36,7 @@ class StatsPluginPrefsPage : public sprefwgt \brief Constructor \param p Parent */ - StatsPluginPrefsPage(QWidget * p = 0); + StatsPluginPrefsPage(TQWidget * p = 0); }; } diff --git a/plugins/stats/StatsSpd.cc b/plugins/stats/StatsSpd.cc index e4f9d53..0ea427a 100644 --- a/plugins/stats/StatsSpd.cc +++ b/plugins/stats/StatsSpd.cc @@ -22,29 +22,29 @@ namespace kt { -StatsSpd::StatsSpd(QWidget *p) : StatsSpdWgt(p), +StatsSpd::StatsSpd(TQWidget *p) : StatsSpdWgt(p), pmDownCht(new ChartDrawer(DownSpeedGbw, StatsPluginSettings::downloadMeasurements())), pmPeersSpdCht(new ChartDrawer(PeersSpdGbw, StatsPluginSettings::peersSpeedMeasurements())), pmUpCht(new ChartDrawer(UpSpeedGbw, StatsPluginSettings::uploadMeasurements())) { DownSpeedGbw->setColumnLayout(0, Qt::Vertical ); - DownSpeedGbw->layout()->setSpacing( 6 ); - DownSpeedGbw->layout()->setMargin( 11 ); + DownSpeedGbw->tqlayout()->setSpacing( 6 ); + DownSpeedGbw->tqlayout()->setMargin( 11 ); - pmDSpdLay = new QVBoxLayout(DownSpeedGbw -> layout()); + pmDSpdLay = new TQVBoxLayout(DownSpeedGbw -> tqlayout()); UpSpeedGbw->setColumnLayout(0, Qt::Vertical ); - UpSpeedGbw->layout()->setSpacing( 6 ); - UpSpeedGbw->layout()->setMargin( 11 ); + UpSpeedGbw->tqlayout()->setSpacing( 6 ); + UpSpeedGbw->tqlayout()->setMargin( 11 ); - pmUSpdLay = new QVBoxLayout(UpSpeedGbw -> layout()); + pmUSpdLay = new TQVBoxLayout(UpSpeedGbw -> tqlayout()); PeersSpdGbw->setColumnLayout(0, Qt::Vertical ); - PeersSpdGbw->layout()->setSpacing( 6 ); - PeersSpdGbw->layout()->setMargin( 11 ); + PeersSpdGbw->tqlayout()->setSpacing( 6 ); + PeersSpdGbw->tqlayout()->setMargin( 11 ); - pmPeersSpdLay = new QVBoxLayout(PeersSpdGbw -> layout()); + pmPeersSpdLay = new TQVBoxLayout(PeersSpdGbw -> tqlayout()); //----------------- @@ -54,25 +54,25 @@ StatsSpd::StatsSpd(QWidget *p) : StatsSpdWgt(p), // ---------------- - pmUpCht -> AddValuesCnt(QPen("#f00"), i18n("Current")); - pmDownCht -> AddValuesCnt(QPen("#f00"), i18n("Current")); + pmUpCht -> AddValuesCnt(TQPen("#f00"), i18n("Current")); + pmDownCht -> AddValuesCnt(TQPen("#f00"), i18n("Current")); - pmUpCht -> AddValuesCnt(QPen("#00f"), i18n("Average")); - pmDownCht -> AddValuesCnt(QPen("#00f"), i18n("Average")); + pmUpCht -> AddValuesCnt(TQPen("#00f"), i18n("Average")); + pmDownCht -> AddValuesCnt(TQPen("#00f"), i18n("Average")); pmUpCht -> AddValuesCnt(i18n("Limit"), 0); pmDownCht -> AddValuesCnt(i18n("Limit"), 0); -// pmUpCht -> AddValuesCnt(QPen("#f0f"), i18n("Current torrent")); -// pmDownCht -> AddValuesCnt(QPen("#f0f"), i18n("Current torrent")); +// pmUpCht -> AddValuesCnt(TQPen("#f0f"), i18n("Current torrent")); +// pmDownCht -> AddValuesCnt(TQPen("#f0f"), i18n("Current torrent")); // - pmPeersSpdCht -> AddValuesCnt(QPen("#090"), i18n("Average from leecher")); - pmPeersSpdCht -> AddValuesCnt(QPen("#f00"), i18n("Average to leecher")); - pmPeersSpdCht -> AddValuesCnt(QPen("#00f"), i18n("Average from seeder")); - pmPeersSpdCht -> AddValuesCnt(QPen("magenta"), i18n("From leechers")); - pmPeersSpdCht -> AddValuesCnt(QPen("orange"), i18n("From seeders")); + pmPeersSpdCht -> AddValuesCnt(TQPen("#090"), i18n("Average from leecher")); + pmPeersSpdCht -> AddValuesCnt(TQPen("#f00"), i18n("Average to leecher")); + pmPeersSpdCht -> AddValuesCnt(TQPen("#00f"), i18n("Average from seeder")); + pmPeersSpdCht -> AddValuesCnt(TQPen("magenta"), i18n("From leechers")); + pmPeersSpdCht -> AddValuesCnt(TQPen("orange"), i18n("From seeders")); } diff --git a/plugins/stats/StatsSpd.h b/plugins/stats/StatsSpd.h index 7ba8d43..971209a 100644 --- a/plugins/stats/StatsSpd.h +++ b/plugins/stats/StatsSpd.h @@ -21,10 +21,10 @@ #ifndef STATSSPD_H_ #define STATSSPD_H_ -#include <qwidget.h> -#include <qlayout.h> -#include <qtabwidget.h> -#include <qgroupbox.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqtabwidget.h> +#include <tqgroupbox.h> #include "statspluginsettings.h" #include "statsspdwgt.h" @@ -39,14 +39,15 @@ namespace kt { class StatsSpd : public StatsSpdWgt { Q_OBJECT + TQ_OBJECT private: ///Layout of upload speed - QVBoxLayout * pmUSpdLay; + TQVBoxLayout * pmUSpdLay; ///Layout of down speed - QVBoxLayout * pmDSpdLay; + TQVBoxLayout * pmDSpdLay; ///Layout of peers speed - QVBoxLayout * pmPeersSpdLay; + TQVBoxLayout * pmPeersSpdLay; ///Chart widget of download speed ChartDrawer * pmDownCht; @@ -60,7 +61,7 @@ class StatsSpd : public StatsSpdWgt \brief Constructor \param p Parent */ - StatsSpd(QWidget *p = 0); + StatsSpd(TQWidget *p = 0); ///Destructor virtual ~StatsSpd(); diff --git a/plugins/stats/sprefwgt.ui b/plugins/stats/sprefwgt.ui index 7b6674a..4ee3641 100644 --- a/plugins/stats/sprefwgt.ui +++ b/plugins/stats/sprefwgt.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>sprefwgt</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>sprefwgt</cstring> </property> @@ -19,7 +19,7 @@ <property name="spacing"> <number>0</number> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -30,15 +30,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -49,7 +49,7 @@ <cstring>GuiUpdatesSbw</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>GuiUpdatesSbw</cstring> </property> @@ -63,7 +63,7 @@ <number>4</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -76,15 +76,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -95,7 +95,7 @@ <cstring>spinBox2</cstring> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>DataIvalSbw</cstring> </property> @@ -112,7 +112,7 @@ <number>1000</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -127,7 +127,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox5</cstring> </property> @@ -138,15 +138,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout11</cstring> + <cstring>tqlayout11</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_4</cstring> </property> @@ -154,7 +154,7 @@ <string>Maximum speed scale mode:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <item> <property name="text"> <string>Top</string> @@ -184,7 +184,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -195,15 +195,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>PeersSpdCbw</cstring> </property> @@ -214,7 +214,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -222,7 +222,7 @@ <string>update every</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>PeersSpdUpdIvalSbw</cstring> </property> @@ -236,7 +236,7 @@ <number>4</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -246,20 +246,20 @@ </widget> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel3_2</cstring> </property> <property name="text"> <string>Gathering data about many connected peers can be CPU consuming.</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignVCenter</set> </property> </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox11</cstring> </property> @@ -273,15 +273,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>ConnSdrInSwaCbw</cstring> </property> @@ -289,7 +289,7 @@ <string>Show seeders in swarms</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>ConnLchInSwaCbw</cstring> </property> @@ -301,7 +301,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox8</cstring> </property> @@ -312,15 +312,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -328,7 +328,7 @@ <string>Download</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>DownloadMrmtSbw</cstring> </property> @@ -344,15 +344,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> - <cstring>layout5_2</cstring> + <cstring>tqlayout5_2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_2</cstring> </property> @@ -360,7 +360,7 @@ <string>Peers speed</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>PeersSpdMrmtSbw</cstring> </property> @@ -376,15 +376,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> - <cstring>layout5_3</cstring> + <cstring>tqlayout5_3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_3</cstring> </property> @@ -392,7 +392,7 @@ <string>Upload</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>UploadMrmtSbw</cstring> </property> @@ -408,15 +408,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> - <cstring>layout5_5</cstring> + <cstring>tqlayout5_5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_5</cstring> </property> @@ -424,7 +424,7 @@ <string>Connections</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>ConnsMrmtSbw</cstring> </property> @@ -440,15 +440,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="1" column="1"> + <widget class="TQLayoutWidget" row="1" column="1"> <property name="name"> - <cstring>layout5_4</cstring> + <cstring>tqlayout5_4</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3_4</cstring> </property> @@ -456,7 +456,7 @@ <string>DHT</string> </property> </widget> - <widget class="QSpinBox"> + <widget class="TQSpinBox"> <property name="name"> <cstring>DHTMrmtSbw</cstring> </property> @@ -484,7 +484,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -513,5 +513,5 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/stats/statsconwgt.ui b/plugins/stats/statsconwgt.ui index 07753dc..84f5d55 100644 --- a/plugins/stats/statsconwgt.ui +++ b/plugins/stats/statsconwgt.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>StatsConWgt</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>StatsConWgt</cstring> </property> @@ -16,15 +16,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>PeersConGbw</cstring> </property> @@ -32,7 +32,7 @@ <string>Peers</string> </property> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>DHTGbw</cstring> </property> @@ -44,5 +44,5 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/stats/statsplugin.cc b/plugins/stats/statsplugin.cc index d3d1b03..224d736 100644 --- a/plugins/stats/statsplugin.cc +++ b/plugins/stats/statsplugin.cc @@ -25,8 +25,8 @@ K_EXPORT_COMPONENT_FACTORY(ktstatsplugin, KGenericFactory<kt::StatsPlugin>("ktst namespace kt { -StatsPlugin::StatsPlugin(QObject* parent, const char* qt_name, const QStringList& args): - Plugin(parent, qt_name, args, "Statistics", i18n("Statistics"),"Krzysztof Kundzicz", "[email protected]", i18n("Shows transfers statistics"),"ktimemon"), pmUiSpd(0), pmUiCon(0), pmPrefsUi(0), pmUpdTmr(0) +StatsPlugin::StatsPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args): + Plugin(tqparent, qt_name, args, "Statistics", i18n("Statistics"),"Krzysztof Kundzicz", "[email protected]", i18n("Shows transfers statistics"),"ktimemon"), pmUiSpd(0), pmUiCon(0), pmPrefsUi(0), pmUpdTmr(0) { mUpAvg = std::make_pair(0.0, 0.0); mDownAvg = std::make_pair(0.0, 0.0); @@ -46,18 +46,18 @@ void StatsPlugin::load() mUpdCtr = 1; mPeerSpdUpdCtr = 1; - pmUiSpd = new StatsSpd(dynamic_cast<QWidget *>(parent())); - pmUiCon = new StatsCon(dynamic_cast<QWidget *>(parent())); + pmUiSpd = new StatsSpd(dynamic_cast<TQWidget *>(tqparent())); + pmUiCon = new StatsCon(dynamic_cast<TQWidget *>(tqparent())); pmPrefsUi = new StatsPluginPrefs(); - pmUpdTmr = new QTimer(this); + pmUpdTmr = new TQTimer(this); - connect(pmUpdTmr, SIGNAL(timeout () ), this, SLOT(UpdateData())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(RestartTimer())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(TogglePeersSpdCht())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ToggleLchInSwmDrawing())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ToggleSdrInSwmDrawing())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ChangeMsmtsCounts())); - connect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ChangeMaxMode())); + connect(pmUpdTmr, TQT_SIGNAL(timeout () ), this, TQT_SLOT(UpdateData())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(RestartTimer())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(TogglePeersSpdCht())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleLchInSwmDrawing())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleSdrInSwmDrawing())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMsmtsCounts())); + connect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMaxMode())); TogglePeersSpdCht(); ChangeMaxMode(); @@ -76,13 +76,13 @@ void StatsPlugin::unload() getGUI() -> removeToolWidget(pmUiCon); getGUI() -> removePrefPage(pmPrefsUi); - disconnect(pmUpdTmr, SIGNAL(timeout()), this, SLOT(UpdateData())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(RestartTimer())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(TogglePeersSpdCht())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ToggleLchInSwmDrawing())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ToggleSdrInSwmDrawing())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ChangeMsmtsCounts())); - disconnect(pmPrefsUi, SIGNAL(Applied()), this, SLOT(ChangeMaxMode())); + disconnect(pmUpdTmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(UpdateData())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(RestartTimer())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(TogglePeersSpdCht())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleLchInSwmDrawing())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ToggleSdrInSwmDrawing())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMsmtsCounts())); + disconnect(pmPrefsUi, TQT_SIGNAL(Applied()), this, TQT_SLOT(ChangeMaxMode())); delete pmUiSpd; delete pmUiCon; @@ -90,7 +90,7 @@ void StatsPlugin::unload() delete pmUpdTmr; } -bool StatsPlugin::versionCheck(const QString& rVer) const +bool StatsPlugin::versionCheck(const TQString& rVer) const { return rVer == KT_VERSION_MACRO; } diff --git a/plugins/stats/statsplugin.h b/plugins/stats/statsplugin.h index 14f1fcd..df482a7 100644 --- a/plugins/stats/statsplugin.h +++ b/plugins/stats/statsplugin.h @@ -23,8 +23,8 @@ #include <kgenericfactory.h> -#include <qwidget.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqtimer.h> #include <interfaces/plugin.h> #include <interfaces/guiinterface.h> @@ -52,6 +52,7 @@ namespace kt { class StatsPlugin : public Plugin { Q_OBJECT + TQ_OBJECT private: ///Speed UI of the plugin @@ -104,7 +105,7 @@ class StatsPlugin : public Plugin std::pair<uint32_t, uint32_t> mRunningSeedAvg; ///Data update timer - QTimer * pmUpdTmr; + TQTimer * pmUpdTmr; ///Update ctr uint32_t mUpdCtr; @@ -133,17 +134,17 @@ class StatsPlugin : public Plugin public: /** \brief Constructor - \param parent Parent + \param tqparent Parent \param qt_name \param args */ - StatsPlugin(QObject* parent, const char* qt_name, const QStringList& args); + StatsPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args); ///Destructor virtual ~StatsPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString&) const; + virtual bool versionCheck(const TQString&) const; virtual void guiUpdate(); }; diff --git a/plugins/stats/statsspdwgt.ui b/plugins/stats/statsspdwgt.ui index 162bf9c..c31124d 100644 --- a/plugins/stats/statsspdwgt.ui +++ b/plugins/stats/statsspdwgt.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>StatsSpdWgt</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>StatsSpdWgt</cstring> </property> @@ -16,15 +16,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>DownSpeedGbw</cstring> </property> @@ -32,7 +32,7 @@ <string>Download</string> </property> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>PeersSpdGbw</cstring> </property> @@ -40,7 +40,7 @@ <string>Peers</string> </property> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>UpSpeedGbw</cstring> </property> @@ -52,5 +52,5 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/plugins/upnp/soap.cpp b/plugins/upnp/soap.cpp index b155b55..f80d5af 100644 --- a/plugins/upnp/soap.cpp +++ b/plugins/upnp/soap.cpp @@ -22,32 +22,32 @@ namespace kt { - QString SOAP::createCommand(const QString & action,const QString & service) + TQString SOAP::createCommand(const TQString & action,const TQString & service) { - QString comm = QString("<?xml version=\"1.0\"?>\r\n" + TQString comm = TQString("<?xml version=\"1.0\"?>\r\n" "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" "<SOAP-ENV:Body>" "<m:%1 xmlns:m=\"%2\"/>" "</SOAP-ENV:Body></SOAP-ENV:Envelope>" - "\r\n").arg(action).arg(service); + "\r\n").tqarg(action).tqarg(service); return comm; } - QString SOAP::createCommand(const QString & action,const QString & service,const QValueList<Arg> & args) + TQString SOAP::createCommand(const TQString & action,const TQString & service,const TQValueList<Arg> & args) { - QString comm = QString("<?xml version=\"1.0\"?>\r\n" + TQString comm = TQString("<?xml version=\"1.0\"?>\r\n" "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" "<SOAP-ENV:Body>" - "<m:%1 xmlns:m=\"%2\">").arg(action).arg(service); + "<m:%1 xmlns:m=\"%2\">").tqarg(action).tqarg(service); - for (QValueList<Arg>::const_iterator i = args.begin();i != args.end();i++) + for (TQValueList<Arg>::const_iterator i = args.begin();i != args.end();i++) { const Arg & a = *i; comm += "<" + a.element + ">" + a.value + "</" + a.element + ">"; } - comm += QString("</m:%1></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n").arg(action); + comm += TQString("</m:%1></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n").tqarg(action); return comm; } } diff --git a/plugins/upnp/soap.h b/plugins/upnp/soap.h index c11e2ed..6632342 100644 --- a/plugins/upnp/soap.h +++ b/plugins/upnp/soap.h @@ -20,8 +20,8 @@ #ifndef KTSOAP_H #define KTSOAP_H -#include <qvaluelist.h> -#include <qstring.h> +#include <tqvaluelist.h> +#include <tqstring.h> namespace kt { @@ -39,12 +39,12 @@ namespace kt * @param service The name of the service * @return The command */ - static QString createCommand(const QString & action,const QString & service); + static TQString createCommand(const TQString & action,const TQString & service); struct Arg { - QString element; - QString value; + TQString element; + TQString value; }; /** @@ -54,7 +54,7 @@ namespace kt * @param args Arguments for command * @return The command */ - static QString createCommand(const QString & action,const QString & service,const QValueList<Arg> & args); + static TQString createCommand(const TQString & action,const TQString & service,const TQValueList<Arg> & args); }; } diff --git a/plugins/upnp/upnpdescriptionparser.cpp b/plugins/upnp/upnpdescriptionparser.cpp index 43afbc3..bd933a4 100644 --- a/plugins/upnp/upnpdescriptionparser.cpp +++ b/plugins/upnp/upnpdescriptionparser.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qxml.h> -#include <qvaluestack.h> +#include <tqxml.h> +#include <tqvaluestack.h> #include <util/fileops.h> #include <util/log.h> #include <torrent/globals.h> @@ -30,17 +30,17 @@ using namespace bt; namespace kt { - class XMLContentHandler : public QXmlDefaultHandler + class XMLContentHandler : public TQXmlDefaultHandler { - enum Status + enum tqStatus { TOPLEVEL,ROOT,DEVICE,SERVICE,FIELD,OTHER }; - QString tmp; + TQString tmp; UPnPRouter* router; UPnPService curr_service; - QValueStack<Status> status_stack; + TQValueStack<tqStatus> status_stack; public: XMLContentHandler(UPnPRouter* router); virtual ~XMLContentHandler(); @@ -48,13 +48,13 @@ namespace kt bool startDocument(); bool endDocument(); - bool startElement(const QString &, const QString & localName, const QString &, - const QXmlAttributes & atts); - bool endElement(const QString & , const QString & localName, const QString & ); - bool characters(const QString & ch); + bool startElement(const TQString &, const TQString & localName, const TQString &, + const TQXmlAttributes & atts); + bool endElement(const TQString & , const TQString & localName, const TQString & ); + bool characters(const TQString & ch); - bool interestingDeviceField(const QString & name); - bool interestingServiceField(const QString & name); + bool interestingDeviceField(const TQString & name); + bool interestingServiceField(const TQString & name); }; @@ -65,17 +65,17 @@ namespace kt UPnPDescriptionParser::~UPnPDescriptionParser() {} - bool UPnPDescriptionParser::parse(const QString & file,UPnPRouter* router) + bool UPnPDescriptionParser::parse(const TQString & file,UPnPRouter* router) { bool ret = true; { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_ReadOnly)) return false; - QXmlInputSource input(&fptr); + TQXmlInputSource input(TQT_TQIODEVICE(&fptr)); XMLContentHandler chandler(router); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler(&chandler); ret = reader.parse(&input,false); @@ -111,21 +111,21 @@ namespace kt return true; } - bool XMLContentHandler::interestingDeviceField(const QString & name) + bool XMLContentHandler::interestingDeviceField(const TQString & name) { return name == "friendlyName" || name == "manufacturer" || name == "modelDescription" || name == "modelName" || name == "modelNumber"; } - bool XMLContentHandler::interestingServiceField(const QString & name) + bool XMLContentHandler::interestingServiceField(const TQString & name) { return name == "serviceType" || name == "serviceId" || name == "SCPDURL" || name == "controlURL" || name == "eventSubURL"; } - bool XMLContentHandler::startElement(const QString &, const QString & localName, const QString &, - const QXmlAttributes & ) + bool XMLContentHandler::startElement(const TQString &, const TQString & localName, const TQString &, + const TQXmlAttributes & ) { tmp = ""; switch (status_stack.top()) @@ -172,7 +172,7 @@ namespace kt return true; } - bool XMLContentHandler::endElement(const QString & , const QString & localName, const QString & ) + bool XMLContentHandler::endElement(const TQString & , const TQString & localName, const TQString & ) { switch (status_stack.top()) { @@ -208,7 +208,7 @@ namespace kt } - bool XMLContentHandler::characters(const QString & ch) + bool XMLContentHandler::characters(const TQString & ch) { if (ch.length() > 0) { diff --git a/plugins/upnp/upnpdescriptionparser.h b/plugins/upnp/upnpdescriptionparser.h index 5d4bf1e..2aaacfe 100644 --- a/plugins/upnp/upnpdescriptionparser.h +++ b/plugins/upnp/upnpdescriptionparser.h @@ -41,7 +41,7 @@ namespace kt * @param router The router off the xml description * @return true upon success */ - bool parse(const QString & file,UPnPRouter* router); + bool parse(const TQString & file,UPnPRouter* router); }; } diff --git a/plugins/upnp/upnpmcastsocket.cpp b/plugins/upnp/upnpmcastsocket.cpp index 47712ea..6395752 100644 --- a/plugins/upnp/upnpmcastsocket.cpp +++ b/plugins/upnp/upnpmcastsocket.cpp @@ -19,24 +19,25 @@ ***************************************************************************/ #include <kurl.h> -#include <unistd.h> +extern "C" { + #include <unistd.h> + inline ssize_t mycread (int __fd, void *__buf, size_t __nbytes) { read(__fd, __buf, __nbytes); } +}; #include <sys/socket.h> #include <netinet/in.h> -#include <netinet/in_systm.h> +#include <netinet/in_systm.h> #include <netinet/ip.h> #include <arpa/inet.h> #include <netinet/ip.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <ksocketdevice.h> #include <ksocketaddress.h> #include <util/log.h> #include <torrent/globals.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> #include "upnpmcastsocket.h" - - using namespace KNetwork; using namespace bt; @@ -46,14 +47,14 @@ namespace kt UPnPMCastSocket::UPnPMCastSocket(bool verbose) : verbose(verbose) { routers.setAutoDelete(true); - QObject::connect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); - QObject::connect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); + TQObject::connect(this,TQT_SIGNAL(readyRead()),this,TQT_SLOT(onReadyRead())); + TQObject::connect(this,TQT_SIGNAL(gotError(int)),this,TQT_SLOT(onError(int))); setAddressReuseable(true); setFamily(KNetwork::KResolver::IPv4Family); setBlocking(true); for (Uint32 i = 0;i < 10;i++) { - if (!bind(QString::null,QString::number(1900 + i))) + if (!bind(TQString(),TQString::number(1900 + i))) Out(SYS_PNP|LOG_IMPORTANT) << "Cannot bind to UDP port 1900" << endl; else break; @@ -66,8 +67,8 @@ namespace kt UPnPMCastSocket::~UPnPMCastSocket() { leaveUPnPMCastGroup(); - QObject::disconnect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead())); - QObject::disconnect(this,SIGNAL(gotError(int)),this,SLOT(onError(int))); + TQObject::disconnect(this,TQT_SIGNAL(readyRead()),this,TQT_SLOT(onReadyRead())); + TQObject::disconnect(this,TQT_SIGNAL(gotError(int)),this,TQT_SLOT(onError(int))); } void UPnPMCastSocket::discover() @@ -102,7 +103,7 @@ namespace kt else { // add it to the list and emit the signal - if (!routers.contains(r->getServer())) + if (!routers.tqcontains(r->getServer())) { routers.insert(r->getServer(),r); discovered(r); @@ -123,7 +124,7 @@ namespace kt // so we need to deal with it oursleves int fd = socketDevice()->socket(); char tmp; - read(fd,&tmp,1); + mycread(fd,&tmp,1); return; } @@ -134,25 +135,25 @@ namespace kt if (verbose) { Out(SYS_PNP|LOG_NOTICE) << "Received : " << endl; - Out(SYS_PNP|LOG_NOTICE) << QString(p.data()) << endl; + Out(SYS_PNP|LOG_NOTICE) << TQString(p.data()) << endl; } // try to make a router of it UPnPRouter* r = parseResponse(p.data()); if (r) { - QObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )), - this,SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); + TQObject::connect(r,TQT_SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )), + this,TQT_SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); // download it's xml file r->downloadXMLFile(); } } - UPnPRouter* UPnPMCastSocket::parseResponse(const QByteArray & arr) + UPnPRouter* UPnPMCastSocket::parseResponse(const TQByteArray & arr) { - QStringList lines = QStringList::split("\r\n",QString(arr),false); - QString server; + TQStringList lines = TQStringList::split("\r\n",TQString(arr),false); + TQString server; KURL location; /* @@ -162,14 +163,14 @@ namespace kt */ // first read first line and see if contains a HTTP 200 OK message - QString line = lines.first(); - if (!line.contains("HTTP")) + TQString line = lines.first(); + if (!line.tqcontains("HTTP")) { // it is either a 200 OK or a NOTIFY - if (!line.contains("NOTIFY") && !line.contains("200")) + if (!line.tqcontains("NOTIFY") && !line.tqcontains("200")) return 0; } - else if (line.contains("M-SEARCH")) // ignore M-SEARCH + else if (line.tqcontains("M-SEARCH")) // ignore M-SEARCH return 0; // quick check that the response being parsed is valid @@ -177,7 +178,7 @@ namespace kt for (Uint32 idx = 0;idx < lines.count() && !validDevice; idx++) { line = lines[idx]; - if ((line.contains("ST:") || line.contains("NT:")) && line.contains("InternetGatewayDevice")) + if ((line.tqcontains("ST:") || line.tqcontains("NT:")) && line.tqcontains("InternetGatewayDevice")) { validDevice = true; } @@ -194,20 +195,20 @@ namespace kt line = lines[i]; if (line.startsWith("Location") || line.startsWith("LOCATION") || line.startsWith("location")) { - location = line.mid(line.find(':') + 1).stripWhiteSpace(); + location = line.mid(line.tqfind(':') + 1).stripWhiteSpace(); if (!location.isValid()) return 0; } else if (line.startsWith("Server") || line.startsWith("server") || line.startsWith("SERVER")) { - server = line.mid(line.find(':') + 1).stripWhiteSpace(); + server = line.mid(line.tqfind(':') + 1).stripWhiteSpace(); if (server.length() == 0) return 0; } } - if (routers.contains(server)) + if (routers.tqcontains(server)) { return 0; } @@ -221,22 +222,22 @@ namespace kt void UPnPMCastSocket::onError(int) { - Out(SYS_PNP|LOG_IMPORTANT) << "UPnPMCastSocket Error : " << errorString() << endl; + Out(SYS_PNP|LOG_IMPORTANT) << "UPnPMCastSocket Error : " << KSocketBase::errorString() << endl; } - void UPnPMCastSocket::saveRouters(const QString & file) + void UPnPMCastSocket::saveRouters(const TQString & file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_WriteOnly)) { - Out(SYS_PNP|LOG_IMPORTANT) << "Cannot open file " << file << " : " << fptr.errorString() << endl; + Out(SYS_PNP|LOG_IMPORTANT) << "Cannot open file " << file << " : " << TQString(fptr.errorString()) << endl; return; } // file format is simple : 2 lines per router, // one containing the server, the other the location - QTextStream fout(&fptr); - bt::PtrMap<QString,UPnPRouter>::iterator i = routers.begin(); + TQTextStream fout(&fptr); + bt::PtrMap<TQString,UPnPRouter>::iterator i = routers.begin(); while (i != routers.end()) { UPnPRouter* r = i->second; @@ -246,29 +247,29 @@ namespace kt } } - void UPnPMCastSocket::loadRouters(const QString & file) + void UPnPMCastSocket::loadRouters(const TQString & file) { - QFile fptr(file); + TQFile fptr(file); if (!fptr.open(IO_ReadOnly)) { - Out(SYS_PNP|LOG_IMPORTANT) << "Cannot open file " << file << " : " << fptr.errorString() << endl; + Out(SYS_PNP|LOG_IMPORTANT) << "Cannot open file " << file << " : " << TQString(fptr.errorString()) << endl; return; } // file format is simple : 2 lines per router, // one containing the server, the other the location - QTextStream fin(&fptr); + TQTextStream fin(&fptr); while (!fin.atEnd()) { - QString server, location; + TQString server, location; server = fin.readLine(); location = fin.readLine(); - if (!routers.contains(server)) + if (!routers.tqcontains(server)) { UPnPRouter* r = new UPnPRouter(server,location); // download it's xml file - QObject::connect(r,SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )),this,SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); + TQObject::connect(r,TQT_SIGNAL(xmlFileDownloaded( UPnPRouter*, bool )),this,TQT_SLOT(onXmlFileDownloaded( UPnPRouter*, bool ))); r->downloadXMLFile(); } } diff --git a/plugins/upnp/upnpmcastsocket.h b/plugins/upnp/upnpmcastsocket.h index 493c5b9..86688a2 100644 --- a/plugins/upnp/upnpmcastsocket.h +++ b/plugins/upnp/upnpmcastsocket.h @@ -40,6 +40,7 @@ namespace kt class UPnPMCastSocket : public KNetwork::KDatagramSocket { Q_OBJECT + TQ_OBJECT public: UPnPMCastSocket(bool verbose = false); virtual ~UPnPMCastSocket(); @@ -48,13 +49,13 @@ namespace kt Uint32 getNumDevicesDiscovered() const {return routers.count();} /// Find a router using it's server name - UPnPRouter* findDevice(const QString & name) {return routers.find(name);} + UPnPRouter* findDevice(const TQString & name) {return routers.tqfind(name);} /// Save all routers to a file (for convenience at startup) - void saveRouters(const QString & file); + void saveRouters(const TQString & file); /// Load all routers from a file - void loadRouters(const QString & file); + void loadRouters(const TQString & file); public slots: /** @@ -76,14 +77,14 @@ namespace kt void discovered(UPnPRouter* router); public: - UPnPRouter* parseResponse(const QByteArray & arr); + UPnPRouter* parseResponse(const TQByteArray & arr); private: void joinUPnPMCastGroup(); void leaveUPnPMCastGroup(); private: - bt::PtrMap<QString,UPnPRouter> routers; + bt::PtrMap<TQString,UPnPRouter> routers; bool verbose; }; } diff --git a/plugins/upnp/upnpplugin.cpp b/plugins/upnp/upnpplugin.cpp index dbe58b4..95df507 100644 --- a/plugins/upnp/upnpplugin.cpp +++ b/plugins/upnp/upnpplugin.cpp @@ -42,8 +42,8 @@ K_EXPORT_COMPONENT_FACTORY(ktupnpplugin,KGenericFactory<kt::UPnPPlugin>("ktupnpp namespace kt { - UPnPPlugin::UPnPPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("UPnP"),AUTHOR,EMAIL,i18n("Uses UPnP to automatically forward ports on your router"),"ktupnp") + UPnPPlugin::UPnPPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("UPnP"),AUTHOR,EMAIL,i18n("Uses UPnP to automatically forward ports on your router"),"ktupnp") { sock = 0; pref = 0; @@ -64,7 +64,7 @@ namespace kt pref = new UPnPPrefPage(sock); this->getGUI()->addPrefPage(pref); // load the routers list - QString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers"; + TQString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers"; if (bt::Exists(routers_file)) sock->loadRouters(routers_file); sock->discover(); @@ -72,7 +72,7 @@ namespace kt void UPnPPlugin::unload() { - QString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers"; + TQString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers"; sock->saveRouters(routers_file); this->getGUI()->removePrefPage(pref); sock->close(); @@ -87,7 +87,7 @@ namespace kt pref->shutdown(job); } - bool UPnPPlugin::versionCheck(const QString & version) const + bool UPnPPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/upnp/upnpplugin.h b/plugins/upnp/upnpplugin.h index a6ca78a..f6e10f0 100644 --- a/plugins/upnp/upnpplugin.h +++ b/plugins/upnp/upnpplugin.h @@ -33,14 +33,15 @@ namespace kt class UPnPPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - UPnPPlugin(QObject* parent, const char* name, const QStringList& args); + UPnPPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~UPnPPlugin(); virtual void load(); virtual void unload(); virtual void shutdown(bt::WaitJob* job); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; private: UPnPMCastSocket* sock; UPnPPrefPage* pref; diff --git a/plugins/upnp/upnpprefpage.cpp b/plugins/upnp/upnpprefpage.cpp index dc50c2f..aa7a241 100644 --- a/plugins/upnp/upnpprefpage.cpp +++ b/plugins/upnp/upnpprefpage.cpp @@ -43,11 +43,11 @@ namespace kt return true; } - void UPnPPrefPage::createWidget(QWidget* parent) + void UPnPPrefPage::createWidget(TQWidget* tqparent) { - widget = new UPnPPrefWidget(parent); - QObject::connect(sock,SIGNAL(discovered(UPnPRouter* )),widget,SLOT(addDevice(UPnPRouter* ))); - QObject::connect(widget,SIGNAL(rescan()),sock,SLOT(discover())); + widget = new UPnPPrefWidget(tqparent); + TQObject::connect(sock,TQT_SIGNAL(discovered(UPnPRouter* )),widget,TQT_SLOT(addDevice(UPnPRouter* ))); + TQObject::connect(widget,TQT_SIGNAL(rescan()),sock,TQT_SLOT(discover())); } void UPnPPrefPage::deleteWidget() diff --git a/plugins/upnp/upnpprefpage.h b/plugins/upnp/upnpprefpage.h index 7d5b4f5..abba967 100644 --- a/plugins/upnp/upnpprefpage.h +++ b/plugins/upnp/upnpprefpage.h @@ -46,7 +46,7 @@ namespace kt virtual ~UPnPPrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void deleteWidget(); virtual void updateData(); diff --git a/plugins/upnp/upnpprefwidget.cpp b/plugins/upnp/upnpprefwidget.cpp index 43e2aec..bd4e593 100644 --- a/plugins/upnp/upnpprefwidget.cpp +++ b/plugins/upnp/upnpprefwidget.cpp @@ -37,13 +37,13 @@ using namespace bt; namespace kt { - UPnPPrefWidget::UPnPPrefWidget(QWidget* parent, const char* name, WFlags fl) - : UPnPWidget(parent,name,fl) + UPnPPrefWidget::UPnPPrefWidget(TQWidget* tqparent, const char* name, WFlags fl) + : UPnPWidget(tqparent,name,fl) { def_router = 0; - connect(m_forward_btn,SIGNAL(clicked()),this,SLOT(onForwardBtnClicked())); - connect(m_undo_forward_btn,SIGNAL(clicked()),this,SLOT(onUndoForwardBtnClicked())); - connect(m_rescan,SIGNAL(clicked()),this,SLOT(onRescanClicked())); + connect(m_forward_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onForwardBtnClicked())); + connect(m_undo_forward_btn,TQT_SIGNAL(clicked()),this,TQT_SLOT(onUndoForwardBtnClicked())); + connect(m_rescan,TQT_SIGNAL(clicked()),this,TQT_SLOT(onRescanClicked())); bt::Globals::instance().getPortList().setListener(this); } @@ -72,13 +72,13 @@ namespace kt void UPnPPrefWidget::addDevice(UPnPRouter* r) { - connect(r,SIGNAL(updateGUI()),this,SLOT(updatePortMappings())); + connect(r,TQT_SIGNAL(updateGUI()),this,TQT_SLOT(updatePortMappings())); KListViewItem* item = new KListViewItem(m_device_list,r->getDescription().friendlyName); item->setMultiLinesEnabled(true); itemmap[item] = r; // if we have discovered the default device or there is none // forward it's ports - QString def_dev = UPnPPluginSettings::defaultDevice(); + TQString def_dev = UPnPPluginSettings::defaultDevice(); if (def_dev == r->getServer() || def_dev.length() == 0) { Out(SYS_PNP|LOG_DEBUG) << "Doing default port mappings ..." << endl; @@ -126,7 +126,7 @@ namespace kt r->forward(p); } - QString def_dev = UPnPPluginSettings::defaultDevice(); + TQString def_dev = UPnPPluginSettings::defaultDevice(); if (def_dev != r->getServer()) { UPnPPluginSettings::setDefaultDevice(r->getServer()); @@ -168,10 +168,10 @@ namespace kt r->undoForward(p,false); } - QString def_dev = UPnPPluginSettings::defaultDevice(); + TQString def_dev = UPnPPluginSettings::defaultDevice(); if (def_dev == r->getServer()) { - UPnPPluginSettings::setDefaultDevice(QString::null); + UPnPPluginSettings::setDefaultDevice(TQString()); UPnPPluginSettings::writeConfig(); def_router = 0; } @@ -186,22 +186,22 @@ namespace kt void UPnPPrefWidget::updatePortMappings() { // update all port mappings - QMap<KListViewItem*,UPnPRouter*>::iterator i = itemmap.begin(); + TQMap<KListViewItem*,UPnPRouter*>::iterator i = itemmap.begin(); while (i != itemmap.end()) { UPnPRouter* r = i.data(); KListViewItem* item = i.key(); - QString msg,services; - QValueList<UPnPRouter::Forwarding>::iterator j = r->beginPortMappings(); + TQString msg,services; + TQValueList<UPnPRouter::Forwarding>::iterator j = r->beginPortMappings(); while (j != r->endPortMappings()) { UPnPRouter::Forwarding & f = *j; if (!f.pending_req) { - msg += QString::number(f.port.number) + " ("; - QString prot = (f.port.proto == net::UDP ? "UDP" : "TCP"); + msg += TQString::number(f.port.number) + " ("; + TQString prot = (f.port.proto == net::UDP ? "UDP" : "TCP"); msg += prot + ")"; - if (f.service->servicetype.contains("WANPPPConnection")) + if (f.service->servicetype.tqcontains("WANPPPConnection")) services += "PPP"; else services += "IP"; diff --git a/plugins/upnp/upnpprefwidget.h b/plugins/upnp/upnpprefwidget.h index 16fa31b..4c2c954 100644 --- a/plugins/upnp/upnpprefwidget.h +++ b/plugins/upnp/upnpprefwidget.h @@ -21,7 +21,7 @@ #ifndef UPNPPREFWIDGET_H #define UPNPPREFWIDGET_H -#include <qmap.h> +#include <tqmap.h> #include "upnprouter.h" #include "upnpwidget.h" @@ -41,9 +41,10 @@ namespace kt class UPnPPrefWidget : public UPnPWidget,public net::PortListener { Q_OBJECT + TQ_OBJECT public: - UPnPPrefWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + UPnPPrefWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); virtual ~UPnPPrefWidget(); void shutdown(bt::WaitJob* job); @@ -74,7 +75,7 @@ namespace kt virtual void portRemoved(const net::Port & port); private: - QMap<KListViewItem*,UPnPRouter*> itemmap; + TQMap<KListViewItem*,UPnPRouter*> itemmap; UPnPRouter* def_router; }; } diff --git a/plugins/upnp/upnprouter.cpp b/plugins/upnp/upnprouter.cpp index 617abf5..e5593ea 100644 --- a/plugins/upnp/upnprouter.cpp +++ b/plugins/upnp/upnprouter.cpp @@ -21,7 +21,7 @@ #include <klocale.h> #include <kglobal.h> #include <kstandarddirs.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <kio/netaccess.h> #include <kio/job.h> #include <torrent/globals.h> @@ -54,7 +54,7 @@ namespace kt this->scpdurl = s.scpdurl; } - void UPnPService::setProperty(const QString & name,const QString & value) + void UPnPService::setProperty(const TQString & name,const TQString & value) { if (name == "serviceType") servicetype = value; @@ -94,7 +94,7 @@ namespace kt /////////////////////////////////////// - void UPnPDeviceDescription::setProperty(const QString & name,const QString & value) + void UPnPDeviceDescription::setProperty(const TQString & name,const TQString & value) { if (name == "friendlyName") friendlyName = value; @@ -110,16 +110,16 @@ namespace kt /////////////////////////////////////// - UPnPRouter::UPnPRouter(const QString & server,const KURL & location,bool verbose) : server(server),location(location),verbose(verbose) + UPnPRouter::UPnPRouter(const TQString & server,const KURL & location,bool verbose) : server(server),location(location),verbose(verbose) { // make the tmp_file unique, current time * a random number should be enough - tmp_file = QString("/tmp/ktorrent_upnp_description-%1.xml").arg(bt::GetCurrentTime() * rand()); + tmp_file = TQString("/tmp/ktorrent_upnp_description-%1.xml").tqarg(bt::GetCurrentTime() * rand()); } UPnPRouter::~UPnPRouter() { - QValueList<HTTPRequest*>::iterator i = active_reqs.begin(); + TQValueList<HTTPRequest*>::iterator i = active_reqs.begin(); while (i != active_reqs.end()) { (*i)->deleteLater(); @@ -129,7 +129,7 @@ namespace kt void UPnPRouter::addService(const UPnPService & s) { - QValueList<UPnPService>::iterator i = services.begin(); + TQValueList<UPnPService>::iterator i = services.begin(); while (i != services.end()) { UPnPService & os = *i; @@ -148,14 +148,14 @@ namespace kt return; } - QString target = tmp_file; + TQString target = tmp_file; // load in the file (target is always local) UPnPDescriptionParser desc_parse; bool ret = desc_parse.parse(target,this); if (!ret) { Out(SYS_PNP|LOG_IMPORTANT) << "Error parsing router description !" << endl; - QString dest = KGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure"; + TQString dest = KGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure"; KIO::file_copy(target,dest,-1,true,false,false); } else @@ -171,7 +171,7 @@ namespace kt { // downlaod XML description into a temporary file in /tmp KIO::Job* job = KIO::file_copy(location,tmp_file,-1,true,false,false); - connect(job,SIGNAL(result(KIO::Job *)),this,SLOT(downloadFinished( KIO::Job* ))); + connect(job,TQT_SIGNAL(result(KIO::Job *)),this,TQT_SLOT(downloadFinished( KIO::Job* ))); } void UPnPRouter::debugPrintData() @@ -182,7 +182,7 @@ namespace kt Out(SYS_PNP|LOG_DEBUG) << "Model description = " << desc.modelDescription << endl; Out(SYS_PNP|LOG_DEBUG) << "Model name = " << desc.modelName << endl; Out(SYS_PNP|LOG_DEBUG) << "Model number = " << desc.modelNumber << endl; - for (QValueList<UPnPService>::iterator i = services.begin();i != services.end();i++) + for (TQValueList<UPnPService>::iterator i = services.begin();i != services.end();i++) { UPnPService & s = *i; Out() << "Service : " << endl; @@ -196,14 +196,14 @@ namespace kt void UPnPRouter::forward(UPnPService* srv,const net::Port & port) { // add all the arguments for the command - QValueList<SOAP::Arg> args; + TQValueList<SOAP::Arg> args; SOAP::Arg a; a.element = "NewRemoteHost"; args.append(a); // the external port a.element = "NewExternalPort"; - a.value = QString::number(port.number); + a.value = TQString::number(port.number); args.append(a); // the protocol @@ -213,7 +213,7 @@ namespace kt // the local port a.element = "NewInternalPort"; - a.value = QString::number(port.number); + a.value = TQString::number(port.number); args.append(a); // the local IP address @@ -227,19 +227,19 @@ namespace kt a.element = "NewPortMappingDescription"; static Uint32 cnt = 0; - a.value = QString("KTorrent UPNP %1").arg(cnt++); // TODO: change this + a.value = TQString("KTorrent UPNP %1").tqarg(cnt++); // TODO: change this args.append(a); a.element = "NewLeaseDuration"; a.value = "0"; args.append(a); - QString action = "AddPortMapping"; - QString comm = SOAP::createCommand(action,srv->servicetype,args); + TQString action = "AddPortMapping"; + TQString comm = SOAP::createCommand(action,srv->servicetype,args); Forwarding fw = {port,0,srv}; // erase old forwarding if one exists - QValueList<Forwarding>::iterator itr = fwds.begin(); + TQValueList<Forwarding>::iterator itr = fwds.begin(); while (itr != fwds.end()) { Forwarding & fwo = *itr; @@ -257,7 +257,7 @@ namespace kt { Out(SYS_PNP|LOG_NOTICE) << "Forwarding port " << port.number << " (" << (port.proto == UDP ? "UDP" : "TCP") << ")" << endl; // first find the right service - QValueList<UPnPService>::iterator i = services.begin(); + TQValueList<UPnPService>::iterator i = services.begin(); while (i != services.end()) { UPnPService & s = *i; @@ -274,14 +274,14 @@ namespace kt void UPnPRouter::undoForward(UPnPService* srv,const net::Port & port,bt::WaitJob* waitjob) { // add all the arguments for the command - QValueList<SOAP::Arg> args; + TQValueList<SOAP::Arg> args; SOAP::Arg a; a.element = "NewRemoteHost"; args.append(a); // the external port a.element = "NewExternalPort"; - a.value = QString::number(port.number); + a.value = TQString::number(port.number); args.append(a); // the protocol @@ -290,8 +290,8 @@ namespace kt args.append(a); - QString action = "DeletePortMapping"; - QString comm = SOAP::createCommand(action,srv->servicetype,args); + TQString action = "DeletePortMapping"; + TQString comm = SOAP::createCommand(action,srv->servicetype,args); bt::HTTPRequest* r = sendSoapQuery(comm,srv->servicetype + "#" + action,srv->controlurl,waitjob != 0); if (waitjob) @@ -306,7 +306,7 @@ namespace kt Out(SYS_PNP|LOG_NOTICE) << "Undoing forward of port " << port.number << " (" << (port.proto == UDP ? "UDP" : "TCP") << ")" << endl; - QValueList<Forwarding>::iterator itr = fwds.begin(); + TQValueList<Forwarding>::iterator itr = fwds.begin(); while (itr != fwds.end()) { Forwarding & wd = *itr; @@ -322,29 +322,29 @@ namespace kt } } - bt::HTTPRequest* UPnPRouter::sendSoapQuery(const QString & query,const QString & soapact,const QString & controlurl,bool at_exit) + bt::HTTPRequest* UPnPRouter::sendSoapQuery(const TQString & query,const TQString & soapact,const TQString & controlurl,bool at_exit) { // if port is not set, 0 will be returned // thanks to Diego R. Brogna for spotting this bug if (location.port()==0) location.setPort(80); - QString http_hdr = QString( + TQString http_hdr = TQString( "POST %1 HTTP/1.1\r\n" "HOST: %2:%3\r\n" "Content-length: $CONTENT_LENGTH\r\n" "Content-Type: text/xml\r\n" "SOAPAction: \"%4\"\r\n" - "\r\n").arg(controlurl).arg(location.host()).arg(location.port()).arg(soapact); + "\r\n").tqarg(controlurl).tqarg(location.host()).tqarg(location.port()).tqarg(soapact); HTTPRequest* r = new HTTPRequest(http_hdr,query,location.host(),location.port(),verbose); - connect(r,SIGNAL(replyError(bt::HTTPRequest* ,const QString& )), - this,SLOT(onReplyError(bt::HTTPRequest* ,const QString& ))); - connect(r,SIGNAL(replyOK(bt::HTTPRequest* ,const QString& )), - this,SLOT(onReplyOK(bt::HTTPRequest* ,const QString& ))); - connect(r,SIGNAL(error(bt::HTTPRequest*, bool )), - this,SLOT(onError(bt::HTTPRequest*, bool ))); + connect(r,TQT_SIGNAL(replyError(bt::HTTPRequest* ,const TQString& )), + this,TQT_SLOT(onReplyError(bt::HTTPRequest* ,const TQString& ))); + connect(r,TQT_SIGNAL(replyOK(bt::HTTPRequest* ,const TQString& )), + this,TQT_SLOT(onReplyOK(bt::HTTPRequest* ,const TQString& ))); + connect(r,TQT_SIGNAL(error(bt::HTTPRequest*, bool )), + this,TQT_SLOT(onError(bt::HTTPRequest*, bool ))); r->start(); if (!at_exit) active_reqs.append(r); @@ -353,7 +353,7 @@ namespace kt void UPnPRouter::httpRequestDone(bt::HTTPRequest* r,bool erase_fwd) { - QValueList<Forwarding>::iterator i = fwds.begin(); + TQValueList<Forwarding>::iterator i = fwds.begin(); while (i != fwds.end()) { Forwarding & fw = *i; @@ -372,7 +372,7 @@ namespace kt r->deleteLater(); } - void UPnPRouter::onReplyOK(bt::HTTPRequest* r,const QString &) + void UPnPRouter::onReplyOK(bt::HTTPRequest* r,const TQString &) { if (verbose) Out(SYS_PNP|LOG_NOTICE) << "UPnPRouter : OK" << endl; @@ -380,7 +380,7 @@ namespace kt httpRequestDone(r,false); } - void UPnPRouter::onReplyError(bt::HTTPRequest* r,const QString &) + void UPnPRouter::onReplyError(bt::HTTPRequest* r,const TQString &) { if (verbose) Out(SYS_PNP|LOG_IMPORTANT) << "UPnPRouter : Error" << endl; @@ -395,9 +395,9 @@ namespace kt } #if 0 - QValueList<UPnPService>::iterator UPnPRouter::findPortForwardingService() + TQValueList<UPnPService>::iterator UPnPRouter::findPortForwardingService() { - QValueList<UPnPService>::iterator i = services.begin(); + TQValueList<UPnPService>::iterator i = services.begin(); while (i != services.end()) { UPnPService & s = *i; @@ -413,32 +413,32 @@ namespace kt void UPnPRouter::getExternalIP() { // first find the right service - QValueList<UPnPService>::iterator i = findPortForwardingService(); + TQValueList<UPnPService>::iterator i = findPortForwardingService(); if (i == services.end()) throw Error(i18n("Cannot find port forwarding service in the device's description!")); UPnPService & s = *i; - QString action = "GetExternalIPAddress"; - QString comm = SOAP::createCommand(action,s.servicetype); + TQString action = "GetExternalIPAddress"; + TQString comm = SOAP::createCommand(action,s.servicetype); sendSoapQuery(comm,s.servicetype + "#" + action,s.controlurl); } void UPnPRouter::isPortForwarded(const net::Port & port) { // first find the right service - QValueList<UPnPService>::iterator i = findPortForwardingService(); + TQValueList<UPnPService>::iterator i = findPortForwardingService(); if (i == services.end()) throw Error(i18n("Cannot find port forwarding service in the device's description!")); // add all the arguments for the command - QValueList<SOAP::Arg> args; + TQValueList<SOAP::Arg> args; SOAP::Arg a; a.element = "NewRemoteHost"; args.append(a); // the external port a.element = "NewExternalPort"; - a.value = QString::number(port.number); + a.value = TQString::number(port.number); args.append(a); // the protocol @@ -447,8 +447,8 @@ namespace kt args.append(a); UPnPService & s = *i; - QString action = "GetSpecificPortMappingEntry"; - QString comm = SOAP::createCommand(action,s.servicetype,args); + TQString action = "GetSpecificPortMappingEntry"; + TQString comm = SOAP::createCommand(action,s.servicetype,args); sendSoapQuery(comm,s.servicetype + "#" + action,s.controlurl); } #endif diff --git a/plugins/upnp/upnprouter.h b/plugins/upnp/upnprouter.h index a4d32b4..88b8054 100644 --- a/plugins/upnp/upnprouter.h +++ b/plugins/upnp/upnprouter.h @@ -21,7 +21,7 @@ #define KTUPNPROUTER_H #include <kurl.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <kstreamsocket.h> #include <net/portlist.h> @@ -45,11 +45,11 @@ namespace kt */ struct UPnPService { - QString serviceid; - QString servicetype; - QString controlurl; - QString eventsuburl; - QString scpdurl; + TQString serviceid; + TQString servicetype; + TQString controlurl; + TQString eventsuburl; + TQString scpdurl; UPnPService(); UPnPService(const UPnPService & s); @@ -59,7 +59,7 @@ namespace kt * @param name Name of the property (matches to variable names) * @param value Value of the property */ - void setProperty(const QString & name,const QString & value); + void setProperty(const TQString & name,const TQString & value); /** * Set all strings to empty. @@ -82,18 +82,18 @@ namespace kt */ struct UPnPDeviceDescription { - QString friendlyName; - QString manufacturer; - QString modelDescription; - QString modelName; - QString modelNumber; + TQString friendlyName; + TQString manufacturer; + TQString modelDescription; + TQString modelName; + TQString modelNumber; /** * Set a property of the description * @param name Name of the property (matches to variable names) * @param value Value of the property */ - void setProperty(const QString & name,const QString & value); + void setProperty(const TQString & name,const TQString & value); }; /** @@ -102,9 +102,10 @@ namespace kt * Class representing a UPnP enabled router. This class is also used to communicate * with the router. */ - class UPnPRouter : public QObject + class UPnPRouter : public TQObject { Q_OBJECT + TQ_OBJECT public: struct Forwarding @@ -114,13 +115,13 @@ namespace kt UPnPService* service; }; private: - QString server; - QString tmp_file; + TQString server; + TQString tmp_file; KURL location; UPnPDeviceDescription desc; - QValueList<UPnPService> services; - QValueList<Forwarding> fwds; - QValueList<bt::HTTPRequest*> active_reqs; + TQValueList<UPnPService> services; + TQValueList<Forwarding> fwds; + TQValueList<bt::HTTPRequest*> active_reqs; public: /** * Construct a router. @@ -128,11 +129,11 @@ namespace kt * @param location The location of it's xml description file * @param verbose Print lots of debug info */ - UPnPRouter(const QString & server,const KURL & location,bool verbose = false); + UPnPRouter(const TQString & server,const KURL & location,bool verbose = false); virtual ~UPnPRouter(); /// Get the name of the server - QString getServer() const {return server;} + TQString getServer() const {return server;} /// Get the location of it's xml description KURL getLocation() const {return location;} @@ -183,12 +184,12 @@ namespace kt void debugPrintData(); - QValueList<Forwarding>::iterator beginPortMappings() {return fwds.begin();} - QValueList<Forwarding>::iterator endPortMappings() {return fwds.end();} + TQValueList<Forwarding>::iterator beginPortMappings() {return fwds.begin();} + TQValueList<Forwarding>::iterator endPortMappings() {return fwds.end();} private slots: - void onReplyOK(bt::HTTPRequest* r,const QString &); - void onReplyError(bt::HTTPRequest* r,const QString &); + void onReplyOK(bt::HTTPRequest* r,const TQString &); + void onReplyError(bt::HTTPRequest* r,const TQString &); void onError(bt::HTTPRequest* r,bool); void downloadFinished(KIO::Job* j); @@ -208,9 +209,9 @@ namespace kt void xmlFileDownloaded(UPnPRouter* r,bool success); private: - QValueList<UPnPService>::iterator findPortForwardingService(); + TQValueList<UPnPService>::iterator findPortForwardingService(); - bt::HTTPRequest* sendSoapQuery(const QString & query,const QString & soapact,const QString & controlurl,bool at_exit = false); + bt::HTTPRequest* sendSoapQuery(const TQString & query,const TQString & soapact,const TQString & controlurl,bool at_exit = false); bool verbose; void forward(UPnPService* srv,const net::Port & port); diff --git a/plugins/upnp/upnpwidget.ui b/plugins/upnp/upnpwidget.ui index a8f0f7a..ffd8900 100644 --- a/plugins/upnp/upnpwidget.ui +++ b/plugins/upnp/upnpwidget.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>UPnPWidget</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>UPnPWidget</cstring> </property> @@ -19,15 +19,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -75,9 +75,9 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -109,14 +109,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>70</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>m_rescan</cstring> </property> @@ -130,7 +130,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/plugins/webinterface/httpclienthandler.cpp b/plugins/webinterface/httpclienthandler.cpp index d925466..1ad2d8d 100644 --- a/plugins/webinterface/httpclienthandler.cpp +++ b/plugins/webinterface/httpclienthandler.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qsocket.h> -#include <qhttp.h> +#include <tqsocket.h> +#include <tqhttp.h> #include <util/log.h> #include <util/mmapfile.h> #include "httpserver.h" @@ -31,7 +31,7 @@ using namespace bt; namespace kt { - HttpClientHandler::HttpClientHandler(HttpServer* srv,QSocket* sock) : srv(srv),client(sock),php_response_hdr(200) + HttpClientHandler::HttpClientHandler(HttpServer* srv,TQSocket* sock) : srv(srv),client(sock),php_response_hdr(200) { state = WAITING_FOR_REQUEST; bytes_read = 0; @@ -51,7 +51,7 @@ namespace kt { while (client->canReadLine()) { - QString line = client->readLine(); + TQString line = client->readLine(); header_data += line; if (header_data.endsWith("\r\n\r\n")) { @@ -87,7 +87,7 @@ namespace kt void HttpClientHandler::handleRequest() { - header = QHttpRequestHeader(header_data); + header = TQHttpRequestHeader(header_data); // Out(SYS_WEB|LOG_DEBUG) << "Parsing request : " << header.toString() << endl; if (header.method() == "POST") { @@ -112,7 +112,7 @@ namespace kt } } - bool HttpClientHandler::sendFile(HttpResponseHeader & hdr,const QString & full_path) + bool HttpClientHandler::sendFile(HttpResponseHeader & hdr,const TQString & full_path) { // Out(SYS_WEB|LOG_DEBUG) << "Sending file " << full_path << endl; // first look in cache @@ -131,12 +131,12 @@ namespace kt srv->insertIntoCache(full_path,c); } - hdr.setValue("Content-Length",QString::number(c->getSize())); + hdr.setValue("Content-Length",TQString::number(c->getSize())); // Out(SYS_WEB|LOG_DEBUG) << "HTTP header : " << endl; // Out(SYS_WEB|LOG_DEBUG) << hdr.toString() << endl; - QCString d = hdr.toString().utf8(); + TQCString d = hdr.toString().utf8(); client->writeBlock(d.data(),d.length()); Uint32 written = 0; @@ -156,14 +156,14 @@ namespace kt #define HTTP_500_ERROR "<html><head><title>HTTP/1.1 500 Internal Server Error</title></head><body>HTTP/1.1 Internal Server Error<br>%1</body></html>" - void HttpClientHandler::send404(HttpResponseHeader & hdr,const QString & path) + void HttpClientHandler::send404(HttpResponseHeader & hdr,const TQString & path) { // Out(SYS_WEB|LOG_DEBUG) << "Sending 404 " << path << endl; - QString data = HTTP_404_ERROR; - hdr.setValue("Content-Length",QString::number(data.length())); + TQString data = HTTP_404_ERROR; + hdr.setValue("Content-Length",TQString::number(data.length())); - QTextStream os(client); - os.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream os(client); + os.setEncoding( TQTextStream::UnicodeUTF8 ); os << hdr.toString(); os << data; } @@ -171,11 +171,11 @@ namespace kt void HttpClientHandler::send500(HttpResponseHeader & hdr) { // Out(SYS_WEB|LOG_DEBUG) << "Sending 500 " << endl; - QString data = QString(HTTP_500_ERROR).arg("An internal server error occured !"); - hdr.setValue("Content-Length",QString::number(data.length())); + TQString data = TQString(HTTP_500_ERROR).tqarg("An internal server error occured !"); + hdr.setValue("Content-Length",TQString::number(data.length())); - QTextStream os(client); - os.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream os(client); + os.setEncoding( TQTextStream::UnicodeUTF8 ); os << hdr.toString(); os << data; } @@ -183,28 +183,28 @@ namespace kt void HttpClientHandler::sendResponse(const HttpResponseHeader & hdr) { // Out(SYS_WEB|LOG_DEBUG) << "Sending response " << hdr.toString() << endl; - QTextStream os(client); - os.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream os(client); + os.setEncoding( TQTextStream::UnicodeUTF8 ); os << hdr.toString(); } void HttpClientHandler::executePHPScript( PhpInterface* php_iface, HttpResponseHeader & hdr, - const QString & php_exe, - const QString & php_file, - const QMap<QString,QString> & args) + const TQString & php_exe, + const TQString & php_file, + const TQMap<TQString,TQString> & args) { // Out(SYS_WEB|LOG_DEBUG) << "Launching PHP script " << php_file << endl; php = new PhpHandler(php_exe,php_iface); if (!php->executeScript(php_file,args)) { - QString data = QString(HTTP_500_ERROR).arg("Failed to launch PHP executable !"); + TQString data = TQString(HTTP_500_ERROR).tqarg("Failed to launch PHP executable !"); hdr.setResponseCode(500); - hdr.setValue("Content-Length",QString::number(data.utf8().length())); + hdr.setValue("Content-Length",TQString::number(data.utf8().length())); - QTextStream os(client); - os.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream os(client); + os.setEncoding( TQTextStream::UnicodeUTF8 ); os << hdr.toString(); os << data; state = WAITING_FOR_REQUEST; @@ -212,18 +212,18 @@ namespace kt else { php_response_hdr = hdr; - connect(php,SIGNAL(finished()),this,SLOT(onPHPFinished())); + connect(php,TQT_SIGNAL(finished()),this,TQT_SLOT(onPHPFinished())); state = PROCESSING_PHP; } } void HttpClientHandler::onPHPFinished() { - const QByteArray & output = php->getOutput(); - php_response_hdr.setValue("Content-Length",QString::number(output.size())); + const TQByteArray & output = php->getOutput(); + php_response_hdr.setValue("Content-Length",TQString::number(output.size())); - QTextStream os(client); - os.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream os(client); + os.setEncoding( TQTextStream::UnicodeUTF8 ); os << php_response_hdr.toString(); os.writeRawBytes(output.data(),output.size()); diff --git a/plugins/webinterface/httpclienthandler.h b/plugins/webinterface/httpclienthandler.h index cacf463..c76be5c 100644 --- a/plugins/webinterface/httpclienthandler.h +++ b/plugins/webinterface/httpclienthandler.h @@ -21,12 +21,12 @@ #define KTHTTPCLIENTHANDLER_H -#include <qhttp.h> -#include <qobject.h> +#include <tqhttp.h> +#include <tqobject.h> #include <util/constants.h> #include "httpresponseheader.h" -class QSocket; +class TQSocket; namespace kt @@ -38,9 +38,10 @@ namespace kt /** @author Joris Guisson <[email protected]> */ - class HttpClientHandler : public QObject + class HttpClientHandler : public TQObject { Q_OBJECT + TQ_OBJECT enum State { WAITING_FOR_REQUEST, @@ -48,20 +49,20 @@ namespace kt PROCESSING_PHP }; public: - HttpClientHandler(HttpServer* srv,QSocket* sock); + HttpClientHandler(HttpServer* srv,TQSocket* sock); virtual ~HttpClientHandler(); void readyToRead(); - bool sendFile(HttpResponseHeader & hdr,const QString & full_path); + bool sendFile(HttpResponseHeader & hdr,const TQString & full_path); void sendResponse(const HttpResponseHeader & hdr); - void send404(HttpResponseHeader & hdr,const QString & path); + void send404(HttpResponseHeader & hdr,const TQString & path); void send500(HttpResponseHeader & hdr); void executePHPScript(PhpInterface* php_iface, HttpResponseHeader & hdr, - const QString & php_exe, - const QString & php_file, - const QMap<QString,QString> & args); + const TQString & php_exe, + const TQString & php_file, + const TQMap<TQString,TQString> & args); private: void handleRequest(); @@ -71,11 +72,11 @@ namespace kt private: HttpServer* srv; - QSocket* client; + TQSocket* client; State state; - QHttpRequestHeader header; - QString header_data; - QByteArray request_data; + TQHttpRequestHeader header; + TQString header_data; + TQByteArray request_data; bt::Uint32 bytes_read; PhpHandler* php; HttpResponseHeader php_response_hdr; diff --git a/plugins/webinterface/httpresponseheader.cpp b/plugins/webinterface/httpresponseheader.cpp index da7556f..7b87892 100644 --- a/plugins/webinterface/httpresponseheader.cpp +++ b/plugins/webinterface/httpresponseheader.cpp @@ -21,7 +21,7 @@ namespace kt { - static QString ResponseCodeToString(int r) + static TQString ResponseCodeToString(int r) { switch (r) { @@ -30,7 +30,7 @@ namespace kt case 304: return "Not Modified"; case 404: return "Not Found"; } - return QString::null; + return TQString(); } HttpResponseHeader::HttpResponseHeader(int response_code) @@ -53,20 +53,20 @@ namespace kt response_code = rc; } - void HttpResponseHeader::setValue(const QString & key,const QString & value) + void HttpResponseHeader::setValue(const TQString & key,const TQString & value) { fields[key] = value; } - QString HttpResponseHeader::toString() const + TQString HttpResponseHeader::toString() const { - QString str; - str += QString("HTTP/1.1 %1 %2\r\n").arg(response_code).arg(ResponseCodeToString(response_code)); + TQString str; + str += TQString("HTTP/1.1 %1 %2\r\n").tqarg(response_code).tqarg(ResponseCodeToString(response_code)); - QMap<QString,QString>::const_iterator itr = fields.begin(); + TQMap<TQString,TQString>::const_iterator itr = fields.begin(); while (itr != fields.end()) { - str += QString("%1: %2\r\n").arg(itr.key()).arg(itr.data()); + str += TQString("%1: %2\r\n").tqarg(itr.key()).tqarg(itr.data()); itr++; } str += "\r\n"; diff --git a/plugins/webinterface/httpresponseheader.h b/plugins/webinterface/httpresponseheader.h index 9672191..417fe6b 100644 --- a/plugins/webinterface/httpresponseheader.h +++ b/plugins/webinterface/httpresponseheader.h @@ -21,8 +21,8 @@ #define KTHTTPRESPONSEHEADER_H -#include <qmap.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqstring.h> namespace kt { @@ -33,16 +33,16 @@ namespace kt class HttpResponseHeader { int response_code; - QMap<QString,QString> fields; + TQMap<TQString,TQString> fields; public: HttpResponseHeader(int response_code); HttpResponseHeader(const HttpResponseHeader & hdr); virtual ~HttpResponseHeader(); void setResponseCode(int response_code); - void setValue(const QString & key,const QString & value); + void setValue(const TQString & key,const TQString & value); - QString toString() const; + TQString toString() const; }; diff --git a/plugins/webinterface/httpserver.cpp b/plugins/webinterface/httpserver.cpp index e2c0eeb..06d8d34 100644 --- a/plugins/webinterface/httpserver.cpp +++ b/plugins/webinterface/httpserver.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qtimer.h> -#include <qcstring.h> -#include <qdatetime.h> +#include <tqtimer.h> +#include <tqcstring.h> +#include <tqdatetime.h> #include <kapplication.h> #include <kgenericfactory.h> #include <kglobal.h> @@ -27,9 +27,9 @@ #include <kmdcodec.h> #include <ktempfile.h> -#include <qfileinfo.h> -#include <qsocket.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqsocket.h> +#include <tqstringlist.h> #include <interfaces/coreinterface.h> #include <interfaces/torrentinterface.h> @@ -53,12 +53,12 @@ namespace kt - HttpServer::HttpServer(CoreInterface *core, int port) : QServerSocket(port, 5),core(core),cache(10,23) + HttpServer::HttpServer(CoreInterface *core, int port) : TQServerSocket(port, 5),core(core),cache(10,23) { php_i = new PhpInterface(core); clients.setAutoDelete(true); - QStringList dirList = KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www"); + TQStringList dirList = KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www"); rootDir = *(dirList.begin()); Out(SYS_WEB|LOG_DEBUG) << "WWW Root Directory "<< rootDir <<endl; session.logged_in = false; @@ -72,23 +72,23 @@ namespace kt void HttpServer::newConnection(int s) { - QSocket* socket = new QSocket(this); + TQSocket* socket = new TQSocket(this); socket->setSocket(s); - connect(socket, SIGNAL(readyRead()), this, SLOT(slotSocketReadyToRead())); - connect(socket, SIGNAL(delayedCloseFinished()), this, SLOT(slotConnectionClosed())); - connect(socket, SIGNAL(connectionClosed()), this, SLOT(slotConnectionClosed())); + connect(socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotSocketReadyToRead())); + connect(socket, TQT_SIGNAL(delayedCloseFinished()), this, TQT_SLOT(slotConnectionClosed())); + connect(socket, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(slotConnectionClosed())); HttpClientHandler* handler = new HttpClientHandler(this,socket); clients.insert(socket,handler); - Out(SYS_WEB|LOG_NOTICE) << "connection from "<< socket->peerAddress().toString() << endl; + Out(SYS_WEB|LOG_NOTICE) << "connection from "<< TQString(socket->peerAddress().toString()) << endl; } void HttpServer::slotSocketReadyToRead() { - QSocket* client = (QSocket*)sender(); - HttpClientHandler* handler = clients.find(client); + TQSocket* client = (TQSocket*)sender(); + HttpClientHandler* handler = clients.tqfind(client); if (!handler) { client->deleteLater(); @@ -98,10 +98,10 @@ namespace kt handler->readyToRead(); } - static int DecodeEscapedChar(QString & password,int idx) + static int DecodeEscapedChar(TQString & password,int idx) { - QChar a = password[idx + 1].lower(); - QChar b = password[idx + 2].lower(); + TQChar a = password[idx + 1].lower(); + TQChar b = password[idx + 2].lower(); if (!a.isNumber() && !(a.latin1() >= 'a' && a.latin1() <= 'f')) return idx + 2; // not a valid hex digit @@ -112,21 +112,21 @@ namespace kt Uint8 h = (a.latin1() - (a.isNumber() ? '0' : 'a')) << 4; Uint8 l = (b.latin1() - (b.isNumber() ? '0' : 'a')); char r = (char) h | l; // combine them and cast to a char - password.replace(idx,3,r); + password.tqreplace(idx,3,r); return idx + 1; } - bool HttpServer::checkLogin(const QHttpRequestHeader & hdr,const QByteArray & data) + bool HttpServer::checkLogin(const TQHttpRequestHeader & hdr,const TQByteArray & data) { if (hdr.contentType() != "application/x-www-form-urlencoded") return false; - QString username; - QString password; - QStringList params = QStringList::split("&",QString(data)); - for (QStringList::iterator i = params.begin();i != params.end();i++) + TQString username; + TQString password; + TQStringList params = TQStringList::split("&",TQString(data)); + for (TQStringList::iterator i = params.begin();i != params.end();i++) { - QString t = *i; + TQString t = *i; if (t.section("=",0,0) == "username") username = t.section("=",1,1); else if (t.section("=",0,0) == "password") @@ -134,7 +134,7 @@ namespace kt // check for passwords with url encoded stuff in them and decode them if necessary int idx = 0; - while ((idx = password.find('%',idx)) > 0) + while ((idx = password.tqfind('%',idx)) > 0) { if (idx + 2 < password.length()) { @@ -154,7 +154,7 @@ namespace kt { session.logged_in = true; session.sessionId=rand(); - session.last_access=QTime::currentTime(); + session.last_access=TQTime::currentTime(); Out(SYS_WEB|LOG_NOTICE) << "Webgui login succesfull !" << endl; return true; } @@ -163,19 +163,19 @@ namespace kt return false; } - bool HttpServer::checkSession(const QHttpRequestHeader & hdr) + bool HttpServer::checkSession(const TQHttpRequestHeader & hdr) { // check session in cookie int session_id = 0; if (hdr.hasKey("Cookie")) { - QString cookie = hdr.value("Cookie"); - int idx = cookie.find("KT_SESSID="); + TQString cookie = hdr.value("Cookie"); + int idx = cookie.tqfind("KT_SESSID="); if (idx == -1) return false; - QString number; - idx += QString("KT_SESSID=").length(); + TQString number; + idx += TQString("KT_SESSID=").length(); while (idx < cookie.length()) { if (cookie[idx] >= '0' && cookie[idx] <= '9') @@ -193,9 +193,9 @@ namespace kt if (session_id == session.sessionId) { // check if the session hasn't expired yet - if(session.last_access.secsTo(QTime::currentTime())<WebInterfacePluginSettings::sessionTTL()) + if(session.last_access.secsTo(TQTime::currentTime())<WebInterfacePluginSettings::sessionTTL()) { - session.last_access=QTime::currentTime(); + session.last_access=TQTime::currentTime(); } else { @@ -208,7 +208,7 @@ namespace kt return true; } - static QString ExtensionToContentType(const QString & ext) + static TQString ExtensionToContentType(const TQString & ext) { if (ext == "html") return "text/html"; @@ -219,41 +219,41 @@ namespace kt else if (ext == "gif" || ext == "png" || ext == "ico") return "image/" + ext; else - return QString::null; + return TQString(); } // HTTP needs non translated dates - static QString days[] = { + static TQString days[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; - static QString months[] = { + static TQString months[] = { "Jan","Feb","Mar","Apr", "May","Jun","Jul","Aug", "Sep","Oct","Nov","Dec" }; - static QString DateTimeToString(const QDateTime & now,bool cookie) + static TQString DateTimeToString(const TQDateTime & now,bool cookie) { if (!cookie) return now.toString("%1, dd %2 yyyy hh:mm:ss UTC") - .arg(days[now.date().dayOfWeek() - 1]) - .arg(months[now.date().month() - 1]); + .tqarg(days[now.date().dayOfWeek() - 1]) + .tqarg(months[now.date().month() - 1]); else return now.toString("%1, dd-%2-yyyy hh:mm:ss GMT") - .arg(days[now.date().dayOfWeek() - 1]) - .arg(months[now.date().month() - 1]); + .tqarg(days[now.date().dayOfWeek() - 1]) + .tqarg(months[now.date().month() - 1]); } - void HttpServer::setDefaultResponseHeaders(HttpResponseHeader & hdr,const QString & content_type,bool with_session_info) + void HttpServer::setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info) { hdr.setValue("Server","KTorrent/" KT_VERSION_MACRO); - hdr.setValue("Date",DateTimeToString(QDateTime::currentDateTime(Qt::UTC),false)); + hdr.setValue("Date",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC),false)); hdr.setValue("Content-Type",content_type); hdr.setValue("Connection","keep-alive"); if (with_session_info && session.sessionId && session.logged_in) { - hdr.setValue("Set-Cookie",QString("KT_SESSID=%1").arg(session.sessionId)); + hdr.setValue("Set-Cookie",TQString("KT_SESSID=%1").tqarg(session.sessionId)); } } @@ -262,7 +262,7 @@ namespace kt HttpResponseHeader rhdr(301); setDefaultResponseHeaders(rhdr,"text/html",false); rhdr.setValue("Location","/login.html"); - QString path = rootDir + bt::DirSeparator() + WebInterfacePluginSettings::skin() + "/login.html"; + TQString path = rootDir + bt::DirSeparator() + WebInterfacePluginSettings::skin() + "/login.html"; if (!hdlr->sendFile(rhdr,path)) { HttpResponseHeader nhdr(404); @@ -272,9 +272,9 @@ namespace kt Out(SYS_WEB|LOG_NOTICE) << "Redirecting to /login.html" << endl; } - void HttpServer::handleGet(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,bool do_not_check_session) + void HttpServer::handleGet(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,bool do_not_check_session) { - QString file = hdr.path(); + TQString file = hdr.path(); if (file == "/") file = "/login.html"; @@ -283,7 +283,7 @@ namespace kt KURL url; url.setEncodedPathAndQuery(file); - QString path = rootDir + bt::DirSeparator() + WebInterfacePluginSettings::skin() + url.path(); + TQString path = rootDir + bt::DirSeparator() + WebInterfacePluginSettings::skin() + url.path(); // first check if the file exists (if not send 404) if (!bt::Exists(path)) { @@ -293,8 +293,8 @@ namespace kt return; } - QFileInfo fi(path); - QString ext = fi.extension(); + TQFileInfo fi(path); + TQString ext = fi.extension(); // if it is the login page send that if (file == "/login.html" || file == "/") @@ -328,8 +328,8 @@ namespace kt if (path.endsWith("login.html")) { // clear cookie in case of login page - QDateTime dt = QDateTime::currentDateTime().addDays(-1); - QString cookie = QString("KT_SESSID=666; expires=%1 +0000").arg(DateTimeToString(dt,true)); + TQDateTime dt = TQDateTime::tqcurrentDateTime().addDays(-1); + TQString cookie = TQString("KT_SESSID=666; expires=%1 +0000").tqarg(DateTimeToString(dt,true)); rhdr.setValue("Set-Cookie",cookie); } @@ -344,14 +344,14 @@ namespace kt { if (hdr.hasKey("If-Modified-Since")) { - QDateTime dt = parseDate(hdr.value("If-Modified-Since")); + TQDateTime dt = parseDate(hdr.value("If-Modified-Since")); if (dt.isValid() && dt < fi.lastModified()) { HttpResponseHeader rhdr(304); setDefaultResponseHeaders(rhdr,"text/html",true); rhdr.setValue("Cache-Control","max-age=0"); rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false)); - rhdr.setValue("Expires",DateTimeToString(QDateTime::currentDateTime(Qt::UTC).addSecs(3600),false)); + rhdr.setValue("Expires",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC).addSecs(3600),false)); hdlr->sendResponse(rhdr); return; } @@ -361,7 +361,7 @@ namespace kt HttpResponseHeader rhdr(200); setDefaultResponseHeaders(rhdr,ExtensionToContentType(ext),true); rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false)); - rhdr.setValue("Expires",DateTimeToString(QDateTime::currentDateTime(Qt::UTC).addSecs(3600),false)); + rhdr.setValue("Expires",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC).addSecs(3600),false)); rhdr.setValue("Cache-Control","private"); if (!hdlr->sendFile(rhdr,path)) { @@ -381,7 +381,7 @@ namespace kt { // first send back login page redirectToLoginPage(hdlr); - QTimer::singleShot(1000,kapp,SLOT(quit())); + TQTimer::singleShot(1000,kapp,TQT_SLOT(quit())); } else if (redirect) { @@ -409,7 +409,7 @@ namespace kt } } - void HttpServer::handlePost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data) + void HttpServer::handlePost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data) { // this is either a file or a login if (hdr.value("Content-Type").startsWith("multipart/form-data")) @@ -418,7 +418,7 @@ namespace kt } else if (!checkLogin(hdr,data)) { - QHttpRequestHeader tmp = hdr; + TQHttpRequestHeader tmp = hdr; tmp.setRequest("GET","/login.html",1,1); handleGet(hdlr,tmp); } @@ -428,11 +428,11 @@ namespace kt } } - void HttpServer::handleTorrentPost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data) + void HttpServer::handleTorrentPost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data) { const char* ptr = data.data(); Uint32 len = data.size(); - int pos = QString(data).find("\r\n\r\n"); + int pos = TQString(data).tqfind("\r\n\r\n"); if (pos == -1 || pos + 4 >= len || ptr[pos + 4] != 'd') { @@ -444,7 +444,7 @@ namespace kt // save torrent to a temporary file KTempFile tmp_file(locateLocal("tmp", "ktwebgui-"), ".torrent"); - QDataStream* out = tmp_file.dataStream(); + TQDataStream* out = tmp_file.dataStream(); if (!out) { HttpResponseHeader rhdr(500); @@ -472,11 +472,11 @@ namespace kt void HttpServer::slotConnectionClosed() { - QSocket* socket= (QSocket*)sender(); + TQSocket* socket= (TQSocket*)sender(); clients.erase(socket); } - QDateTime HttpServer::parseDate(const QString & str) + TQDateTime HttpServer::parseDate(const TQString & str) { /* Potential date formats : @@ -484,66 +484,66 @@ namespace kt Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format */ - QStringList sl = QStringList::split(" ",str); + TQStringList sl = TQStringList::split(" ",str); if (sl.count() == 6) { // RFC 1123 format - QDate d; - QString month = sl[2]; + TQDate d; + TQString month = sl[2]; int m = -1; for (int i = 1;i <= 12 && m < 0;i++) - if (QDate::shortMonthName(i) == month) + if (TQDate::shortMonthName(i) == month) m = i; d.setYMD(sl[3].toInt(),m,sl[1].toInt()); - QTime t = QTime::fromString(sl[4],Qt::ISODate); - return QDateTime(d,t); + TQTime t = TQTime::fromString(sl[4],Qt::ISODate); + return TQDateTime(d,t); } else if (sl.count() == 4) { // RFC 1036 - QStringList dl = QStringList::split("-",sl[1]); + TQStringList dl = TQStringList::split("-",sl[1]); if (dl.count() != 3) - return QDateTime(); + return TQDateTime(); - QDate d; - QString month = dl[1]; + TQDate d; + TQString month = dl[1]; int m = -1; for (int i = 1;i <= 12 && m < 0;i++) - if (QDate::shortMonthName(i) == month) + if (TQDate::shortMonthName(i) == month) m = i; d.setYMD(2000 + dl[2].toInt(),m,dl[0].toInt()); - QTime t = QTime::fromString(sl[2],Qt::ISODate); - return QDateTime(d,t); + TQTime t = TQTime::fromString(sl[2],Qt::ISODate); + return TQDateTime(d,t); } else if (sl.count() == 5) { // ANSI C - QDate d; - QString month = sl[1]; + TQDate d; + TQString month = sl[1]; int m = -1; for (int i = 1;i <= 12 && m < 0;i++) - if (QDate::shortMonthName(i) == month) + if (TQDate::shortMonthName(i) == month) m = i; d.setYMD(sl[4].toInt(),m,sl[2].toInt()); - QTime t = QTime::fromString(sl[3],Qt::ISODate); - return QDateTime(d,t); + TQTime t = TQTime::fromString(sl[3],Qt::ISODate); + return TQDateTime(d,t); } else - return QDateTime(); + return TQDateTime(); } - bt::MMapFile* HttpServer::cacheLookup(const QString & name) + bt::MMapFile* HttpServer::cacheLookup(const TQString & name) { - return cache.find(name); + return cache.tqfind(name); } - void HttpServer::insertIntoCache(const QString & name,bt::MMapFile* file) + void HttpServer::insertIntoCache(const TQString & name,bt::MMapFile* file) { cache.insert(name,file); } diff --git a/plugins/webinterface/httpserver.h b/plugins/webinterface/httpserver.h index 28be441..dcdfdfe 100644 --- a/plugins/webinterface/httpserver.h +++ b/plugins/webinterface/httpserver.h @@ -20,13 +20,13 @@ #ifndef HTTPSERVER_H #define HTTPSERVER_H -#include <qcache.h> -#include <qhttp.h> -#include <qdatetime.h> -#include <qserversocket.h> +#include <tqcache.h> +#include <tqhttp.h> +#include <tqdatetime.h> +#include <tqserversocket.h> #include <util/ptrmap.h> -class QSocket; +class TQSocket; namespace bt { @@ -43,7 +43,7 @@ namespace kt struct Session { bool logged_in; - QTime last_access; + TQTime last_access; int sessionId; }; @@ -62,41 +62,42 @@ namespace kt - class HttpServer : public QServerSocket + class HttpServer : public TQServerSocket { Q_OBJECT + TQ_OBJECT public: HttpServer(CoreInterface *core, int port); virtual ~HttpServer(); void newConnection(int s); - void handleGet(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,bool do_not_check_session = false); - void handlePost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data); + void handleGet(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,bool do_not_check_session = false); + void handlePost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data); void handleUnsupportedMethod(HttpClientHandler* hdlr); - bt::MMapFile* cacheLookup(const QString & name); - void insertIntoCache(const QString & name,bt::MMapFile* file); + bt::MMapFile* cacheLookup(const TQString & name); + void insertIntoCache(const TQString & name,bt::MMapFile* file); protected slots: void slotSocketReadyToRead(); void slotConnectionClosed(); private: - bool checkSession(const QHttpRequestHeader & hdr); - bool checkLogin(const QHttpRequestHeader & hdr,const QByteArray & data); - void setDefaultResponseHeaders(HttpResponseHeader & hdr,const QString & content_type,bool with_session_info); - void handleTorrentPost(HttpClientHandler* hdlr,const QHttpRequestHeader & hdr,const QByteArray & data); - QDateTime parseDate(const QString & str); + bool checkSession(const TQHttpRequestHeader & hdr); + bool checkLogin(const TQHttpRequestHeader & hdr,const TQByteArray & data); + void setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info); + void handleTorrentPost(HttpClientHandler* hdlr,const TQHttpRequestHeader & hdr,const TQByteArray & data); + TQDateTime parseDate(const TQString & str); void redirectToLoginPage(HttpClientHandler* hdlr); private: - QString rootDir; + TQString rootDir; int sessionTTL; PhpInterface *php_i; Session session; - bt::PtrMap<QSocket*,HttpClientHandler> clients; + bt::PtrMap<TQSocket*,HttpClientHandler> clients; CoreInterface *core; - QCache<bt::MMapFile> cache; + TQCache<bt::MMapFile> cache; }; diff --git a/plugins/webinterface/php_handler.cpp b/plugins/webinterface/php_handler.cpp index d04c3b6..852f1fd 100644 --- a/plugins/webinterface/php_handler.cpp +++ b/plugins/webinterface/php_handler.cpp @@ -33,24 +33,24 @@ using namespace bt; namespace kt { - QMap<QString,QByteArray> PhpHandler::scripts; + TQMap<TQString,TQByteArray> PhpHandler::scripts; - PhpHandler::PhpHandler(const QString & php_exe,PhpInterface *php) : QProcess(php_exe),php_i(php) + PhpHandler::PhpHandler(const TQString & php_exe,PhpInterface *php) : TQProcess(php_exe),php_i(php) { - connect(this,SIGNAL(readyReadStdout()),this,SLOT(onReadyReadStdout())); - connect(this,SIGNAL(processExited()),this,SLOT(onExited())); + connect(this,TQT_SIGNAL(readyReadStdout()),this,TQT_SLOT(onReadyReadStdout())); + connect(this,TQT_SIGNAL(processExited()),this,TQT_SLOT(onExited())); } PhpHandler::~PhpHandler() { } - bool PhpHandler::executeScript(const QString & path,const QMap<QString,QString> & args) + bool PhpHandler::executeScript(const TQString & path,const TQMap<TQString,TQString> & args) { - QByteArray php_s; - if (!scripts.contains(path)) + TQByteArray php_s; + if (!scripts.tqcontains(path)) { - QFile fptr(path); + TQFile fptr(path); if (!fptr.open(IO_ReadOnly)) { Out(SYS_WEB|LOG_DEBUG) << "Failed to open " << path << endl; @@ -66,32 +66,32 @@ namespace kt output.resize(0); - int firstphptag = QCString(php_s).find("<?php"); + int firstphptag = TQCString(php_s).tqfind("<?php"); if (firstphptag == -1) return false; int off = firstphptag + 6; - QByteArray data; - QTextStream ts(data,IO_WriteOnly); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQByteArray data; + TQTextStream ts(data,IO_WriteOnly); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts.writeRawBytes(php_s.data(),off); // first write the opening tag from the script php_i->globalInfo(ts); - php_i->downloadStatus(ts); + php_i->downloadtqStatus(ts); - QMap<QString,QString>::const_iterator it; + TQMap<TQString,TQString>::const_iterator it; for ( it = args.begin(); it != args.end(); ++it ) { - ts << QString("$_REQUEST['%1']=\"%2\";\n").arg(it.key()).arg(it.data()); + ts << TQString("$_REQUEST['%1']=\"%2\";\n").tqarg(it.key()).tqarg(it.data()); } ts.writeRawBytes(php_s.data() + off,php_s.size() - off); // the rest of the script ts << flush; #if 0 - QFile dinges("output.php"); + TQFile dinges("output.php"); if (dinges.open(IO_WriteOnly)) { - QTextStream out(&dinges); + TQTextStream out(&dinges); out.writeRawBytes(data.data(),data.size()); dinges.close(); } @@ -108,10 +108,10 @@ namespace kt void PhpHandler::onReadyReadStdout() { - QTextStream out(output,IO_WriteOnly|IO_Append); + TQTextStream out(output,IO_WriteOnly|IO_Append); while (canReadLineStdout()) { - QByteArray d = readStdout(); + TQByteArray d = readStdout(); out.writeRawBytes(d.data(),d.size()); } } diff --git a/plugins/webinterface/php_handler.h b/plugins/webinterface/php_handler.h index b9bfcb6..197bdb7 100644 --- a/plugins/webinterface/php_handler.h +++ b/plugins/webinterface/php_handler.h @@ -20,24 +20,25 @@ #ifndef PHP_HANDLER_H #define PHP_HANDLER_H -#include <qmap.h> +#include <tqmap.h> #include <kurl.h> -#include <qprocess.h> +#include <tqprocess.h> namespace kt { class PhpInterface; - class PhpHandler : public QProcess + class PhpHandler : public TQProcess { Q_OBJECT + TQ_OBJECT public: - PhpHandler(const QString & php_exe,PhpInterface *php); + PhpHandler(const TQString & php_exe,PhpInterface *php); virtual ~PhpHandler(); - bool executeScript(const QString & path,const QMap<QString,QString> & args); - const QByteArray & getOutput() const {return output;}; + bool executeScript(const TQString & path,const TQMap<TQString,TQString> & args); + const TQByteArray & getOutput() const {return output;}; public slots: void onExited(); @@ -47,10 +48,10 @@ namespace kt void finished(); private: - QByteArray output; + TQByteArray output; PhpInterface *php_i; - static QMap<QString,QByteArray> scripts; + static TQMap<TQString,TQByteArray> scripts; }; } diff --git a/plugins/webinterface/php_interface.cpp b/plugins/webinterface/php_interface.cpp index 8ee7d0b..4206caa 100644 --- a/plugins/webinterface/php_interface.cpp +++ b/plugins/webinterface/php_interface.cpp @@ -36,7 +36,7 @@ using namespace bt; namespace kt { - extern QString DataDir(); + extern TQString DataDir(); using bt::FIRST_PRIORITY; using bt::NORMAL_PRIORITY; @@ -44,23 +44,23 @@ namespace kt using bt::EXCLUDED; - QString BytesToString2(Uint64 bytes,int precision = 2) + TQString BytesToString2(Uint64 bytes,int precision = 2) { KLocale* loc = KGlobal::locale(); if (bytes >= 1024 * 1024 * 1024) - return QString("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision)); + return TQString("%1 GB").tqarg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision)); else if (bytes >= 1024*1024) - return QString("%1 MB").arg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision)); + return TQString("%1 MB").tqarg(loc->formatNumber(bytes / TO_MEG,precision < 0 ? 1 : precision)); else if (bytes >= 1024) - return QString("%1 KB").arg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision)); + return TQString("%1 KB").tqarg(loc->formatNumber(bytes / TO_KB,precision < 0 ? 1 : precision)); else - return QString("%1 B").arg(bytes); + return TQString("%1 B").tqarg(bytes); } - QString KBytesPerSecToString2(double speed,int precision = 2) + TQString KBytesPerSecToString2(double speed,int precision = 2) { KLocale* loc = KGlobal::locale(); - return QString("%1 KB/s").arg(loc->formatNumber(speed,precision)); + return TQString("%1 KB/s").tqarg(loc->formatNumber(speed,precision)); } /************************ @@ -72,62 +72,62 @@ namespace kt } /*Generate php code - * function downloadStatus() + * function downloadtqStatus() * { * return array( ... ); * } */ - void PhpCodeGenerator::downloadStatus(QTextStream & out) + void PhpCodeGenerator::downloadtqStatus(TQTextStream & out) { TorrentStats stats; //Priority file_priority; - QString status; - out << "function downloadStatus()\n{\nreturn array("; + TQString status; + out << "function downloadtqStatus()\n{\nreturn array("; - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if (k > 0) out << ",\n"; stats=(*i)->getStats(); - out << QString("\n%1 => array(").arg(k); + out << TQString("\n%1 => array(").tqarg(k); - out << QString("\"imported_bytes\" => %1,\n").arg(stats.imported_bytes); - out << QString("\"bytes_downloaded\" => \"%1\",\n").arg(BytesToString2(stats.bytes_downloaded)); - out << QString("\"bytes_uploaded\" => \"%1\",\n").arg(BytesToString2(stats.bytes_uploaded)); - out << QString("\"bytes_left\" => %1,\n").arg(stats.bytes_left); - out << QString("\"bytes_left_to_download\" => %1,\n").arg(stats.bytes_left_to_download); - out << QString("\"total_bytes\" => \"%1\",\n").arg(BytesToString2(stats.total_bytes)); - out << QString("\"total_bytes_to_download\" => %1,\n").arg(stats.total_bytes_to_download); - out << QString("\"download_rate\" => \"%1\",\n").arg(KBytesPerSecToString2(stats.download_rate / 1024.0)); - out << QString("\"upload_rate\" => \"%1\",\n").arg(KBytesPerSecToString2(stats.upload_rate / 1024.0)); - out << QString("\"num_peers\" => %1,\n").arg(stats.num_peers); - out << QString("\"num_chunks_downloading\" => %1,\n").arg(stats.num_chunks_downloading); - out << QString("\"total_chunks\" => %1,\n").arg(stats.total_chunks); - out << QString("\"num_chunks_downloaded\" => %1,\n").arg(stats.num_chunks_downloaded); - out << QString("\"num_chunks_excluded\" => %1,\n").arg(stats.num_chunks_excluded); - out << QString("\"chunk_size\" => %1,\n").arg(stats.chunk_size); - out << QString("\"seeders_total\" => %1,\n").arg(stats.seeders_total); - out << QString("\"seeders_connected_to\" => %1,\n").arg(stats.seeders_connected_to); - out << QString("\"leechers_total\" => %1,\n").arg(stats.leechers_total); - out << QString("\"leechers_connected_to\" => %1,\n").arg(stats.leechers_connected_to); - out << QString("\"status\" => %1,\n").arg(stats.status); - out << QString("\"running\" => %1,\n").arg(stats.running); - out << QString("\"trackerstatus\" => \"%1\",\n").arg(stats.trackerstatus.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$")); - out << QString("\"session_bytes_downloaded\" => %1,\n").arg(stats.session_bytes_downloaded); - out << QString("\"session_bytes_uploaded\" => %1,\n").arg(stats.session_bytes_uploaded); - out << QString("\"trk_bytes_downloaded\" => %1,\n").arg(stats.trk_bytes_downloaded); - out << QString("\"trk_bytes_uploaded\" => %1,\n").arg(stats.trk_bytes_uploaded); - out << QString("\"torrent_name\" => \"%1\",\n").arg(stats.torrent_name.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$")); - out << QString("\"output_path\" => \"%1\",\n").arg(stats.output_path.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$")); - out << QString("\"stopped_by_error\" => \"%1\",\n").arg(stats.stopped_by_error); - out << QString("\"completed\" => \"%1\",\n").arg(stats.completed); - out << QString("\"user_controlled\" => \"%1\",\n").arg(stats.user_controlled); - out << QString("\"max_share_ratio\" => %1,\n").arg(stats.max_share_ratio); - out << QString("\"priv_torrent\" => \"%1\",\n").arg(stats.priv_torrent); - out << QString("\"num_files\" => \"%1\",\n").arg((*i)->getNumFiles()); - out << QString("\"files\" => array("); + out << TQString("\"imported_bytes\" => %1,\n").tqarg(stats.imported_bytes); + out << TQString("\"bytes_downloaded\" => \"%1\",\n").tqarg(BytesToString2(stats.bytes_downloaded)); + out << TQString("\"bytes_uploaded\" => \"%1\",\n").tqarg(BytesToString2(stats.bytes_uploaded)); + out << TQString("\"bytes_left\" => %1,\n").tqarg(stats.bytes_left); + out << TQString("\"bytes_left_to_download\" => %1,\n").tqarg(stats.bytes_left_to_download); + out << TQString("\"total_bytes\" => \"%1\",\n").tqarg(BytesToString2(stats.total_bytes)); + out << TQString("\"total_bytes_to_download\" => %1,\n").tqarg(stats.total_bytes_to_download); + out << TQString("\"download_rate\" => \"%1\",\n").tqarg(KBytesPerSecToString2(stats.download_rate / 1024.0)); + out << TQString("\"upload_rate\" => \"%1\",\n").tqarg(KBytesPerSecToString2(stats.upload_rate / 1024.0)); + out << TQString("\"num_peers\" => %1,\n").tqarg(stats.num_peers); + out << TQString("\"num_chunks_downloading\" => %1,\n").tqarg(stats.num_chunks_downloading); + out << TQString("\"total_chunks\" => %1,\n").tqarg(stats.total_chunks); + out << TQString("\"num_chunks_downloaded\" => %1,\n").tqarg(stats.num_chunks_downloaded); + out << TQString("\"num_chunks_excluded\" => %1,\n").tqarg(stats.num_chunks_excluded); + out << TQString("\"chunk_size\" => %1,\n").tqarg(stats.chunk_size); + out << TQString("\"seeders_total\" => %1,\n").tqarg(stats.seeders_total); + out << TQString("\"seeders_connected_to\" => %1,\n").tqarg(stats.seeders_connected_to); + out << TQString("\"leechers_total\" => %1,\n").tqarg(stats.leechers_total); + out << TQString("\"leechers_connected_to\" => %1,\n").tqarg(stats.leechers_connected_to); + out << TQString("\"status\" => %1,\n").tqarg(stats.status); + out << TQString("\"running\" => %1,\n").tqarg(stats.running); + out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); + out << TQString("\"session_bytes_downloaded\" => %1,\n").tqarg(stats.session_bytes_downloaded); + out << TQString("\"session_bytes_uploaded\" => %1,\n").tqarg(stats.session_bytes_uploaded); + out << TQString("\"trk_bytes_downloaded\" => %1,\n").tqarg(stats.trk_bytes_downloaded); + out << TQString("\"trk_bytes_uploaded\" => %1,\n").tqarg(stats.trk_bytes_uploaded); + out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); + out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$")); + out << TQString("\"stopped_by_error\" => \"%1\",\n").tqarg(stats.stopped_by_error); + out << TQString("\"completed\" => \"%1\",\n").tqarg(stats.completed); + out << TQString("\"user_controlled\" => \"%1\",\n").tqarg(stats.user_controlled); + out << TQString("\"max_share_ratio\" => %1,\n").tqarg(stats.max_share_ratio); + out << TQString("\"priv_torrent\" => \"%1\",\n").tqarg(stats.priv_torrent); + out << TQString("\"num_files\" => \"%1\",\n").tqarg((*i)->getNumFiles()); + out << TQString("\"files\" => array("); out << flush; if (stats.multi_file_torrent) { @@ -138,12 +138,12 @@ namespace kt out << ",\n"; TorrentFileInterface & file = (*i)->getTorrentFile(j); - out << QString("\"%1\" => array(\n").arg(j); - out << QString("\"name\" => \"%1\",\n").arg(file.getPath()); - out << QString("\"size\" => \"%1\",\n").arg(KIO::convertSize(file.getSize())); - out << QString("\"perc_done\" => \"%1\",\n").arg(file.getDownloadPercentage()); - out << QString("\"status\" => \"%1\"\n").arg(file.getPriority()); - out << QString(")\n"); + out << TQString("\"%1\" => array(\n").tqarg(j); + out << TQString("\"name\" => \"%1\",\n").tqarg(file.getPath()); + out << TQString("\"size\" => \"%1\",\n").tqarg(KIO::convertSize(file.getSize())); + out << TQString("\"perc_done\" => \"%1\",\n").tqarg(file.getDownloadPercentage()); + out << TQString("\"status\" => \"%1\"\n").tqarg(file.getPriority()); + out << TQString(")\n"); out << flush; } } @@ -156,26 +156,26 @@ namespace kt } /*Generate php code - * function globalStatus() + * function globaltqStatus() * { * return array( ... ); * } */ - void PhpCodeGenerator::globalInfo(QTextStream & out) + void PhpCodeGenerator::globalInfo(TQTextStream & out) { out << "function globalInfo()\n{\nreturn array("; CurrentStats stats=core->getStats(); - out << QString("\"download_speed\" => \"%1\",").arg(KBytesPerSecToString2(stats.download_speed / 1024.0)); - out << QString("\"upload_speed\" => \"%1\",").arg(KBytesPerSecToString2(stats.upload_speed / 1024.0)); - out << QString("\"bytes_downloaded\" => \"%1\",").arg(stats.bytes_downloaded); - out << QString("\"bytes_uploaded\" => \"%1\",").arg(stats.bytes_uploaded); - out << QString("\"max_download_speed\" => \"%1\",").arg(core->getMaxDownloadSpeed()); - out << QString("\"max_upload_speed\" => \"%1\",").arg(core->getMaxUploadSpeed()); - out << QString("\"max_downloads\" => \"%1\",").arg(Settings::maxDownloads()); - out << QString("\"max_seeds\"=> \"%1\",").arg(Settings::maxSeeds()); - out << QString("\"dht_support\" => \"%1\",").arg(Settings::dhtSupport()); - out << QString("\"use_encryption\" => \"%1\"").arg(Settings::useEncryption()); + out << TQString("\"download_speed\" => \"%1\",").tqarg(KBytesPerSecToString2(stats.download_speed / 1024.0)); + out << TQString("\"upload_speed\" => \"%1\",").tqarg(KBytesPerSecToString2(stats.upload_speed / 1024.0)); + out << TQString("\"bytes_downloaded\" => \"%1\",").tqarg(stats.bytes_downloaded); + out << TQString("\"bytes_uploaded\" => \"%1\",").tqarg(stats.bytes_uploaded); + out << TQString("\"max_download_speed\" => \"%1\",").tqarg(core->getMaxDownloadSpeed()); + out << TQString("\"max_upload_speed\" => \"%1\",").tqarg(core->getMaxUploadSpeed()); + out << TQString("\"max_downloads\" => \"%1\",").tqarg(Settings::maxDownloads()); + out << TQString("\"max_seeds\"=> \"%1\",").tqarg(Settings::maxSeeds()); + out << TQString("\"dht_support\" => \"%1\",").tqarg(Settings::dhtSupport()); + out << TQString("\"use_encryption\" => \"%1\"").tqarg(Settings::useEncryption()); out << ");\n}\n"; } @@ -193,14 +193,14 @@ namespace kt bool ret = false; shutdown = false; int separator_loc; - QString parse; - QString torrent_num; - QString file_num; + TQString parse; + TQString torrent_num; + TQString file_num; KURL redirected_url; redirected_url.setPath(url.path()); - const QMap<QString, QString> & params = url.queryItems(); - QMap<QString, QString>::ConstIterator it; + const TQMap<TQString, TQString> & params = url.queryItems(); + TQMap<TQString, TQString>::ConstIterator it; for ( it = params.begin(); it != params.end(); ++it ) { @@ -263,14 +263,14 @@ namespace kt break; case 'f': //parse argument into torrent number and file number - separator_loc=it.data().find('-'); + separator_loc=it.data().tqfind('-'); parse=it.data(); torrent_num.append(parse.left(separator_loc)); file_num.append(parse.right(parse.length()-(separator_loc+1))); if(it.key()=="file_lp") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(torrent_num.toInt()==k) @@ -284,7 +284,7 @@ namespace kt } else if(it.key()=="file_np") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(torrent_num.toInt()==k) @@ -298,7 +298,7 @@ namespace kt } else if(it.key()=="file_hp") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(torrent_num.toInt()==k) @@ -312,7 +312,7 @@ namespace kt } else if(it.key()=="file_stop") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(torrent_num.toInt()==k) @@ -410,7 +410,7 @@ namespace kt case 'r': if(it.key()=="remove") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(it.data().toInt()==k) @@ -433,7 +433,7 @@ namespace kt } else if(it.key()=="stop") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(it.data().toInt()==k) @@ -446,7 +446,7 @@ namespace kt } else if(it.key()=="start") { - QPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); + TQPtrList<TorrentInterface>::iterator i= core->getQueueManager()->begin(); for(int k=0; i != core->getQueueManager()->end(); i++, k++) { if(it.data().toInt()==k) diff --git a/plugins/webinterface/php_interface.h b/plugins/webinterface/php_interface.h index be79019..4995ae6 100644 --- a/plugins/webinterface/php_interface.h +++ b/plugins/webinterface/php_interface.h @@ -21,7 +21,7 @@ #ifndef PHP_INTERFACE_H #define PHP_INTERFACE_H -#include <qstring.h> +#include <tqstring.h> #include <torrent/peermanager.h> #include <settings.h> #include <torrent/queuemanager.h> @@ -40,8 +40,8 @@ namespace kt PhpCodeGenerator(CoreInterface *c); virtual ~PhpCodeGenerator(){} - void downloadStatus(QTextStream & out); - void globalInfo(QTextStream & out); + void downloadtqStatus(TQTextStream & out); + void globalInfo(TQTextStream & out); private: CoreInterface *core; }; diff --git a/plugins/webinterface/webinterfaceplugin.cpp b/plugins/webinterface/webinterfaceplugin.cpp index bce4115..513f3b8 100644 --- a/plugins/webinterface/webinterfaceplugin.cpp +++ b/plugins/webinterface/webinterfaceplugin.cpp @@ -40,8 +40,8 @@ K_EXPORT_COMPONENT_FACTORY(ktwebinterfaceplugin,KGenericFactory<kt::WebInterface using namespace bt; namespace kt { - WebInterfacePlugin::WebInterfacePlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name, args,NAME,i18n("Web Interface"),AUTHOR,EMAIL,i18n("Allow to control ktorrent through browser"),"toggle_log") + WebInterfacePlugin::WebInterfacePlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name, args,NAME,i18n("Web Interface"),AUTHOR,EMAIL,i18n("Allow to control ktorrent through browser"),"toggle_log") { http_server = 0; pref=0; @@ -119,7 +119,7 @@ namespace kt } } - bool WebInterfacePlugin::versionCheck(const QString & version) const + bool WebInterfacePlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/webinterface/webinterfaceplugin.h b/plugins/webinterface/webinterfaceplugin.h index 469fda2..87c0f4d 100644 --- a/plugins/webinterface/webinterfaceplugin.h +++ b/plugins/webinterface/webinterfaceplugin.h @@ -33,13 +33,14 @@ namespace kt class WebInterfacePlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - WebInterfacePlugin(QObject* parent, const char* name, const QStringList& args); + WebInterfacePlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~WebInterfacePlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; void preferencesUpdated(); private: diff --git a/plugins/webinterface/webinterfacepref.ui b/plugins/webinterface/webinterfacepref.ui index 63d368b..339af84 100644 --- a/plugins/webinterface/webinterfacepref.ui +++ b/plugins/webinterface/webinterfacepref.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>WebInterfacePreference</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>WebInterfacePreference</cstring> </property> @@ -20,7 +20,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>500</width> <height>350</height> @@ -33,7 +33,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QButtonGroup" row="0" column="0"> + <widget class="TQButtonGroup" row="0" column="0"> <property name="name"> <cstring>buttonGroup1</cstring> </property> @@ -44,15 +44,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -74,7 +74,7 @@ <number>8080</number> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>forward</cstring> </property> @@ -92,14 +92,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>54</width> <height>21</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel4</cstring> </property> @@ -126,15 +126,15 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -142,30 +142,30 @@ <string>Select interface:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>interfaceSkinBox</cstring> </property> </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="3" column="0"> + <widget class="TQLayoutWidget" row="3" column="0"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -180,7 +180,7 @@ </widget> </hbox> </widget> - <widget class="QPushButton" row="0" column="1"> + <widget class="TQPushButton" row="0" column="1"> <property name="name"> <cstring>btnPassword</cstring> </property> @@ -190,15 +190,15 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -239,11 +239,11 @@ <slot>changeLedState()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>btnUpdate_clicked()</slot> <slot>changeLedState()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> diff --git a/plugins/webinterface/webinterfaceprefpage.cpp b/plugins/webinterface/webinterfaceprefpage.cpp index 20dbc97..1e1bc16 100644 --- a/plugins/webinterface/webinterfaceprefpage.cpp +++ b/plugins/webinterface/webinterfaceprefpage.cpp @@ -43,9 +43,9 @@ namespace kt return true; } - void WebInterfacePrefPage::createWidget(QWidget* parent) + void WebInterfacePrefPage::createWidget(TQWidget* tqparent) { - m_widget = new WebInterfacePrefWidget(parent); + m_widget = new WebInterfacePrefWidget(tqparent); } void WebInterfacePrefPage::updateData() diff --git a/plugins/webinterface/webinterfaceprefpage.h b/plugins/webinterface/webinterfaceprefpage.h index a10f1c9..ee796af 100644 --- a/plugins/webinterface/webinterfaceprefpage.h +++ b/plugins/webinterface/webinterfaceprefpage.h @@ -41,7 +41,7 @@ namespace kt virtual ~WebInterfacePrefPage(); virtual bool apply(); - virtual void createWidget(QWidget* parent); + virtual void createWidget(TQWidget* tqparent); virtual void updateData(); virtual void deleteWidget(); diff --git a/plugins/webinterface/webinterfaceprefwidget.cpp b/plugins/webinterface/webinterfaceprefwidget.cpp index fc11d89..ccf9555 100644 --- a/plugins/webinterface/webinterfaceprefwidget.cpp +++ b/plugins/webinterface/webinterfaceprefwidget.cpp @@ -26,17 +26,17 @@ #include <kiconloader.h> #include <kstandarddirs.h> -#include <qwidget.h> -#include <qstring.h> -#include <qcheckbox.h> -#include <qcombobox.h> +#include <tqwidget.h> +#include <tqstring.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> #include <knuminput.h> #include <kurlrequester.h> #include <klineedit.h> #include <kpassdlg.h> #include <kmdcodec.h> #include <kled.h> -#include <qtooltip.h> +#include <tqtooltip.h> #include <net/portlist.h> #include <torrent/globals.h> @@ -44,16 +44,16 @@ using namespace bt; namespace kt { -WebInterfacePrefWidget::WebInterfacePrefWidget(QWidget *parent, const char *name):WebInterfacePreference(parent,name) +WebInterfacePrefWidget::WebInterfacePrefWidget(TQWidget *tqparent, const char *name):WebInterfacePreference(tqparent,name) { port->setValue(WebInterfacePluginSettings::port()); forward->setChecked(WebInterfacePluginSettings::forward()); sessionTTL->setValue(WebInterfacePluginSettings::sessionTTL()); - QStringList dirList=KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www"); - QDir d(*(dirList.begin())); - QStringList skinList=d.entryList(QDir::Dirs); - for ( QStringList::Iterator it = skinList.begin(); it != skinList.end(); ++it ){ + TQStringList dirList=KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www"); + TQDir d(*(dirList.begin())); + TQStringList skinList=d.entryList(TQDir::Dirs); + for ( TQStringList::Iterator it = skinList.begin(); it != skinList.end(); ++it ){ if(*it=="." || *it=="..") continue; interfaceSkinBox->insertItem(*it); @@ -62,11 +62,11 @@ WebInterfacePrefWidget::WebInterfacePrefWidget(QWidget *parent, const char *name interfaceSkinBox->setCurrentText (WebInterfacePluginSettings::skin()); if(WebInterfacePluginSettings::phpExecutablePath().isEmpty()){ - QString phpPath=KStandardDirs::findExe("php"); - if(phpPath==QString::null) + TQString phpPath=KStandardDirs::findExe("php"); + if(phpPath==TQString()) phpPath=KStandardDirs::findExe("php-cli"); - if(phpPath==QString::null) + if(phpPath==TQString()) phpExecutablePath->setURL (i18n("Php executable is not in default path, please enter the path manually")); else phpExecutablePath->setURL (phpPath); @@ -102,7 +102,7 @@ bool WebInterfacePrefWidget::apply() void WebInterfacePrefWidget::btnUpdate_clicked() { - QCString passwd; + TQCString passwd; int result = KPasswordDialog::getNewPassword(passwd, i18n("Please enter a new password for the web interface.")); if (result == KPasswordDialog::Accepted) password=passwd; @@ -111,25 +111,25 @@ void WebInterfacePrefWidget::btnUpdate_clicked() void WebInterfacePrefWidget::changeLedState() { - QFileInfo fi(phpExecutablePath->url()); + TQFileInfo fi(phpExecutablePath->url()); if(fi.isExecutable() && (fi.isFile() || fi.isSymLink())){ - QToolTip::add( kled, i18n("%1 exists and it is executable").arg(phpExecutablePath->url())); + TQToolTip::add( kled, i18n("%1 exists and it is executable").tqarg(phpExecutablePath->url())); kled->setColor(green); } else if (!fi.exists()){ - QToolTip::add( kled, i18n("%1 does not exist").arg(phpExecutablePath->url()) ); + TQToolTip::add( kled, i18n("%1 does not exist").tqarg(phpExecutablePath->url()) ); kled->setColor(red); } else if (!fi.isExecutable()){ - QToolTip::add( kled, i18n("%1 is not executable").arg(phpExecutablePath->url()) ); + TQToolTip::add( kled, i18n("%1 is not executable").tqarg(phpExecutablePath->url()) ); kled->setColor(red); } else if (fi.isDir()){ - QToolTip::add( kled, i18n("%1 is a directory").arg(phpExecutablePath->url()) ); + TQToolTip::add( kled, i18n("%1 is a directory").tqarg(phpExecutablePath->url()) ); kled->setColor(red); } else{ - QToolTip::add( kled, i18n("%1 is not php executable path").arg(phpExecutablePath->url()) ); + TQToolTip::add( kled, i18n("%1 is not php executable path").tqarg(phpExecutablePath->url()) ); kled->setColor(red); } } diff --git a/plugins/webinterface/webinterfaceprefwidget.h b/plugins/webinterface/webinterfaceprefwidget.h index b328efe..52bde80 100644 --- a/plugins/webinterface/webinterfaceprefwidget.h +++ b/plugins/webinterface/webinterfaceprefwidget.h @@ -28,10 +28,11 @@ namespace kt class WebInterfacePrefWidget:public WebInterfacePreference { Q_OBJECT + TQ_OBJECT public: - WebInterfacePrefWidget(QWidget *parent = 0, const char *name = 0); + WebInterfacePrefWidget(TQWidget *tqparent = 0, const char *name = 0); bool apply(); - QCString password; + TQCString password; public slots: void btnUpdate_clicked(); void changeLedState(); diff --git a/plugins/webinterface/www/coldmilk/page_update.js b/plugins/webinterface/www/coldmilk/page_update.js index c004456..dcbe62b 100644 --- a/plugins/webinterface/www/coldmilk/page_update.js +++ b/plugins/webinterface/www/coldmilk/page_update.js @@ -141,7 +141,7 @@ function update_status_bar(xmldoc) { document.createTextNode("down: " + down + " / up: " + up)); } var oldtable = document.getElementById('status_bar_table'); - oldtable.parentNode.replaceChild(newtable, oldtable); + oldtable.tqparentNode.replaceChild(newtable, oldtable); } function update_torrent_table(xmldoc) { @@ -159,7 +159,7 @@ function update_torrent_table(xmldoc) { _torrent_table_header(newtable.insertRow(0)); var oldtable = document.getElementById('torrent_list_table'); - oldtable.parentNode.replaceChild(newtable, oldtable); + oldtable.tqparentNode.replaceChild(newtable, oldtable); } function _torrent_table_row(torrent, table, i) { @@ -327,7 +327,7 @@ function get_torrents_details(xmldoc) { _torrent_table_header(newtable.insertRow(0));*/ var oldtable = document.getElementById('torrents_details_files'); - oldtable.parentNode.replaceChild(newtable, oldtable); + oldtable.tqparentNode.replaceChild(newtable, oldtable); } function _create_action_button(button_name, image_src, command) { @@ -403,7 +403,7 @@ function _get_file_status_name(status_id) } function _torrents_details_header(row) { - headers = new Array("Actions", "File", "Size", "Perc done", "Status"); + headers = new Array("Actions", "File", "Size", "Perc done", "tqStatus"); for (var i in headers) { var header = document.createElement("th"); header.appendChild(document.createTextNode(headers[i])); @@ -414,7 +414,7 @@ function _torrents_details_header(row) { function _torrent_table_header(row) { headers = new Array( - "Actions", "File", "Status", + "Actions", "File", "tqStatus", "Speed", "Size", "Peers", "Transferred", "% done" ); diff --git a/plugins/webinterface/www/coldmilk/rest.php b/plugins/webinterface/www/coldmilk/rest.php index bab7e68..a61cbfe 100644 --- a/plugins/webinterface/www/coldmilk/rest.php +++ b/plugins/webinterface/www/coldmilk/rest.php @@ -174,7 +174,7 @@ class RestInterface { // Truncate long torrent name, and HTML escape it. // This is a helper function for download_status. private function _clean_name($name) { - $name = str_replace("'", "\'", $name); + $name = str_tqreplace("'", "\'", $name); if (strlen($name) > 30) { $name = substr($name, 0, 27); $name .= "..."; @@ -203,7 +203,7 @@ class RestInterface { class KTorrentXML extends DomDocument { private $root_element; public function __construct($root, $value = null, $attributes = null) { - parent::__construct('1.0'); + tqparent::__construct('1.0'); $this->root_element = $this->createElement($root); $this->appendChild($this->root_element); $this->formatOutput = true; diff --git a/plugins/webinterface/www/default/details.php b/plugins/webinterface/www/default/details.php index a19d57e..92c8d48 100644 --- a/plugins/webinterface/www/default/details.php +++ b/plugins/webinterface/www/default/details.php @@ -1,5 +1,5 @@ <?php -$stats=downloadStatus(); +$stats=downloadtqStatus(); $num_torrent=$_REQUEST['torrent']; function cut_name_if_long($string) @@ -61,7 +61,7 @@ $display_name=cut_name_if_long($stats[$num_torrent]['torrent_name']); <tr> <th>Actions</th> <th>File</th> - <th>Status</th> + <th>tqStatus</th> <th>Size</th> <th>Complete</th> </tr> diff --git a/plugins/webinterface/www/default/interface.php b/plugins/webinterface/www/default/interface.php index 6432798..929bd94 100644 --- a/plugins/webinterface/www/default/interface.php +++ b/plugins/webinterface/www/default/interface.php @@ -1,6 +1,6 @@ <?php $globalinfo=globalInfo(); -$stats=downloadStatus(); +$stats=downloadtqStatus(); function get_torrent_status_name($status_id) { @@ -18,7 +18,7 @@ function get_torrent_status_name($status_id) 10 => 'Checking Data' ); if (array_key_exists($status_id, $table)) return $table[$status_id]; - else return 'Not supported Status'; + else return 'Not supported tqStatus'; } function generate_button_code($img, $alt, $href='') @@ -104,7 +104,7 @@ function generate_button_code($img, $alt, $href='') <tr> <th>Actions</th> <th>File</th> - <th>Status</th> + <th>tqStatus</th> <th>Downloaded</th> <th>Size</th> <th>Uploaded</th> @@ -118,7 +118,7 @@ function generate_button_code($img, $alt, $href='') foreach ($stats as $torrent) { echo "\t\t".'<tr>'."\n\t\t\t"; - $torrent_name = str_replace("'", "\'", $torrent['torrent_name']); + $torrent_name = str_tqreplace("'", "\'", $torrent['torrent_name']); if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2); else $perc = 0; if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ..."; diff --git a/plugins/webinterface/www/default/wz_tooltip.js b/plugins/webinterface/www/default/wz_tooltip.js index 1329a1b..546b421 100644 --- a/plugins/webinterface/www/default/wz_tooltip.js +++ b/plugins/webinterface/www/default/wz_tooltip.js @@ -300,7 +300,7 @@ function tt_DeAlt(t_tag) { if(t_tag.alt) t_tag.alt = ""; if(t_tag.title) t_tag.title = ""; - var t_c = t_tag.children || t_tag.childNodes || null; + var t_c = t_tag.tqchildren || t_tag.childNodes || null; if(t_c) { for(var t_i = t_c.length; t_i; ) @@ -327,7 +327,7 @@ function tt_OpDeHref(t_e) window.status = tt_tag.t_href; break; } - t_tag = t_tag.parentElement; + t_tag = t_tag.tqparentElement; } } } diff --git a/plugins/webinterface/www/mobile/interface.php b/plugins/webinterface/www/mobile/interface.php index 57582de..d2fdea9 100644 --- a/plugins/webinterface/www/mobile/interface.php +++ b/plugins/webinterface/www/mobile/interface.php @@ -18,7 +18,7 @@ <table width="100%"> <tbody> <?php - $stats=downloadStatus(); + $stats=downloadtqStatus(); $a = 0; foreach ($stats as $torrent) { echo "<tr>"; @@ -59,7 +59,7 @@ echo "<td>Checking Data</td>"; break; default: - echo "<td>Not supported Status</td>"; + echo "<td>Not supported tqStatus</td>"; } echo "<td>$perc%</td>"; $a=$a+1; diff --git a/plugins/webinterface/www/mobile/torrent.php b/plugins/webinterface/www/mobile/torrent.php index a1e451d..31d980e 100644 --- a/plugins/webinterface/www/mobile/torrent.php +++ b/plugins/webinterface/www/mobile/torrent.php @@ -8,7 +8,7 @@ <tr> <td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td> <?php - $stats=downloadStatus(); + $stats=downloadtqStatus(); $t=$stats[$_REQUEST['id']]; echo "<td><strong>ktorrent-><a href=\"interface.php\">transfers</a></strong>->{$t['torrent_name']}</td>"; echo "<td><a href=\"torrent.php?id={$_REQUEST['id']}\" >refresh</a></td>"; @@ -31,7 +31,7 @@ <tbody> <?php echo "<tr>"; - echo "<td><strong>Status: </strong></td>"; + echo "<td><strong>tqStatus: </strong></td>"; switch ($t['status']) { case 0: echo "<td>NOT_STARTED</td>"; @@ -67,7 +67,7 @@ echo "<td>CHECKING_DATA</td>"; break; default: - echo "<td>Not supported Status</td>"; + echo "<td>Not supported tqStatus</td>"; } echo "</tr>"; echo "<tr>"; diff --git a/plugins/zeroconf/avahiservice.cpp b/plugins/zeroconf/avahiservice.cpp index a190d8e..714d92a 100644 --- a/plugins/zeroconf/avahiservice.cpp +++ b/plugins/zeroconf/avahiservice.cpp @@ -19,7 +19,7 @@ #include <util/log.h> #include <torrent/peerid.h> #include <avahi-common/watch.h> -#include <avahi-qt3/qt-watch.h> +#include <avahi-qt3/tqt-watch.h> #include "localbrowser.h" #include "avahiservice.h" @@ -66,16 +66,16 @@ namespace kt } } - const char* name = avahi_strdup(QString("%1__%2%3").arg(service->id).arg((rand() % 26) + 65).arg((rand() % 26) + 65).ascii()); + const char* name = avahi_strdup(TQString("%1__%2%3").tqarg(service->id).tqarg((rand() % 26) + 65).tqarg((rand() % 26) + 65).ascii()); const char* type = avahi_strdup("_bittorrent._tcp"); - const char* subtype = avahi_strdup(QString("_" + service->infoHash + "._sub._bittorrent._tcp").ascii()); + const char* subtype = avahi_strdup(TQString("_" + service->infoHash + "._sub._bittorrent._tcp").ascii()); if (avahi_entry_group_add_service( service->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, (AvahiPublishFlags)0, name, type, NULL, NULL, service->port, NULL)) { if (avahi_client_errno(c) != -8) - Out(SYS_ZCO|LOG_DEBUG) << QString("ZC: Failed to add the service (%i).").arg(avahi_client_errno(c)) << endl; + Out(SYS_ZCO|LOG_DEBUG) << TQString("ZC: Failed to add the service (%i).").tqarg(avahi_client_errno(c)) << endl; else publish_service(service, c); return; @@ -85,7 +85,7 @@ namespace kt service->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, (AvahiPublishFlags)0, name, type, NULL, subtype)) { - Out(SYS_ZCO|LOG_DEBUG) << QString("ZC: Failed to add the service subtype (%i).").arg( avahi_client_errno(c)) << endl; + Out(SYS_ZCO|LOG_DEBUG) << TQString("ZC: Failed to add the service subtype (%i).").tqarg( avahi_client_errno(c)) << endl; return; } @@ -166,10 +166,10 @@ namespace kt { AvahiService* service = reinterpret_cast<AvahiService*>(userdata); - QString realname = QString(name); + TQString realname = TQString(name); realname.truncate(realname.length() - 5); - if (service->id != QString(realname)) + if (service->id != TQString(realname)) { char a[AVAHI_ADDRESS_STR_MAX]; avahi_address_snprint(a, sizeof(a), address); @@ -214,7 +214,7 @@ namespace kt } case AVAHI_BROWSER_REMOVE: { - QString realname = QString(name); + TQString realname = TQString(name); realname.truncate(realname.length() - 5); LocalBrowser::remove(bt::PeerID(realname.ascii())); @@ -317,7 +317,7 @@ namespace kt return false; } - if (!(browser = avahi_service_browser_new(listener, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, avahi_strdup(QString("_" + infoHash + "._sub._bittorrent._tcp").ascii()), NULL, (AvahiLookupFlags)0, browser_callback, this))) + if (!(browser = avahi_service_browser_new(listener, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, avahi_strdup(TQString("_" + infoHash + "._sub._bittorrent._tcp").ascii()), NULL, (AvahiLookupFlags)0, browser_callback, this))) { Out(SYS_ZCO|LOG_DEBUG) << "ZC: Failed to create a service browser." << endl; stop(); diff --git a/plugins/zeroconf/avahiservice.h b/plugins/zeroconf/avahiservice.h index 10938d8..fd9e144 100644 --- a/plugins/zeroconf/avahiservice.h +++ b/plugins/zeroconf/avahiservice.h @@ -27,7 +27,7 @@ */ #include <cstdlib> -#include <qstring.h> +#include <tqstring.h> #include <avahi-client/client.h> @@ -45,6 +45,7 @@ namespace kt class AvahiService : public kt::PeerSource { Q_OBJECT + TQ_OBJECT public: AvahiService(const bt::PeerID&, bt::Uint16, const bt::SHA1Hash&); virtual ~AvahiService(); @@ -95,9 +96,9 @@ namespace kt void* ); - QString id; + TQString id; int port; - QString infoHash; + TQString infoHash; bool started; diff --git a/plugins/zeroconf/zeroconfplugin.cpp b/plugins/zeroconf/zeroconfplugin.cpp index b906843..462b6a0 100644 --- a/plugins/zeroconf/zeroconfplugin.cpp +++ b/plugins/zeroconf/zeroconfplugin.cpp @@ -37,8 +37,8 @@ using namespace bt; namespace kt { - ZeroConfPlugin::ZeroConfPlugin(QObject* parent, const char* name, const QStringList& args) - : Plugin(parent, name,args,NAME,i18n("Zeroconf"),AUTHOR,QString::null,i18n("Finds peers running ktorrent on the local network to share torrents with"),"ktplugins") + ZeroConfPlugin::ZeroConfPlugin(TQObject* tqparent, const char* name, const TQStringList& args) + : Plugin(tqparent, name,args,NAME,i18n("Zeroconf"),AUTHOR,TQString(),i18n("Finds peers running ktorrent on the local network to share torrents with"),"ktplugins") { services.setAutoDelete(true); } @@ -50,14 +50,14 @@ namespace kt void ZeroConfPlugin::load() { CoreInterface* core = getCore(); - connect(core,SIGNAL(torrentAdded( kt::TorrentInterface* )), - this,SLOT(torrentAdded( kt::TorrentInterface* ))); - connect(core,SIGNAL(torrentRemoved( kt::TorrentInterface* )), - this,SLOT(torrentRemoved( kt::TorrentInterface* ))); + connect(core,TQT_SIGNAL(torrentAdded( kt::TorrentInterface* )), + this,TQT_SLOT(torrentAdded( kt::TorrentInterface* ))); + connect(core,TQT_SIGNAL(torrentRemoved( kt::TorrentInterface* )), + this,TQT_SLOT(torrentRemoved( kt::TorrentInterface* ))); // go over existing torrents and add them bt::QueueManager* qman = core->getQueueManager(); - for (QPtrList<kt::TorrentInterface>::iterator i = qman->begin();i != qman->end();i++) + for (TQPtrList<kt::TorrentInterface>::iterator i = qman->begin();i != qman->end();i++) { torrentAdded(*i); } @@ -66,10 +66,10 @@ namespace kt void ZeroConfPlugin::unload() { CoreInterface* core = getCore(); - disconnect(core,SIGNAL(torrentAdded( kt::TorrentInterface* )), - this,SLOT(torrentAdded( kt::TorrentInterface* ))); - disconnect(core,SIGNAL(torrentRemoved( kt::TorrentInterface* )), - this,SLOT(torrentRemoved( kt::TorrentInterface*))); + disconnect(core,TQT_SIGNAL(torrentAdded( kt::TorrentInterface* )), + this,TQT_SLOT(torrentAdded( kt::TorrentInterface* ))); + disconnect(core,TQT_SIGNAL(torrentRemoved( kt::TorrentInterface* )), + this,TQT_SLOT(torrentRemoved( kt::TorrentInterface*))); bt::PtrMap<kt::TorrentInterface*,AvahiService>::iterator i = services.begin(); while (i != services.end()) @@ -84,7 +84,7 @@ namespace kt void ZeroConfPlugin::torrentAdded(kt::TorrentInterface* tc) { - if (services.contains(tc)) + if (services.tqcontains(tc)) return; bt::Uint16 port = bt::Globals::instance().getServer().getPortInUse(); @@ -93,14 +93,14 @@ namespace kt tc->addPeerSource(av); Out(SYS_ZCO|LOG_NOTICE) << "ZeroConf service added for " << tc->getStats().torrent_name << endl; - connect(av,SIGNAL(serviceDestroyed( AvahiService* )), - this,SLOT(avahiServiceDestroyed( AvahiService* ))); + connect(av,TQT_SIGNAL(serviceDestroyed( AvahiService* )), + this,TQT_SLOT(avahiServiceDestroyed( AvahiService* ))); } void ZeroConfPlugin::torrentRemoved(kt::TorrentInterface* tc) { - AvahiService* av = services.find(tc); + AvahiService* av = services.tqfind(tc); if (!av) return; Out(SYS_ZCO|LOG_NOTICE) << "ZeroConf service removed for " @@ -127,7 +127,7 @@ namespace kt services.setAutoDelete(true); } - bool ZeroConfPlugin::versionCheck(const QString & version) const + bool ZeroConfPlugin::versionCheck(const TQString & version) const { return version == KT_VERSION_MACRO; } diff --git a/plugins/zeroconf/zeroconfplugin.h b/plugins/zeroconf/zeroconfplugin.h index b34e851..f658f3e 100644 --- a/plugins/zeroconf/zeroconfplugin.h +++ b/plugins/zeroconf/zeroconfplugin.h @@ -36,13 +36,14 @@ namespace kt class ZeroConfPlugin : public Plugin { Q_OBJECT + TQ_OBJECT public: - ZeroConfPlugin(QObject* parent, const char* name, const QStringList& args); + ZeroConfPlugin(TQObject* tqparent, const char* name, const TQStringList& args); virtual ~ZeroConfPlugin(); virtual void load(); virtual void unload(); - virtual bool versionCheck(const QString& version) const; + virtual bool versionCheck(const TQString& version) const; private slots: /** diff --git a/utests/biginttest.cpp b/utests/biginttest.cpp index fc8f105..36a896a 100644 --- a/utests/biginttest.cpp +++ b/utests/biginttest.cpp @@ -43,7 +43,7 @@ namespace utest b.toBuffer(buf,10); for (Uint32 i = 0;i < 10;i++) { - Out() << QString("0x%1 ").arg(buf[i],0,16); + Out() << TQString("0x%1 ").tqarg(buf[i],0,16); } Out() << endl; } @@ -67,7 +67,7 @@ namespace utest a.toBuffer(foobar,5); for (Uint32 i = 0;i < 5;i++) { - Out() << QString("0x%1 ").arg(foobar[i],0,16); + Out() << TQString("0x%1 ").tqarg(foobar[i],0,16); } Out() << endl; Out() << "Third test" << endl; diff --git a/utests/dhtmsgparsetest.cpp b/utests/dhtmsgparsetest.cpp index 44e0338..38a0deb 100644 --- a/utests/dhtmsgparsetest.cpp +++ b/utests/dhtmsgparsetest.cpp @@ -38,9 +38,9 @@ namespace utest DHTMsgParseTest::~DHTMsgParseTest() {} - bool DHTMsgParseTest::doTest(const QString & data,int method) + bool DHTMsgParseTest::doTest(const TQString & data,int method) { - QByteArray bdata(data.length()); + TQByteArray bdata(data.length()); for (int i = 0;i < data.length();i++) { @@ -74,14 +74,14 @@ namespace utest bool DHTMsgParseTest::doTest() { - QString test_str[] = { + TQString test_str[] = { "d1:rd2:id20:####################5:token20:####################6:valuesl6:######6:######6:######6:######6:######6:######6:######6:######ee1:t1:#1:y1:re", "d1:ad2:id20:####################9:info_hash20:####################e1:q9:get_peers1:t1:#1:y1:qe", "d1:rd2:id20:####################5:nodes208:################################################################################################################################################################################################################5:token20:####################e1:t1:#1:y1:re", - QString::null + TQString() }; int types[] = {dht::GET_PEERS,dht::NONE,dht::GET_PEERS}; diff --git a/utests/dhtmsgparsetest.h b/utests/dhtmsgparsetest.h index c88ec72..8e2c774 100644 --- a/utests/dhtmsgparsetest.h +++ b/utests/dhtmsgparsetest.h @@ -36,7 +36,7 @@ namespace utest virtual bool doTest(); private: - bool doTest(const QString & data,int method); + bool doTest(const TQString & data,int method); }; } diff --git a/utests/rc4test.cpp b/utests/rc4test.cpp index ef5e7c4..add45ff 100644 --- a/utests/rc4test.cpp +++ b/utests/rc4test.cpp @@ -59,15 +59,15 @@ namespace utest if (memcmp(dec,test,tlen) == 0) { Out() << "Test succesfull" << endl; - Out() << QString(test) << endl; - Out() << QString((char*)dec) << endl; + Out() << TQString(test) << endl; + Out() << TQString((char*)dec) << endl; return true; } else { Out() << "Test not succesfull" << endl; - Out() << QString(test) << endl; - Out() << QString((char*)dec) << endl; + Out() << TQString(test) << endl; + Out() << TQString((char*)dec) << endl; return false; } } diff --git a/utests/testrunner.cpp b/utests/testrunner.cpp index d518c17..3e0c2aa 100644 --- a/utests/testrunner.cpp +++ b/utests/testrunner.cpp @@ -45,7 +45,7 @@ namespace utest { int succes = 0; int failure = 0; - QPtrList<UnitTest>::iterator i = tests.begin(); + TQPtrList<UnitTest>::iterator i = tests.begin(); while (i != tests.end()) { Out() << "======================" << endl; diff --git a/utests/testrunner.h b/utests/testrunner.h index c4e7623..edc56b4 100644 --- a/utests/testrunner.h +++ b/utests/testrunner.h @@ -20,7 +20,7 @@ #ifndef UTESTTESTRUNNER_H #define UTESTTESTRUNNER_H -#include <qptrlist.h> +#include <tqptrlist.h> #include "unittest.h" namespace utest @@ -31,7 +31,7 @@ namespace utest */ class TestRunner { - QPtrList<UnitTest> tests; + TQPtrList<UnitTest> tests; public: TestRunner(); virtual ~TestRunner(); diff --git a/utests/unittest.cpp b/utests/unittest.cpp index 458ff8b..2aaa2d6 100644 --- a/utests/unittest.cpp +++ b/utests/unittest.cpp @@ -22,7 +22,7 @@ namespace utest { - UnitTest::UnitTest(const QString & name) : name(name) + UnitTest::UnitTest(const TQString & name) : name(name) {} diff --git a/utests/unittest.h b/utests/unittest.h index 6fd46d8..02889a5 100644 --- a/utests/unittest.h +++ b/utests/unittest.h @@ -20,7 +20,7 @@ #ifndef UTESTUNITTEST_H #define UTESTUNITTEST_H -#include <qstring.h> +#include <tqstring.h> namespace utest { @@ -32,12 +32,12 @@ namespace utest */ class UnitTest { - QString name; + TQString name; public: - UnitTest(const QString & name); + UnitTest(const TQString & name); virtual ~UnitTest(); - QString getName() const {return name;} + TQString getName() const {return name;} virtual bool doTest() = 0; }; diff --git a/utests/upnpparsedescriptiontest.cpp b/utests/upnpparsedescriptiontest.cpp index bbccfdd..787378f 100644 --- a/utests/upnpparsedescriptiontest.cpp +++ b/utests/upnpparsedescriptiontest.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> +#include <tqfile.h> #include <plugins/upnp/upnprouter.h> #include <plugins/upnp/upnpdescriptionparser.h> #include <util/fileops.h> @@ -360,8 +360,8 @@ namespace utest bool UPnPParseDescriptionTest::doParse(const char* data,bool forward_test) { - QString fn = "/tmp/UPnPParseDescriptionTest"; - QFile fptr(fn); + TQString fn = "/tmp/UPnPParseDescriptionTest"; + TQFile fptr(fn); if (!fptr.open(IO_WriteOnly)) { Out() << "Cannot open " << fn << " : " << fptr.errorString() << endl; @@ -370,7 +370,7 @@ namespace utest fptr.writeBlock(data,strlen(data)); fptr.close(); - kt::UPnPRouter router(QString::null,"http://foobar.com"); + kt::UPnPRouter router(TQString(),"http://foobar.com"); kt::UPnPDescriptionParser dp; if (!dp.parse(fn,&router)) diff --git a/utests/upnpparseresponsetest.cpp b/utests/upnpparseresponsetest.cpp index 0198ec7..97102cf 100644 --- a/utests/upnpparseresponsetest.cpp +++ b/utests/upnpparseresponsetest.cpp @@ -53,7 +53,7 @@ namespace utest "USN: uuid:75802409-bccb-40e7-8e6c-fa095ecce13e::urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n\r\n"; UPnPMCastSocket mcast; - UPnPRouter* r = mcast.parseResponse(QCString(test_ps)); + UPnPRouter* r = mcast.parseResponse(TQCString(test_ps)); if (r) { delete r; |