diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
commit | d7633c195a464e4d344ada9eea61afd10110598a (patch) | |
tree | 1f2da0b135f3ed84955e340cae823f00c4ce7284 /src/svnfrontend/graphtree/revgraphview.cpp | |
parent | 3fa7eb804f67b2789f128075cc2522f398640250 (diff) | |
download | tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.tar.gz tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.zip |
Port kdesvn to TQt4
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1230412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/svnfrontend/graphtree/revgraphview.cpp')
-rw-r--r-- | src/svnfrontend/graphtree/revgraphview.cpp | 326 |
1 files changed, 163 insertions, 163 deletions
diff --git a/src/svnfrontend/graphtree/revgraphview.cpp b/src/svnfrontend/graphtree/revgraphview.cpp index cc85c0e..afb9d3a 100644 --- a/src/svnfrontend/graphtree/revgraphview.cpp +++ b/src/svnfrontend/graphtree/revgraphview.cpp @@ -34,11 +34,11 @@ #include <kfiledialog.h> #include <kmessagebox.h> -#include <qtooltip.h> -#include <qwmatrix.h> -#include <qpopupmenu.h> -#include <qpainter.h> -#include <qregexp.h> +#include <tqtooltip.h> +#include <tqwmatrix.h> +#include <tqpopupmenu.h> +#include <tqpainter.h> +#include <tqregexp.h> #include <math.h> @@ -46,38 +46,38 @@ #define LABEL_HEIGHT 90 -class GraphViewTip:public QToolTip +class GraphViewTip:public TQToolTip { public: - GraphViewTip( QWidget* p ):QToolTip(p) {} + GraphViewTip( TQWidget* p ):TQToolTip(p) {} virtual ~GraphViewTip(){} protected: - void maybeTip( const QPoint & ); + void maybeTip( const TQPoint & ); }; -void GraphViewTip::maybeTip( const QPoint & pos) +void GraphViewTip::maybeTip( const TQPoint & pos) { - if (!parentWidget()->inherits( "RevGraphView" )) return; - RevGraphView* cgv = (RevGraphView*)parentWidget(); - QPoint cPos = cgv->viewportToContents(pos); - QCanvasItemList l = cgv->canvas()->collisions(cPos); + if (!tqparentWidget()->inherits( "RevGraphView" )) return; + RevGraphView* cgv = (RevGraphView*)tqparentWidget(); + TQPoint cPos = cgv->viewportToContents(pos); + TQCanvasItemList l = cgv->canvas()->collisions(cPos); if (l.count() == 0) return; - QCanvasItem* i = l.first(); + TQCanvasItem* i = l.first(); if (i->rtti() == GRAPHTREE_LABEL) { GraphTreeLabel*tl = (GraphTreeLabel*)i; - QString nm = tl->nodename(); - QString tipStr = cgv->toolTip(nm); + TQString nm = tl->nodename(); + TQString tipStr = cgv->toolTip(nm); if (tipStr.length()>0) { - QPoint vPosTL = cgv->contentsToViewport(i->boundingRect().topLeft()); - QPoint vPosBR = cgv->contentsToViewport(i->boundingRect().bottomRight()); - tip(QRect(vPosTL, vPosBR), tipStr); + TQPoint vPosTL = cgv->contentsToViewport(i->boundingRect().topLeft()); + TQPoint vPosBR = cgv->contentsToViewport(i->boundingRect().bottomRight()); + tip(TQRect(vPosTL, vPosBR), tipStr); } } } -RevGraphView::RevGraphView(QObject*aListener,svn::Client*_client,QWidget * parent, const char * name, WFlags f) - : QCanvasView(parent,name,f) +RevGraphView::RevGraphView(TQObject*aListener,svn::Client*_client,TQWidget * tqparent, const char * name, WFlags f) + : TQCanvasView(tqparent,name,f) { m_Canvas = 0L; m_Client = _client; @@ -88,16 +88,16 @@ RevGraphView::RevGraphView(QObject*aListener,svn::Client*_client,QWidget * paren m_Marker = 0; m_Tip = new GraphViewTip(this); m_CompleteView = new PannerView(this); - m_CompleteView->setVScrollBarMode(QScrollView::AlwaysOff); - m_CompleteView->setHScrollBarMode(QScrollView::AlwaysOff); + m_CompleteView->setVScrollBarMode(TQScrollView::AlwaysOff); + m_CompleteView->setHScrollBarMode(TQScrollView::AlwaysOff); m_CompleteView->raise(); m_CompleteView->hide(); - connect(this, SIGNAL(contentsMoving(int,int)), - this, SLOT(contentsMovingSlot(int,int))); - connect(m_CompleteView, SIGNAL(zoomRectMoved(int,int)), - this, SLOT(zoomRectMoved(int,int))); - connect(m_CompleteView, SIGNAL(zoomRectMoveFinished()), - this, SLOT(zoomRectMoveFinished())); + connect(this, TQT_SIGNAL(contentsMoving(int,int)), + this, TQT_SLOT(contentsMovingSlot(int,int))); + connect(m_CompleteView, TQT_SIGNAL(zoomRectMoved(int,int)), + this, TQT_SLOT(zoomRectMoved(int,int))); + connect(m_CompleteView, TQT_SIGNAL(zoomRectMoveFinished()), + this, TQT_SLOT(zoomRectMoveFinished())); m_LastAutoPosition = TopLeft; _isMoving = false; _noUpdateZoomerPos = false; @@ -114,13 +114,13 @@ RevGraphView::~RevGraphView() delete renderProcess; } -void RevGraphView::showText(const QString&s) +void RevGraphView::showText(const TQString&s) { clear(); - m_Canvas = new QCanvas(QApplication::desktop()->width(), - QApplication::desktop()->height()); + m_Canvas = new TQCanvas(TQApplication::desktop()->width(), + TQApplication::desktop()->height()); - QCanvasText* t = new QCanvasText(s, m_Canvas); + TQCanvasText* t = new TQCanvasText(s, m_Canvas); t->move(5, 5); t->show(); center(0,0); @@ -164,20 +164,20 @@ void RevGraphView::endInsert() void RevGraphView::readDotOutput(KProcess*,char * buffer,int buflen) { - dotOutput+=QString::fromLocal8Bit(buffer, buflen); + dotOutput+=TQString::fromLocal8Bit(buffer, buflen); } void RevGraphView::dotExit(KProcess*p) { if (p!=renderProcess)return; // remove line breaks when lines to long - QRegExp endslash("\\\\\\n"); - dotOutput.replace(endslash,""); + TQRegExp endslash("\\\\\\n"); + dotOutput.tqreplace(endslash,""); double scale = 1.0, scaleX = 1.0, scaleY = 1.0; double dotWidth, dotHeight; - QTextStream* dotStream; - dotStream = new QTextStream(dotOutput, IO_ReadOnly); - QString line,cmd; + TQTextStream* dotStream; + dotStream = new TQTextStream(dotOutput, IO_ReadOnly); + TQString line,cmd; int lineno=0; clear(); beginInsert(); @@ -187,7 +187,7 @@ void RevGraphView::dotExit(KProcess*p) if (line.isNull()) break; lineno++; if (line.isEmpty()) continue; - QTextStream lineStream(line, IO_ReadOnly); + TQTextStream lineStream(line, IO_ReadOnly); lineStream >> cmd; if (cmd == "stop") {break; } @@ -198,12 +198,12 @@ void RevGraphView::dotExit(KProcess*p) int h = (int)(scaleY * dotHeight); _xMargin = 50; - if (w < QApplication::desktop()->width()) - _xMargin += (QApplication::desktop()->width()-w)/2; + if (w < TQApplication::desktop()->width()) + _xMargin += (TQApplication::desktop()->width()-w)/2; _yMargin = 50; - if (h < QApplication::desktop()->height()) - _yMargin += (QApplication::desktop()->height()-h)/2; - m_Canvas = new QCanvas(int(w+2*_xMargin), int(h+2*_yMargin)); + if (h < TQApplication::desktop()->height()) + _yMargin += (TQApplication::desktop()->height()-h)/2; + m_Canvas = new TQCanvas(int(w+2*_xMargin), int(h+2*_yMargin)); continue; } if ((cmd != "node") && (cmd != "edge")) { @@ -212,8 +212,8 @@ void RevGraphView::dotExit(KProcess*p) continue; } if (cmd=="node") { - QString nodeName, label; - QString _x,_y,_w,_h; + TQString nodeName, label; + TQString _x,_y,_w,_h; double x, y, width, height; lineStream >> nodeName >> _x >> _y >> _w >> _h; x=_x.toDouble(); @@ -227,7 +227,7 @@ void RevGraphView::dotExit(KProcess*p) int yy = (int)(scaleY * (dotHeight - y) + _yMargin); int w = (int)(scaleX * width); int h = (int)(scaleY * height); - QRect r(xx-w/2, yy-h/2, w, h); + TQRect r(xx-w/2, yy-h/2, w, h); GraphTreeLabel*t=new GraphTreeLabel(label,nodeName,r,m_Canvas); if (isStart(nodeName)) { ensureVisible(r.x(),r.y()); @@ -237,10 +237,10 @@ void RevGraphView::dotExit(KProcess*p) t->show(); m_NodeList[nodeName]=t; } else { - QString node1Name, node2Name, label; - QString _x,_y; + TQString node1Name, node2Name, label; + TQString _x,_y; double x, y; - QPointArray pa; + TQPointArray pa; int points, i; lineStream >> node1Name >> node2Name; lineStream >> points; @@ -264,26 +264,26 @@ void RevGraphView::dotExit(KProcess*p) } GraphEdge * n = new GraphEdge(m_Canvas); - QColor arrowColor = Qt::black; - n->setPen(QPen(arrowColor,1)); + TQColor arrowColor = TQt::black; + n->setPen(TQPen(arrowColor,1)); n->setControlPoints(pa,false); n->setZ(0.5); n->show(); /* arrow */ - QPoint arrowDir; + TQPoint arrowDir; int indexHead = -1; - QMap<QString,GraphTreeLabel*>::Iterator it; - it = m_NodeList.find(node2Name); + TQMap<TQString,GraphTreeLabel*>::Iterator it; + it = m_NodeList.tqfind(node2Name); if (it!=m_NodeList.end()) { it.data()->setSource(node1Name); } - it = m_NodeList.find(node1Name); + it = m_NodeList.tqfind(node1Name); if (it!=m_NodeList.end()) { GraphTreeLabel*tlab = it.data(); if (tlab) { - QPoint toCenter = tlab->rect().center(); + TQPoint toCenter = tlab->rect().center(); int dx0 = pa.point(0).x() - toCenter.x(); int dy0 = pa.point(0).y() - toCenter.y(); int dx1 = pa.point(points-1).x() - toCenter.x(); @@ -310,11 +310,11 @@ void RevGraphView::dotExit(KProcess*p) if (!arrowDir.isNull()) { arrowDir *= 10.0/sqrt(double(arrowDir.x()*arrowDir.x() + arrowDir.y()*arrowDir.y())); - QPointArray a(3); + TQPointArray a(3); a.setPoint(0, pa.point(indexHead) + arrowDir); - a.setPoint(1, pa.point(indexHead) + QPoint(arrowDir.y()/2, + a.setPoint(1, pa.point(indexHead) + TQPoint(arrowDir.y()/2, -arrowDir.x()/2)); - a.setPoint(2, pa.point(indexHead) + QPoint(-arrowDir.y()/2, + a.setPoint(2, pa.point(indexHead) + TQPoint(-arrowDir.y()/2, arrowDir.x()/2)); GraphEdgeArrow* aItem = new GraphEdgeArrow(n,m_Canvas); aItem->setPoints(a); @@ -326,7 +326,7 @@ void RevGraphView::dotExit(KProcess*p) } } if (!m_Canvas) { - QString s = i18n("Error running the graph layouting tool.\n"); + TQString s = i18n("Error running the graph tqlayouting tool.\n"); s += i18n("Please check that 'dot' is installed (package GraphViz)."); showText(s); } else { @@ -338,11 +338,11 @@ void RevGraphView::dotExit(KProcess*p) renderProcess=0; } -bool RevGraphView::isStart(const QString&nodeName)const +bool RevGraphView::isStart(const TQString&nodeName)const { bool res = false; trevTree::ConstIterator it; - it = m_Tree.find(nodeName); + it = m_Tree.tqfind(nodeName); if (it==m_Tree.end()) { return res; } @@ -354,21 +354,21 @@ bool RevGraphView::isStart(const QString&nodeName)const return res; } -char RevGraphView::getAction(const QString&nodeName)const +char RevGraphView::getAction(const TQString&nodeName)const { trevTree::ConstIterator it; - it = m_Tree.find(nodeName); + it = m_Tree.tqfind(nodeName); if (it==m_Tree.end()) { return (char)0; } return it.data().Action; } -QColor RevGraphView::getBgColor(const QString&nodeName)const +TQColor RevGraphView::getBgColor(const TQString&nodeName)const { trevTree::ConstIterator it; - it = m_Tree.find(nodeName); - QColor res = Qt::white; + it = m_Tree.tqfind(nodeName); + TQColor res = TQt::white; if (it==m_Tree.end()) { return res; } @@ -397,43 +397,43 @@ QColor RevGraphView::getBgColor(const QString&nodeName)const return res; } -const QString&RevGraphView::getLabelstring(const QString&nodeName) +const TQString&RevGraphView::getLabelstring(const TQString&nodeName) { - QMap<QString,QString>::ConstIterator nIt; - nIt = m_LabelMap.find(nodeName); + TQMap<TQString,TQString>::ConstIterator nIt; + nIt = m_LabelMap.tqfind(nodeName); if (nIt!=m_LabelMap.end()) { return nIt.data(); } trevTree::ConstIterator it1; - it1 = m_Tree.find(nodeName); + it1 = m_Tree.tqfind(nodeName); if (it1==m_Tree.end()) { return m_LabelMap[""]; } - QString res; + TQString res; switch (it1.data().Action) { case 'D': - res = i18n("Deleted at revision %1").arg(it1.data().rev); + res = i18n("Deleted at revision %1").tqarg(it1.data().rev); break; case 'A': res = i18n("Added at revision %1 as %2") - .arg(it1.data().rev) - .arg(it1.data().name); + .tqarg(it1.data().rev) + .tqarg(it1.data().name); break; case 'C': case 1: - res = i18n("Copied to %1 at revision %2").arg(it1.data().name).arg(it1.data().rev); + res = i18n("Copied to %1 at revision %2").tqarg(it1.data().name).tqarg(it1.data().rev); break; case 2: - res = i18n("Renamed to %1 at revision %2").arg(it1.data().name).arg(it1.data().rev); + res = i18n("Renamed to %1 at revision %2").tqarg(it1.data().name).tqarg(it1.data().rev); break; case 'M': - res = i18n("Modified at revision %1").arg(it1.data().rev); + res = i18n("Modified at revision %1").tqarg(it1.data().rev); break; case 'R': - res = i18n("Replaced at revision %1").arg(it1.data().rev); + res = i18n("Replaced at revision %1").tqarg(it1.data().rev); break; default: - res=i18n("Revision %1").arg(it1.data().rev); + res=i18n("Revision %1").tqarg(it1.data().rev); break; } m_LabelMap[nodeName]=res; @@ -445,19 +445,19 @@ void RevGraphView::dumpRevtree() delete dotTmpFile; clear(); dotOutput = ""; - dotTmpFile = new KTempFile(QString::null,".dot"); + dotTmpFile = new KTempFile(TQString(),".dot"); dotTmpFile->setAutoDelete(true); - QTextStream* stream = dotTmpFile->textStream(); + TQTextStream* stream = dotTmpFile->textStream(); if (!stream) { - showText(i18n("Could not open tempfile %1 for writing.").arg(dotTmpFile->name())); + showText(i18n("Could not open tempfile %1 for writing.").tqarg(dotTmpFile->name())); return; } *stream << "digraph \"callgraph\" {\n"; *stream << " bgcolor=\"transparent\";\n"; int dir = Kdesvnsettings::tree_direction(); - *stream << QString(" rankdir=\""); + *stream << TQString(" rankdir=\""); switch (dir) { case 3: *stream << "TB"; @@ -475,13 +475,13 @@ void RevGraphView::dumpRevtree() } *stream << "\";\n"; - //*stream << QString(" overlap=false;\n splines=true;\n"); + //*stream << TQString(" overlap=false;\n splines=true;\n"); RevGraphView::trevTree::ConstIterator it1; for (it1=m_Tree.begin();it1!=m_Tree.end();++it1) { *stream << " " << it1.key() << "[ " - << "shape=box, " + << "tqshape=box, " << "label=\""<<getLabelstring(it1.key())<<"\"," << "];\n"; for (unsigned j=0;j<it1.data().targets.count();++j) { @@ -495,31 +495,31 @@ void RevGraphView::dumpRevtree() renderProcess->setEnvironment("LANG","C"); *renderProcess << "dot"; *renderProcess << dotTmpFile->name() << "-Tplain"; - connect(renderProcess,SIGNAL(processExited(KProcess*)),this,SLOT(dotExit(KProcess*))); - connect(renderProcess,SIGNAL(receivedStdout(KProcess*,char*,int)), - this,SLOT(readDotOutput(KProcess*,char*,int)) ); + connect(renderProcess,TQT_SIGNAL(processExited(KProcess*)),this,TQT_SLOT(dotExit(KProcess*))); + connect(renderProcess,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this,TQT_SLOT(readDotOutput(KProcess*,char*,int)) ); if (!renderProcess->start(KProcess::NotifyOnExit,KProcess::Stdout)) { - QString arguments; + TQString arguments; for (unsigned c=0;c<renderProcess->args().count();++c) { - arguments+=QString(" %1").arg(renderProcess->args()[c]); + arguments+=TQString(" %1").tqarg(renderProcess->args()[c].data()); } - QString error = i18n("Could not start process \"%1\".").arg(arguments); + TQString error = i18n("Could not start process \"%1\".").tqarg(arguments); showText(error); renderProcess=0; //delete renderProcess;< } } -QString RevGraphView::toolTip(const QString&_nodename,bool full)const +TQString RevGraphView::toolTip(const TQString&_nodename,bool full)const { - QString res = QString::null; + TQString res = TQString(); trevTree::ConstIterator it; - it = m_Tree.find(_nodename); + it = m_Tree.tqfind(_nodename); if (it==m_Tree.end()) { return res; } - QStringList sp = QStringList::split("\n",it.data().Message); - QString sm; + TQStringList sp = TQStringList::split("\n",it.data().Message); + TQString sm; if (sp.count()==0) { sm = it.data().Message; } else { @@ -536,34 +536,34 @@ QString RevGraphView::toolTip(const QString&_nodename,bool full)const sm.truncate(47); sm+="..."; } - static QString csep = "</td><td>"; - static QString rend = "</td></tr>"; - static QString rstart = "<tr><td>"; - res = QString("<html><body>"); + static TQString csep = "</td><td>"; + static TQString rend = "</td></tr>"; + static TQString rstart = "<tr><td>"; + res = TQString("<html><body>"); if (!full) { - res+=QString("<b>%1</b>").arg(it.data().name); + res+=TQString("<b>%1</b>").tqarg(it.data().name); res += i18n("<br>Revision: %1<br>Author: %2<br>Date: %3<br>Log: %4</html>") - .arg(it.data().rev) - .arg(it.data().Author) - .arg(it.data().Date) - .arg(sm); + .tqarg(it.data().rev) + .tqarg(it.data().Author) + .tqarg(it.data().Date) + .tqarg(sm); } else { res+="<table><tr><th colspan=\"2\"><b>"+it.data().name+"</b></th></tr>"; res+=rstart; - res+=i18n("<b>Revision</b>%1%2%3").arg(csep).arg(it.data().rev).arg(rend); - res+=rstart+i18n("<b>Author</b>%1%2%3").arg(csep).arg(it.data().Author).arg(rend); - res+=rstart+i18n("<b>Date</b>%1%2%3").arg(csep).arg(it.data().Date).arg(rend); - res+=rstart+i18n("<b>Log</b>%1%2%3").arg(csep).arg(sm).arg(rend); + res+=i18n("<b>Revision</b>%1%2%3").tqarg(csep).tqarg(it.data().rev).tqarg(rend); + res+=rstart+i18n("<b>Author</b>%1%2%3").tqarg(csep).tqarg(it.data().Author).tqarg(rend); + res+=rstart+i18n("<b>Date</b>%1%2%3").tqarg(csep).tqarg(it.data().Date).tqarg(rend); + res+=rstart+i18n("<b>Log</b>%1%2%3").tqarg(csep).tqarg(sm).tqarg(rend); res+="</table></body></html>"; } return res; } -void RevGraphView::updateSizes(QSize s) +void RevGraphView::updateSizes(TQSize s) { if (!m_Canvas) return; - if (s == QSize(0,0)) s = size(); + if (s == TQSize(0,0)) s = size(); // the part of the canvas that should be visible int cWidth = m_Canvas->width() - 2*_xMargin + 100; @@ -597,7 +597,7 @@ void RevGraphView::updateSizes(QSize s) m_Canvas->width(), m_Canvas->height(), cWidth, cHeight, zoom); - QWMatrix wm; + TQWMatrix wm; wm.scale( zoom, zoom ); m_CompleteView->setWorldMatrix(wm); @@ -621,8 +621,8 @@ void RevGraphView::updateZoomerPos() int x = width()- cvW - verticalScrollBar()->width() -2; int y = height()-cvH - horizontalScrollBar()->height() -2; - QPoint oldZoomPos = m_CompleteView->pos(); - QPoint newZoomPos = QPoint(0,0); + TQPoint oldZoomPos = m_CompleteView->pos(); + TQPoint newZoomPos = TQPoint(0,0); #if 0 ZoomPosition zp = _zoomPosition; @@ -630,18 +630,18 @@ void RevGraphView::updateZoomerPos() #else ZoomPosition zp = m_LastAutoPosition; #endif - QPoint tl1Pos = viewportToContents(QPoint(0,0)); - QPoint tl2Pos = viewportToContents(QPoint(cvW,cvH)); - QPoint tr1Pos = viewportToContents(QPoint(x,0)); - QPoint tr2Pos = viewportToContents(QPoint(x+cvW,cvH)); - QPoint bl1Pos = viewportToContents(QPoint(0,y)); - QPoint bl2Pos = viewportToContents(QPoint(cvW,y+cvH)); - QPoint br1Pos = viewportToContents(QPoint(x,y)); - QPoint br2Pos = viewportToContents(QPoint(x+cvW,y+cvH)); - int tlCols = m_Canvas->collisions(QRect(tl1Pos,tl2Pos)).count(); - int trCols = m_Canvas->collisions(QRect(tr1Pos,tr2Pos)).count(); - int blCols = m_Canvas->collisions(QRect(bl1Pos,bl2Pos)).count(); - int brCols = m_Canvas->collisions(QRect(br1Pos,br2Pos)).count(); + TQPoint tl1Pos = viewportToContents(TQPoint(0,0)); + TQPoint tl2Pos = viewportToContents(TQPoint(cvW,cvH)); + TQPoint tr1Pos = viewportToContents(TQPoint(x,0)); + TQPoint tr2Pos = viewportToContents(TQPoint(x+cvW,cvH)); + TQPoint bl1Pos = viewportToContents(TQPoint(0,y)); + TQPoint bl2Pos = viewportToContents(TQPoint(cvW,y+cvH)); + TQPoint br1Pos = viewportToContents(TQPoint(x,y)); + TQPoint br2Pos = viewportToContents(TQPoint(x+cvW,y+cvH)); + int tlCols = m_Canvas->collisions(TQRect(tl1Pos,tl2Pos)).count(); + int trCols = m_Canvas->collisions(TQRect(tr1Pos,tr2Pos)).count(); + int blCols = m_Canvas->collisions(TQRect(bl1Pos,bl2Pos)).count(); + int brCols = m_Canvas->collisions(TQRect(br1Pos,br2Pos)).count(); int minCols = tlCols; zp = m_LastAutoPosition; switch(zp) { @@ -662,13 +662,13 @@ void RevGraphView::updateZoomerPos() #endif switch(zp) { case TopRight: - newZoomPos = QPoint(x,0); + newZoomPos = TQPoint(x,0); break; case BottomLeft: - newZoomPos = QPoint(0,y); + newZoomPos = TQPoint(0,y); break; case BottomRight: - newZoomPos = QPoint(x,y); + newZoomPos = TQPoint(x,y); break; default: break; @@ -678,7 +678,7 @@ void RevGraphView::updateZoomerPos() void RevGraphView::contentsMovingSlot(int x,int y) { - QRect z(int(x * _cvZoom), int(y * _cvZoom), + TQRect z(int(x * _cvZoom), int(y * _cvZoom), int(visibleWidth() * _cvZoom)-1, int(visibleHeight() * _cvZoom)-1); if (0) qDebug("moving: (%d,%d) => (%d/%d - %dx%d)", x, y, z.x(), z.y(), z.width(), z.height()); @@ -705,9 +705,9 @@ void RevGraphView::zoomRectMoveFinished() updateZoomerPos(); } -void RevGraphView::resizeEvent(QResizeEvent*e) +void RevGraphView::resizeEvent(TQResizeEvent*e) { - QCanvasView::resizeEvent(e); + TQCanvasView::resizeEvent(e); if (m_Canvas) updateSizes(e->size()); } @@ -732,13 +732,13 @@ void RevGraphView::makeSelected(GraphTreeLabel*gtl) m_CompleteView->updateCurrentRect(); } -void RevGraphView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) +void RevGraphView::contentsMouseDoubleClickEvent ( TQMouseEvent * e ) { setFocus(); if (e->button() == Qt::LeftButton) { - QCanvasItemList l = canvas()->collisions(e->pos()); + TQCanvasItemList l = canvas()->collisions(e->pos()); if (l.count()>0) { - QCanvasItem* i = l.first(); + TQCanvasItem* i = l.first(); if (i->rtti()==GRAPHTREE_LABEL) { makeSelected( (GraphTreeLabel*)i); emit dispDetails(toolTip(((GraphTreeLabel*)i)->nodename(),true)); @@ -747,20 +747,20 @@ void RevGraphView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) } } -void RevGraphView::contentsMousePressEvent ( QMouseEvent * e ) +void RevGraphView::contentsMousePressEvent ( TQMouseEvent * e ) { setFocus(); _isMoving = true; _lastPos = e->globalPos(); } -void RevGraphView::contentsMouseReleaseEvent ( QMouseEvent * ) +void RevGraphView::contentsMouseReleaseEvent ( TQMouseEvent * ) { _isMoving = false; updateZoomerPos(); } -void RevGraphView::contentsMouseMoveEvent ( QMouseEvent * e ) +void RevGraphView::contentsMouseMoveEvent ( TQMouseEvent * e ) { if (_isMoving) { int dx = e->globalPos().x() - _lastPos.x(); @@ -780,13 +780,13 @@ void RevGraphView::setNewDirection(int dir) dumpRevtree(); } -void RevGraphView::contentsContextMenuEvent(QContextMenuEvent* e) +void RevGraphView::contentsContextMenuEvent(TQContextMenuEvent* e) { if (!m_Canvas) return; - QCanvasItemList l = canvas()->collisions(e->pos()); - QCanvasItem* i = (l.count() == 0) ? 0 : l.first(); + TQCanvasItemList l = canvas()->collisions(e->pos()); + TQCanvasItem* i = (l.count() == 0) ? 0 : l.first(); - QPopupMenu popup; + TQPopupMenu popup; if (i && i->rtti()==GRAPHTREE_LABEL) { if (!((GraphTreeLabel*)i)->source().isEmpty() && getAction(((GraphTreeLabel*)i)->nodename())!='D') { popup.insertItem(i18n("Diff to previous"),301); @@ -832,7 +832,7 @@ void RevGraphView::contentsContextMenuEvent(QContextMenuEvent* e) break; case 201: { - QString fn = KFileDialog::getSaveFileName(":","*.png"); + TQString fn = KFileDialog::getSaveFileName(":","*.png"); if (!fn.isEmpty()) { if (m_Marker) { m_Marker->hide(); @@ -840,8 +840,8 @@ void RevGraphView::contentsContextMenuEvent(QContextMenuEvent* e) if (m_Selected) { m_Selected->setSelected(false); } - QPixmap pix(m_Canvas->size()); - QPainter p(&pix); + TQPixmap pix(m_Canvas->size()); + TQPainter p(&pix); m_Canvas->drawArea( m_Canvas->rect(), &p ); pix.save(fn,"PNG"); if (m_Marker) { @@ -894,57 +894,57 @@ void RevGraphView::makeCat(GraphTreeLabel*_l) if (!_l) { return; } - QString n1 = _l->nodename(); - trevTree::ConstIterator it = m_Tree.find(n1); + TQString n1 = _l->nodename(); + trevTree::ConstIterator it = m_Tree.tqfind(n1); if (it==m_Tree.end()) { return; } svn::Revision tr(it.data().rev); - QString tp = _basePath+it.data().name; - emit makeCat(tr,tp,it.data().name,tr,kapp->activeModalWidget()); + TQString tp = _basePath+it.data().name; + emit makeCat(tr,tp,it.data().name,tr,TQT_TQWIDGET(kapp->activeModalWidget())); } void RevGraphView::makeDiffPrev(GraphTreeLabel*_l) { if (!_l) return; - QString n1,n2; + TQString n1,n2; n1 = _l->nodename(); n2 = _l->source(); makeDiff(n1,n2); } -void RevGraphView::makeDiff(const QString&n1,const QString&n2) +void RevGraphView::makeDiff(const TQString&n1,const TQString&n2) { if (n1.isEmpty()||n2.isEmpty()) return; trevTree::ConstIterator it; - it = m_Tree.find(n2); + it = m_Tree.tqfind(n2); if (it==m_Tree.end()) { return; } svn::Revision sr(it.data().rev); - QString sp = _basePath+it.data().name; + TQString sp = _basePath+it.data().name; - it = m_Tree.find(n1); + it = m_Tree.tqfind(n1); if (it==m_Tree.end()) { return; } svn::Revision tr(it.data().rev); - QString tp = _basePath+it.data().name; + TQString tp = _basePath+it.data().name; if (Kdesvnsettings::tree_diff_rec()) { - emit makeRecDiff(sp,sr,tp,tr,kapp->activeModalWidget()); + emit makeRecDiff(sp,sr,tp,tr,TQT_TQWIDGET(kapp->activeModalWidget())); } else { - emit makeNorecDiff(sp,sr,tp,tr,kapp->activeModalWidget()); + emit makeNorecDiff(sp,sr,tp,tr,TQT_TQWIDGET(kapp->activeModalWidget())); } } -void RevGraphView::setBasePath(const QString&_path) +void RevGraphView::setBasePath(const TQString&_path) { _basePath = _path; } -void RevGraphView::slotClientException(const QString&what) +void RevGraphView::slotClientException(const TQString&what) { - KMessageBox::sorry(KApplication::activeModalWidget(),what,i18n("SVN Error")); + KMessageBox::sorry(TQT_TQWIDGET(KApplication::activeModalWidget()),what,i18n("SVN Error")); } #include "revgraphview.moc" |