diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/filetransferwindow | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/filetransferwindow')
3 files changed, 135 insertions, 134 deletions
diff --git a/src/modules/filetransferwindow/filetransferwindow.cpp b/src/modules/filetransferwindow/filetransferwindow.cpp index a3951a7c..e26cc600 100644 --- a/src/modules/filetransferwindow/filetransferwindow.cpp +++ b/src/modules/filetransferwindow/filetransferwindow.cpp @@ -36,22 +36,22 @@ #include "kvi_input.h" #include "kvi_qstring.h" -#include <qsplitter.h> -#include <qtooltip.h> +#include <tqsplitter.h> +#include <tqtooltip.h> #include "kvi_tal_hbox.h" #ifdef COMPILE_USE_QT4 - #include <q3header.h> + #include <tq3header.h> #else - #include <qheader.h> + #include <tqheader.h> #endif -#include <qpainter.h> -#include <qmessagebox.h> -#include <qclipboard.h> -#include <qfileinfo.h> -#include <qfile.h> -#include <qlabel.h> -#include <qfontmetrics.h> -#include <qevent.h> +#include <tqpainter.h> +#include <tqmessagebox.h> +#include <tqclipboard.h> +#include <tqfileinfo.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqfontmetrics.h> +#include <tqevent.h> #ifdef COMPILE_KDE_SUPPORT #include <kurl.h> @@ -75,9 +75,9 @@ KviFileTransferItem::~KviFileTransferItem() m_pTransfer->setDisplayItem(0); } -QString KviFileTransferItem::key(int column,bool bAcending) const +TQString KviFileTransferItem::key(int column,bool bAcending) const { - QString ret; + TQString ret; ret.setNum(m_pTransfer->id()); if(ret.length() == 1)ret.prepend("0000000"); else if(ret.length() == 2)ret.prepend("000000"); @@ -89,10 +89,10 @@ QString KviFileTransferItem::key(int column,bool bAcending) const return ret; } -void KviFileTransferItem::paintCell(QPainter * p,const QColorGroup &cg,int column,int width,int align) +void KviFileTransferItem::paintCell(TQPainter * p,const TQColorGroup &cg,int column,int width,int align) { - QPainter * newP; - QPixmap * pix = 0; + TQPainter * newP; + TQPixmap * pix = 0; if(p->device() == listView()->viewport()) { // ops.. there is no double buffering active ? @@ -111,7 +111,7 @@ void KviFileTransferItem::paintCell(QPainter * p,const QColorGroup &cg,int colum } } } - newP = new QPainter(pix); + newP = new TQPainter(pix); } else { newP = p; } @@ -120,9 +120,9 @@ void KviFileTransferItem::paintCell(QPainter * p,const QColorGroup &cg,int colum newP->setPen(isSelected() ? cg.highlight() : cg.base()); newP->drawRect(0,0,width,height()); - newP->setPen(m_pTransfer->active() ? QColor(180,180,180) : QColor(200,200,200)); + newP->setPen(m_pTransfer->active() ? TQColor(180,180,180) : TQColor(200,200,200)); newP->drawRect(1,1,width - 2,height() - 2); - newP->fillRect(2,2,width - 4,height() - 4,m_pTransfer->active() ? QColor(240,240,240) : QColor(225,225,225)); + newP->fillRect(2,2,width - 4,height() - 4,m_pTransfer->active() ? TQColor(240,240,240) : TQColor(225,225,225)); m_pTransfer->displayPaint(newP,column,width,height()); @@ -148,15 +148,15 @@ KviFileTransferWindow::KviFileTransferWindow(KviModuleExtensionDescriptor * d,Kv m_pLocalFilePopup = 0; m_pOpenFilePopup = 0; - m_pMemPixmap = new QPixmap(1,1); + m_pMemPixmap = new TQPixmap(1,1); - m_pTimer = new QTimer(this); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + m_pTimer = new TQTimer(this); + connect(m_pTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); m_pInput = new KviInput(this,0); - m_pSplitter = new QSplitter(Qt::Horizontal,this,"splitter"); - m_pVertSplitter = new QSplitter(Qt::Vertical,m_pSplitter,"vsplitter"); + m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter"); + m_pVertSplitter = new TQSplitter(Qt::Vertical,m_pSplitter,"vsplitter"); m_pListView = new KviTalListView(m_pVertSplitter); //m_pListView->header()->hide(); @@ -166,26 +166,26 @@ KviFileTransferWindow::KviFileTransferWindow(KviModuleExtensionDescriptor * d,Kv m_pListView->addColumn(__tr2qs_ctx("Progress","filetransferwindow"),350); KviDynamicToolTip * tp = new KviDynamicToolTip(m_pListView->viewport()); - connect(tp,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); + connect(tp,TQT_SIGNAL(tipRequest(KviDynamicToolTip *,const TQPoint &)),this,TQT_SLOT(tipRequest(KviDynamicToolTip *,const TQPoint &))); //m_pListView->setFocusPolicy(NoFocus); //m_pListView->viewport()->setFocusPolicy(NoFocus); - //connect(m_pListView,SIGNAL(rightButtonPressed(KviTalListViewItem *,const QPoint &,int)), - // this,SLOT(showHostPopup(KviTalListViewItem *,const QPoint &,int))); + //connect(m_pListView,TQT_SIGNAL(rightButtonPressed(KviTalListViewItem *,const TQPoint &,int)), + // this,TQT_SLOT(showHostPopup(KviTalListViewItem *,const TQPoint &,int))); - QFontMetrics fm(font()); + TQFontMetrics fm(font()); m_iLineSpacing = fm.lineSpacing(); m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this); m_pListView->installEventFilter(this); - connect(m_pListView,SIGNAL(rightButtonPressed(KviTalListViewItem *,const QPoint &,int)),this,SLOT(rightButtonPressed(KviTalListViewItem *,const QPoint &,int))); - connect(m_pListView,SIGNAL(doubleClicked(KviTalListViewItem *,const QPoint &,int)),this,SLOT(doubleClicked(KviTalListViewItem *,const QPoint &,int))); + connect(m_pListView,TQT_SIGNAL(rightButtonPressed(KviTalListViewItem *,const TQPoint &,int)),this,TQT_SLOT(rightButtonPressed(KviTalListViewItem *,const TQPoint &,int))); + connect(m_pListView,TQT_SIGNAL(doubleClicked(KviTalListViewItem *,const TQPoint &,int)),this,TQT_SLOT(doubleClicked(KviTalListViewItem *,const TQPoint &,int))); fillTransferView(); - connect(KviFileTransferManager::instance(),SIGNAL(transferRegistered(KviFileTransfer *)),this,SLOT(transferRegistered(KviFileTransfer *))); - connect(KviFileTransferManager::instance(),SIGNAL(transferUnregistering(KviFileTransfer *)),this,SLOT(transferUnregistering(KviFileTransfer *))); + connect(KviFileTransferManager::instance(),TQT_SIGNAL(transferRegistered(KviFileTransfer *)),this,TQT_SLOT(transferRegistered(KviFileTransfer *))); + connect(KviFileTransferManager::instance(),TQT_SIGNAL(transferUnregistering(KviFileTransfer *)),this,TQT_SLOT(transferUnregistering(KviFileTransfer *))); KviFileTransferManager::instance()->setTransferWindow(this); @@ -201,14 +201,14 @@ KviFileTransferWindow::~KviFileTransferWindow() delete m_pMemPixmap; } -bool KviFileTransferWindow::eventFilter( QObject *obj, QEvent *ev ) +bool KviFileTransferWindow::eventFilter( TQObject *obj, TQEvent *ev ) { - if( (obj==m_pListView) && ( ev->type() == QEvent::KeyPress ) ) + if( (TQT_BASE_OBJECT(obj)==TQT_BASE_OBJECT(m_pListView)) && ( ev->type() == TQEvent::KeyPress ) ) { - QKeyEvent *keyEvent = (QKeyEvent*)ev; + TQKeyEvent *keyEvent = (TQKeyEvent*)ev; switch(keyEvent->key()) { - case Qt::Key_Delete: + case TQt::Key_Delete: if(m_pListView->currentItem()) { delete m_pListView->currentItem(); @@ -220,20 +220,20 @@ bool KviFileTransferWindow::eventFilter( QObject *obj, QEvent *ev ) return KviWindow::eventFilter( obj, ev ); } -void KviFileTransferWindow::fontChange(const QFont &oldFont) +void KviFileTransferWindow::fontChange(const TQFont &oldFont) { - QFontMetrics fm(font()); + TQFontMetrics fm(font()); m_iLineSpacing = fm.lineSpacing(); KviWindow::fontChange(oldFont); } -void KviFileTransferWindow::tipRequest(KviDynamicToolTip * tip,const QPoint &pnt) +void KviFileTransferWindow::tipRequest(KviDynamicToolTip * tip,const TQPoint &pnt) { KviFileTransferItem * it = (KviFileTransferItem *)m_pListView->itemAt(pnt); if(!it)return; - QString txt = it->transfer()->tipText(); - tip->tip(m_pListView->itemRect(it),txt); + TQString txt = it->transfer()->tipText(); + tip->tip(m_pListView->tqitemRect(it),txt); } void KviFileTransferWindow::fillTransferView() @@ -273,20 +273,20 @@ void KviFileTransferWindow::transferUnregistering(KviFileTransfer * t) it = 0; } -void KviFileTransferWindow::doubleClicked(KviTalListViewItem *it,const QPoint &pnt,int col) +void KviFileTransferWindow::doubleClicked(KviTalListViewItem *it,const TQPoint &pnt,int col) { if(it) openLocalFile(); } -void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const QPoint &pnt,int col) +void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const TQPoint &pnt,int col) { if(!m_pContextPopup)m_pContextPopup = new KviTalPopupMenu(this); if(!m_pLocalFilePopup)m_pLocalFilePopup = new KviTalPopupMenu(this); if(!m_pOpenFilePopup) { m_pOpenFilePopup= new KviTalPopupMenu(this); - connect(m_pOpenFilePopup,SIGNAL(activated(int)),this,SLOT(openFilePopupActivated(int))); + connect(m_pOpenFilePopup,TQT_SIGNAL(activated(int)),this,TQT_SLOT(openFilePopupActivated(int))); } m_pContextPopup->clear(); @@ -300,20 +300,20 @@ void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const QPoi if(i->transfer()) { - QString szFile = i->transfer()->localFileName(); + TQString szFile = i->transfer()->localFileName(); if(!szFile.isEmpty()) { m_pLocalFilePopup->clear(); - QString tmp = "<b>file:/"; + TQString tmp = "<b>file:/"; tmp += szFile; tmp += "</b><br>"; - QFileInfo fi(szFile); + TQFileInfo fi(szFile); if(fi.exists()) { tmp += "<nobr>"; - tmp += __tr2qs_ctx("Size: %1","filetransferwindow").arg(KviQString::makeSizeReadable(fi.size())); + tmp += __tr2qs_ctx("Size: %1","filetransferwindow").tqarg(KviTQString::makeSizeReadable(fi.size())); tmp += "</nobr><br>"; } @@ -323,15 +323,15 @@ void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const QPoi tmp += "</nobr>"; #endif //COMPILE_KDE_SUPPORT - QLabel * l = new QLabel(tmp,m_pLocalFilePopup); - l->setFrameStyle(QFrame::Raised | QFrame::Panel); + TQLabel * l = new TQLabel(tmp,m_pLocalFilePopup); + l->setFrameStyle(TQFrame::Raised | TQFrame::Panel); m_pLocalFilePopup->insertItem(l); #ifdef COMPILE_KDE_SUPPORT - QString mimetype = KMimeType::findByPath(szFile)->name(); + TQString mimetype = KMimeType::findByPath(szFile)->name(); KServiceTypeProfile::OfferList offers = KServiceTypeProfile::offers(mimetype,"Application"); - id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Open","filetransferwindow"),this,SLOT(openLocalFile())); + id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Open","filetransferwindow"),this,TQT_SLOT(openLocalFile())); m_pLocalFilePopup->setItemParameter(id,-1); m_pOpenFilePopup->clear(); @@ -349,32 +349,32 @@ void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const QPoi m_pOpenFilePopup->insertSeparator(); - id = m_pOpenFilePopup->insertItem(__tr2qs_ctx("&Other...","filetransferwindow"),this,SLOT(openLocalFileWith())); + id = m_pOpenFilePopup->insertItem(__tr2qs_ctx("&Other...","filetransferwindow"),this,TQT_SLOT(openLocalFileWith())); m_pOpenFilePopup->setItemParameter(id,-1); m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &With","filetransferwindow"),m_pOpenFilePopup); m_pLocalFilePopup->insertSeparator(); - m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &Location","filetransferwindow"),this,SLOT(openLocalFileFolder())); - m_pLocalFilePopup->insertItem(__tr2qs_ctx("Terminal at Location","filetransferwindow"),this,SLOT(openLocalFileTerminal())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &Location","filetransferwindow"),this,TQT_SLOT(openLocalFileFolder())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("Terminal at Location","filetransferwindow"),this,TQT_SLOT(openLocalFileTerminal())); m_pLocalFilePopup->insertSeparator(); #endif //COMPILE_KDE_SUPPORT //-| Grifisx & Noldor |- #ifdef COMPILE_ON_WINDOWS - id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Open","filetransferwindow"),this,SLOT(openLocalFile())); + id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Open","filetransferwindow"),this,TQT_SLOT(openLocalFile())); m_pLocalFilePopup->setItemParameter(id,-1); m_pOpenFilePopup->insertSeparator(); - m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &With","filetransferwindow"),this,SLOT(openLocalFileWith())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &With","filetransferwindow"),this,TQT_SLOT(openLocalFileWith())); m_pLocalFilePopup->insertSeparator(); - m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &Location","filetransferwindow"),this,SLOT(openLocalFileFolder())); - m_pLocalFilePopup->insertItem(__tr2qs_ctx("MS-DOS Prompt at Location","filetransferwindow"),this,SLOT(openLocalFileTerminal())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("Open &Location","filetransferwindow"),this,TQT_SLOT(openLocalFileFolder())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("MS-DOS Prompt at Location","filetransferwindow"),this,TQT_SLOT(openLocalFileTerminal())); m_pLocalFilePopup->insertSeparator(); #endif //COMPILE_ON_WINDOWS // G&N end - m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Copy Path to Clipboard","filetransferwindow"),this,SLOT(copyLocalFileToClipboard())); + m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Copy Path to Clipboard","filetransferwindow"),this,TQT_SLOT(copyLocalFileToClipboard())); - id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Delete file","filetransferwindow"),this,SLOT(deleteLocalFile())); + id = m_pLocalFilePopup->insertItem(__tr2qs_ctx("&Delete file","filetransferwindow"),this,TQT_SLOT(deleteLocalFile())); m_pLocalFilePopup->setItemEnabled(id,i->transfer()->terminated()); m_pContextPopup->insertItem(__tr2qs_ctx("Local &File","filetransferwindow"),m_pLocalFilePopup); @@ -399,14 +399,14 @@ void KviFileTransferWindow::rightButtonPressed(KviTalListViewItem *it,const QPoi item = (KviFileTransferItem *)item->nextSibling(); } - id = m_pContextPopup->insertItem(__tr2qs_ctx("&Clear Terminated","filetransferwindow"),this,SLOT(clearTerminated())); + id = m_pContextPopup->insertItem(__tr2qs_ctx("&Clear Terminated","filetransferwindow"),this,TQT_SLOT(clearTerminated())); m_pContextPopup->setItemEnabled(id,bHaveTerminated); bool bAreTransfersActive = false; if(m_pListView->childCount() >= 1) bAreTransfersActive = true; - id = m_pContextPopup->insertItem(__tr2qs_ctx("Clear &All","filetransferwindow"),this,SLOT(clearAll())); + id = m_pContextPopup->insertItem(__tr2qs_ctx("Clear &All","filetransferwindow"),this,TQT_SLOT(clearAll())); m_pContextPopup->setItemEnabled(id,bAreTransfersActive); m_pContextPopup->popup(pnt); @@ -426,14 +426,14 @@ void KviFileTransferWindow::openFilePopupActivated(int id) #ifdef COMPILE_KDE_SUPPORT int ip = m_pOpenFilePopup->itemParameter(id); if(ip < 0)return; - QString txt = m_pOpenFilePopup->text(id); + TQString txt = m_pOpenFilePopup->text(id); KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - QString mimetype = KMimeType::findByPath(tmp)->name(); + TQString mimetype = KMimeType::findByPath(tmp)->name(); KServiceTypeProfile::OfferList offers = KServiceTypeProfile::offers(mimetype,"Application"); for(KServiceTypeProfile::OfferList::Iterator itOffers = offers.begin(); @@ -458,9 +458,9 @@ void KviFileTransferWindow::openLocalFileTerminal() #ifdef COMPILE_ON_WINDOWS KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - int idx = tmp.findRev("/"); + int idx = tmp.tqfindRev("/"); if(idx == -1)return; tmp = tmp.left(idx); tmp.append("\""); @@ -473,10 +473,10 @@ void KviFileTransferWindow::openLocalFileTerminal() #ifdef COMPILE_KDE_SUPPORT KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - int idx = tmp.findRev("/"); + int idx = tmp.tqfindRev("/"); if(idx == -1)return; tmp = tmp.left(idx); @@ -493,17 +493,17 @@ void KviFileTransferWindow::deleteLocalFile() KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString fName = t->localFileName(); - QString tmp; + TQString fName = t->localFileName(); + TQString tmp; - KviQString::sprintf(tmp,__tr2qs_ctx("Do you really want to delete the file %Q?","filetransferwindow"),&fName); + KviTQString::sprintf(tmp,__tr2qs_ctx("Do you really want to delete the file %Q?","filetransferwindow"),&fName); - if(QMessageBox::warning(this,__tr2qs_ctx("Confirm delete","filetransferwindow"), + if(TQMessageBox::warning(this,__tr2qs_ctx("Confirm delete","filetransferwindow"), tmp,__tr2qs_ctx("Yes","filetransferwindow"),__tr2qs_ctx("No","filetransferwindow")) != 0) return; - if(!QFile::remove(fName)) - QMessageBox::warning(this,__tr2qs_ctx("Delete failed","filetransferwindow"), + if(!TQFile::remove(fName)) + TQMessageBox::warning(this,__tr2qs_ctx("Delete failed","filetransferwindow"), __tr2qs_ctx("Failed to remove the file","filetransferwindow"), __tr2qs_ctx("OK","filetransferwindow")); } @@ -516,19 +516,19 @@ void KviFileTransferWindow::openLocalFile() KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - tmp.replace("/","\\"); + tmp.tqreplace("/","\\"); ShellExecute(0,"open",tmp.local8Bit().data(),NULL,NULL,SW_SHOWNORMAL); //You have to link the shell32.lib #else //!COMPILE_ON_WINDOWS // G&N end #ifdef COMPILE_KDE_SUPPORT KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - QString mimetype = KMimeType::findByPath(tmp)->name(); //KMimeType + TQString mimetype = KMimeType::findByPath(tmp)->name(); //KMimeType KService::Ptr offer = KServiceTypeProfile::preferredService(mimetype,"Application"); if(!offer) { @@ -551,9 +551,9 @@ void KviFileTransferWindow::openLocalFileWith() #ifdef COMPILE_ON_WINDOWS KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - tmp.replace("/","\\"); + tmp.tqreplace("/","\\"); tmp.prepend("rundll32.exe shell32.dll,OpenAs_RunDLL "); // this if to show the 'open with...' window WinExec(tmp.local8Bit().data(),SW_SHOWNORMAL); #else //!COMPILE_ON_WINDOWS @@ -561,7 +561,7 @@ void KviFileTransferWindow::openLocalFileWith() #ifdef COMPILE_KDE_SUPPORT KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; KURL::List lst; @@ -577,15 +577,15 @@ void KviFileTransferWindow::copyLocalFileToClipboard() { KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; #ifdef COMPILE_USE_QT4 - QApplication::clipboard()->setText(tmp); + TQApplication::tqclipboard()->setText(tmp); #else - QApplication::clipboard()->setSelectionMode(false); - QApplication::clipboard()->setText(tmp); - QApplication::clipboard()->setSelectionMode(true); - QApplication::clipboard()->setText(tmp); + TQApplication::tqclipboard()->setSelectionMode(false); + TQApplication::tqclipboard()->setText(tmp); + TQApplication::tqclipboard()->setSelectionMode(true); + TQApplication::tqclipboard()->setText(tmp); #endif } @@ -595,10 +595,10 @@ void KviFileTransferWindow::openLocalFileFolder() #ifdef COMPILE_ON_WINDOWS KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - tmp=QFileInfo(tmp).dirPath(TRUE); - tmp.replace('/','\\'); + tmp=TQFileInfo(tmp).dirPath(TRUE); + tmp.tqreplace('/','\\'); tmp.prepend("explorer.exe "); WinExec(tmp.local8Bit().data(), SW_MAXIMIZE); #else //!COMPILE_ON_WINDOWS @@ -606,14 +606,14 @@ void KviFileTransferWindow::openLocalFileFolder() #ifdef COMPILE_KDE_SUPPORT KviFileTransfer * t = selectedTransfer(); if(!t)return; - QString tmp = t->localFileName(); + TQString tmp = t->localFileName(); if(tmp.isEmpty())return; - int idx = tmp.findRev("/"); + int idx = tmp.tqfindRev("/"); if(idx == -1)return; tmp = tmp.left(idx); - QString mimetype = KMimeType::findByPath(tmp)->name(); // inode/directory + TQString mimetype = KMimeType::findByPath(tmp)->name(); // inode/directory KService::Ptr offer = KServiceTypeProfile::preferredService(mimetype,"Application"); if(!offer)return; @@ -634,20 +634,20 @@ void KviFileTransferWindow::heartbeat() KviTalListViewItem * i1; KviTalListViewItem * i2; - i1 = m_pListView->itemAt(QPoint(1,1)); + i1 = m_pListView->itemAt(TQPoint(1,1)); if(!i1) { m_pListView->viewport()->update(); return; } - i2 = m_pListView->itemAt(QPoint(1,m_pListView->viewport()->height() - 2)); + i2 = m_pListView->itemAt(TQPoint(1,m_pListView->viewport()->height() - 2)); if(i2)i2 = i2->nextSibling(); while(i1 && (i1 != i2)) { if(((KviFileTransferItem *)i1)->transfer()->active()) { - m_pListView->repaintItem(i1); + m_pListView->tqrepaintItem(i1); } i1 = i1->nextSibling(); } @@ -655,7 +655,7 @@ void KviFileTransferWindow::heartbeat() void KviFileTransferWindow::clearAll() { - QString tmp; + TQString tmp; bool bHaveAllTerminated = true; KviFileTransferItem * item = (KviFileTransferItem *)m_pListView->firstChild(); @@ -669,11 +669,11 @@ void KviFileTransferWindow::clearAll() item = (KviFileTransferItem *)item->nextSibling(); } - KviQString::sprintf(tmp,__tr2qs_ctx("Clear all transfers, including any in progress?","filetransferwindow")); + KviTQString::sprintf(tmp,__tr2qs_ctx("Clear all transfers, including any in progress?","filetransferwindow")); // If any transfer is active asks for confirm if(!bHaveAllTerminated) - if(QMessageBox::warning(this,__tr2qs_ctx("Clear All Transfers? - KVIrc","filetransferwindow"), tmp,__tr2qs_ctx("Yes","filetransferwindow"),__tr2qs_ctx("No","filetransferwindow")) != 0) + if(TQMessageBox::warning(this,__tr2qs_ctx("Clear All Transfers? - KVIrc","filetransferwindow"), tmp,__tr2qs_ctx("Yes","filetransferwindow"),__tr2qs_ctx("No","filetransferwindow")) != 0) return; KviFileTransferManager::instance()->killAllTransfers(); @@ -689,21 +689,21 @@ void KviFileTransferWindow::getBaseLogFileName(KviStr &buffer) buffer.sprintf("FILETRANSFER"); } -QPixmap * KviFileTransferWindow::myIconPtr() +TQPixmap * KviFileTransferWindow::myIconPtr() { return g_pIconManager->getSmallIcon(KVI_SMALLICON_FILETRANSFER); } -void KviFileTransferWindow::resizeEvent(QResizeEvent *e) +void KviFileTransferWindow::resizeEvent(TQResizeEvent *e) { int h = m_pInput->heightHint(); m_pSplitter->setGeometry(0,0,width(),height() - h); m_pInput->setGeometry(0,height() - h,width(),h); } -QSize KviFileTransferWindow::sizeHint() const +TQSize KviFileTransferWindow::tqsizeHint() const { - return m_pSplitter->sizeHint(); + return m_pSplitter->tqsizeHint(); } void KviFileTransferWindow::fillCaptionBuffers() @@ -737,7 +737,7 @@ void KviFileTransferWindow::die() // KviWindowProperty p; // p.rect = externalGeometry(); // p.isDocked = isAttacched(); -// QValueList<int> l(m_pSplitter->sizes()); +// TQValueList<int> l(m_pSplitter->sizes()); // if(l.count() >= 1)p.splitWidth1 = *(l.at(0)); // if(l.count() >= 2)p.splitWidth2 = *(l.at(1)); // p.timestamp = m_pView->timestamp(); @@ -751,7 +751,7 @@ void KviFileTransferWindow::die() // //void KviFileTransferWindow::setProperties(KviWindowProperty *p) //{ -// QValueList<int> l; +// TQValueList<int> l; // l.append(p->splitWidth1); // l.append(p->splitWidth2); // m_pVertSplitter->setSizes(l); diff --git a/src/modules/filetransferwindow/filetransferwindow.h b/src/modules/filetransferwindow/filetransferwindow.h index 423dc3a1..963c12e0 100644 --- a/src/modules/filetransferwindow/filetransferwindow.h +++ b/src/modules/filetransferwindow/filetransferwindow.h @@ -35,9 +35,9 @@ #include "kvi_tal_listview.h" #include "kvi_tal_popupmenu.h" -#include <qtoolbutton.h> -#include <qtimer.h> -#include <qpixmap.h> +#include <tqtoolbutton.h> +#include <tqtimer.h> +#include <tqpixmap.h> @@ -50,9 +50,9 @@ protected: KviFileTransfer * m_pTransfer; public: KviFileTransfer * transfer(){ return m_pTransfer; }; - virtual void paintCell(QPainter * p,const QColorGroup &cg,int column,int width,int align); + virtual void paintCell(TQPainter * p,const TQColorGroup &cg,int column,int width,int align); virtual void setHeight(int h); - virtual QString key(int column,bool bAcending) const; + virtual TQString key(int column,bool bAcending) const; }; @@ -60,44 +60,45 @@ class KviFileTransferWindow : public KviWindow , public KviModuleExtension { friend class KviFileTransferItem; Q_OBJECT + TQ_OBJECT public: KviFileTransferWindow(KviModuleExtensionDescriptor * d,KviFrame * lpFrm); ~KviFileTransferWindow(); protected: - QSplitter * m_pVertSplitter; + TQSplitter * m_pVertSplitter; KviTalListView * m_pListView; KviTalPopupMenu * m_pContextPopup; KviTalPopupMenu * m_pLocalFilePopup; KviTalPopupMenu * m_pOpenFilePopup; - QTimer * m_pTimer; - QPixmap * m_pMemPixmap; + TQTimer * m_pTimer; + TQPixmap * m_pMemPixmap; int m_iLineSpacing; // cached fm value public: // Methods virtual void die(); protected: - QPixmap * memPixmap(){ return m_pMemPixmap; }; - virtual QPixmap * myIconPtr(); + TQPixmap * memPixmap(){ return m_pMemPixmap; }; + virtual TQPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void applyOptions(); - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(TQResizeEvent *e); virtual void getBaseLogFileName(KviStr &buffer); KviFileTransferItem * findItem(KviFileTransfer * t); void fillTransferView(); KviFileTransfer * selectedTransfer(); - virtual void fontChange(const QFont &oldFont); - bool eventFilter( QObject *obj, QEvent *ev ); + virtual void fontChange(const TQFont &oldFont); + bool eventFilter( TQObject *obj, TQEvent *ev ); public: - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; int lineSpacing(){ return m_iLineSpacing; }; protected slots: void transferRegistered(KviFileTransfer *t); void transferUnregistering(KviFileTransfer *t); - void rightButtonPressed(KviTalListViewItem *it,const QPoint &pnt,int col); - void doubleClicked(KviTalListViewItem *it,const QPoint &pnt,int col); + void rightButtonPressed(KviTalListViewItem *it,const TQPoint &pnt,int col); + void doubleClicked(KviTalListViewItem *it,const TQPoint &pnt,int col); void heartbeat(); void clearTerminated(); void clearAll(); - void tipRequest(KviDynamicToolTip * tip,const QPoint &pnt); + void tipRequest(KviDynamicToolTip * tip,const TQPoint &pnt); void openLocalFile(); void openLocalFileWith(); diff --git a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp index 6427e5eb..1fe2217e 100644 --- a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp +++ b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp @@ -32,7 +32,7 @@ #include "kvi_locale.h" #include "kvi_iconmanager.h" -#include <qsplitter.h> +#include <tqsplitter.h> KviFileTransferWindow * g_pFileTransferWindow = 0; @@ -45,11 +45,11 @@ static KviModuleExtension * filetransferwindow_extension_alloc(KviModuleExtensio { if(s->pParams) { - if(QVariant * v = s->pParams->find("bCreateMinimized")) + if(TQVariant * v = s->pParams->tqfind("bCreateMinimized")) { if(v->isValid()) { - if(v->type() == QVariant::Bool) + if(v->type() == TQVariant::Bool) { bCreateMinimized = v->toBool(); } @@ -65,11 +65,11 @@ static KviModuleExtension * filetransferwindow_extension_alloc(KviModuleExtensio if(s->pParams) { - if(QVariant * v = s->pParams->find("bNoRaise")) + if(TQVariant * v = s->pParams->tqfind("bNoRaise")) { if(v) { - if(v->isValid() && v->type() == QVariant::Bool) + if(v->isValid() && v->type() == TQVariant::Bool) bNoRaise = v->toBool(); } } @@ -105,11 +105,11 @@ static bool filetransferwindow_kvs_cmd_open(KviKvsModuleCommandCall * c) if(d) { - KviPointerHashTable<QString,QVariant> dict(17,true); + KviPointerHashTable<TQString,TQVariant> dict(17,true); dict.setAutoDelete(true); - QString dummy; - dict.replace("bCreateMinimized",new QVariant(c->hasSwitch('m',dummy))); - dict.replace("bNoRaise",new QVariant(c->hasSwitch('n',dummy))); + TQString dummy; + dict.tqreplace("bCreateMinimized",new TQVariant(c->hasSwitch('m',dummy))); + dict.tqreplace("bNoRaise",new TQVariant(c->hasSwitch('n',dummy))); d->allocate(c->window(),&dict,0); } else { |