diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
commit | b0e912c8b3d02a518fedda28c3180eb4794a7520 (patch) | |
tree | 07d344862562fab58cbe2df39d13d16f2e4d2bea /libk9copy/k9processlist.cpp | |
parent | 4d695ec81fe4d4335ee82c7a9346ad9c9e144ecc (diff) | |
download | k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.tar.gz k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.zip |
TQt4 convert k9copy
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libk9copy/k9processlist.cpp')
-rw-r--r-- | libk9copy/k9processlist.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/libk9copy/k9processlist.cpp b/libk9copy/k9processlist.cpp index 8947cc5..4441548 100644 --- a/libk9copy/k9processlist.cpp +++ b/libk9copy/k9processlist.cpp @@ -12,45 +12,45 @@ #include "k9processlist.h" -#include <qstyle.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qlistview.h> -#include <qrect.h> -#include <qprogressbar.h> -#include <qpixmap.h> -#include <qapplication.h> -#include <qeventloop.h> +#include <tqstyle.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqlistview.h> +#include <tqrect.h> +#include <tqprogressbar.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqeventloop.h> #include <kpushbutton.h> -class _k9ProcessListItem : public QListViewItem { +class _k9ProcessListItem : public TQListViewItem { public: - _k9ProcessListItem(QListView *_listview,const QString & _text):QListViewItem(_listview,_text) { + _k9ProcessListItem(TQListView *_listview,const TQString & _text):TQListViewItem(_listview,_text) { m_fileName=""; m_pos=0; m_num=_listview->childCount(); } - void setFileName(const QString &_fileName) { m_fileName=_fileName;} + void setFileName(const TQString &_fileName) { m_fileName=_fileName;} void setPos(double _pos) { m_pos=_pos;} - QString getFileName() const { return m_fileName;} + TQString getFileName() const { return m_fileName;} double getPos() const { return m_pos;} - int compare ( QListViewItem * i, int col, bool ascending ) const { + int compare ( TQListViewItem * i, int col, bool ascending ) const { return m_num-((_k9ProcessListItem*)i)->m_num; } private: - QString m_fileName; + TQString m_fileName; double m_pos; int m_num; }; -k9ProcessList::k9ProcessList(QWidget* parent, const char* name, WFlags fl) : processList(parent,name,fl) +k9ProcessList::k9ProcessList(TQWidget* tqparent, const char* name, WFlags fl) : processList(tqparent,name,fl) { m_processes.setAutoDelete(true); m_maxProcess=4; - connect(&m_timer,SIGNAL(timeout()),this,SLOT(timeout())); + connect(&m_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(timeout())); bCancel->setEnabled(false); } @@ -60,7 +60,7 @@ k9ProcessList::~k9ProcessList() /*$SPECIALIZATION$*/ void k9ProcessList::timeout() { if (m_waitSync) { - QApplication::eventLoop()->exitLoop(); + TQApplication::eventLoop()->exitLoop(); m_waitSync=false; } } @@ -77,7 +77,7 @@ void k9ProcessList::bCancelClick() { void k9ProcessList::wait(int _msec) { m_waitSync=true; m_timer.start(_msec,true); - QApplication::eventLoop()->enterLoop(); + TQApplication::eventLoop()->enterLoop(); } int k9ProcessList::getNbRunning() { @@ -96,7 +96,7 @@ void k9ProcessList::execute() { m_cancel=false; m_error=false; k9Process *p=NULL; - for (QPtrListStdIterator <k9Process> it=m_processes.begin() ;it!=m_processes.end() ;++it ) { + for (TQPtrListStdIterator <k9Process> it=m_processes.begin() ;it!=m_processes.end() ;++it ) { p=(*it); while (getNbRunning() >=m_maxProcess && ! m_cancel) { wait(1000); @@ -114,28 +114,28 @@ void k9ProcessList::execute() { bCancel->setEnabled(false); } -void k9ProcessList::addProgress(const QString &_text) { - QListViewItem *item = new _k9ProcessListItem(lProcess,_text); - QProgressBar b(this); +void k9ProcessList::addProgress(const TQString &_text) { + TQListViewItem *item = new _k9ProcessListItem(lProcess,_text); + TQProgressBar b(this); b.setProgress(100,100); b.resize(100,40); - item->setPixmap(0,QPixmap::grabWidget(&b,0,0,b.width(),b.height())); + item->setPixmap(0,TQPixmap::grabWidget(&b,0,0,b.width(),b.height())); } void k9ProcessList::setProgress (k9Process * _process,int _position, int _total) { - QProgressBar b(this); + TQProgressBar b(this); b.setProgress(_position,_total); b.resize(100,40); - QListViewItem *it =m_items[_process]; - it->setPixmap(0,QPixmap::grabWidget(&b,0,0,b.width(),b.height())); + TQListViewItem *it =m_items[_process]; + it->setPixmap(0,TQPixmap::grabWidget(&b,0,0,b.width(),b.height())); } -void k9ProcessList::setText(k9Process *_process, const QString &_text,int _col) { - QListViewItem *it =m_items[_process]; +void k9ProcessList::setText(k9Process *_process, const TQString &_text,int _col) { + TQListViewItem *it =m_items[_process]; it->setText(_col,_text); } -void k9ProcessList::setFileName(k9Process *_process,const QString &_fileName) { +void k9ProcessList::setFileName(k9Process *_process,const TQString &_fileName) { _k9ProcessListItem *it = (_k9ProcessListItem*)m_items[_process]; it->setFileName(_fileName); @@ -146,14 +146,14 @@ void k9ProcessList::setPos(k9Process *_process,double _pos) { it->setPos(_pos); } -k9Process *k9ProcessList::addProcess(const QString &label) { - QString name=QString("process%1").arg(m_items.count()) ; - k9Process *process=new k9Process(this,name.latin1()); +k9Process *k9ProcessList::addProcess(const TQString &label) { + TQString name=TQString("process%1").tqarg(m_items.count()) ; + k9Process *process=new k9Process(TQT_TQOBJECT(this),name.latin1()); m_processes.append(process); - QListViewItem *item = new _k9ProcessListItem(lProcess,label); + TQListViewItem *item = new _k9ProcessListItem(lProcess,label); m_items[process]=item; setProgress(process,0,100); - connect(process,SIGNAL(processExited( KProcess* )),this,SLOT(processExited(KProcess*))); + connect(process,TQT_SIGNAL(processExited( KProcess* )),this,TQT_SLOT(processExited(KProcess*))); return process; } |