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/filelistviewitem.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/filelistviewitem.cpp')
-rw-r--r-- | src/svnfrontend/filelistviewitem.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/svnfrontend/filelistviewitem.cpp b/src/svnfrontend/filelistviewitem.cpp index 19af4fe..bb5d4d5 100644 --- a/src/svnfrontend/filelistviewitem.cpp +++ b/src/svnfrontend/filelistviewitem.cpp @@ -33,8 +33,8 @@ #include <kdebug.h> #include <kconfig.h> -#include <qfileinfo.h> -#include <qpainter.h> +#include <tqfileinfo.h> +#include <tqpainter.h> const int FileListViewItem::COL_ICON = 0; const int FileListViewItem::COL_NAME = 0; @@ -46,21 +46,21 @@ const int FileListViewItem::COL_IS_LOCKED = 5; //const int FileListViewItem::COL_CURRENT_REV = 5; -FileListViewItem::FileListViewItem(kdesvnfilelist*_parent,const svn::StatusPtr&_stat) - : KListViewItem(_parent),SvnItem(_stat), +FileListViewItem::FileListViewItem(kdesvnfilelist*_tqparent,const svn::StatusPtr&_stat) + : KListViewItem(_tqparent),SvnItem(_stat), sortChar(0), - m_Ksvnfilelist(_parent) + m_Ksvnfilelist(_tqparent) { - m_SvnWrapper = _parent->m_SvnWrapper; + m_SvnWrapper = _tqparent->m_SvnWrapper; init(); } -FileListViewItem::FileListViewItem(kdesvnfilelist*_parent,FileListViewItem*_parentItem,const svn::StatusPtr&_stat) - : KListViewItem(_parentItem),SvnItem(_stat), +FileListViewItem::FileListViewItem(kdesvnfilelist*_tqparent,FileListViewItem*_tqparentItem,const svn::StatusPtr&_stat) + : KListViewItem(_tqparentItem),SvnItem(_stat), sortChar(0), - m_Ksvnfilelist(_parent) + m_Ksvnfilelist(_tqparent) { - m_SvnWrapper = _parent->m_SvnWrapper; + m_SvnWrapper = _tqparent->m_SvnWrapper; init(); } @@ -105,7 +105,7 @@ FileListViewItem::~FileListViewItem() if (isSelected()) { /* when item is selected and deleted signal selectionChanged isn't emitted - in QListView anymore and let kdesvn crash. + in TQListView anymore and let kdesvn crash. */ setSelected(false); m_Ksvnfilelist->selectionChanged(); @@ -118,7 +118,7 @@ void FileListViewItem::setStat(const svn::StatusPtr&stat) init(); } -void FileListViewItem::refreshStatus(bool childs,QPtrList<SvnItem>*exclude,bool depsonly) +void FileListViewItem::refreshtqStatus(bool childs,TQPtrList<SvnItem>*exclude,bool depsonly) { FileListViewItem*it; @@ -130,28 +130,28 @@ void FileListViewItem::refreshStatus(bool childs,QPtrList<SvnItem>*exclude,bool if (!isValid()) { return; } - it = static_cast<FileListViewItem*>(parent()); + it = static_cast<FileListViewItem*>(tqparent()); if (!childs) { - if (it && (!exclude || exclude->find(it)==-1)) { - it->refreshStatus(false,exclude); + if (it && (!exclude || exclude->tqfind(it)==-1)) { + it->refreshtqStatus(false,exclude); } } else if (firstChild()){ it = static_cast<FileListViewItem*>(firstChild()); while (it) { - if (!exclude || exclude->find(it)==-1) { - it->refreshStatus(true,exclude); + if (!exclude || exclude->tqfind(it)==-1) { + it->refreshtqStatus(true,exclude); } it = static_cast<FileListViewItem*>(it->nextSibling()); } } - repaint(); + tqrepaint(); } void FileListViewItem::makePixmap() { int size = Kdesvnsettings::listview_icon_size(); bool overlay = Kdesvnsettings::display_overlays(); - QPixmap pm; + TQPixmap pm; if (m_Pixmap.isNull()) { pm = getPixmap(size,overlay); } else { @@ -160,21 +160,21 @@ void FileListViewItem::makePixmap() setPixmap(COL_ICON,pm); } -void FileListViewItem::setPreviewPix(const QPixmap& pixmap) +void FileListViewItem::setPreviewPix(const TQPixmap& pixmap) { if (pixmap.isNull()) return; m_Pixmap = pixmap; int size = Kdesvnsettings::listview_icon_size(); bool overlay = Kdesvnsettings::display_overlays(); - QPixmap pm = getPixmap(pixmap,size,overlay); + TQPixmap pm = getPixmap(pixmap,size,overlay); setPixmap(COL_ICON,pm); } -bool FileListViewItem::isParent(QListViewItem*which) +bool FileListViewItem::isParent(TQListViewItem*which) { if (!which) return false; - QListViewItem*item = this; - while ( (item=item->parent())) { + TQListViewItem*item = this; + while ( (item=item->tqparent())) { if (item==which) { return true; } @@ -192,11 +192,11 @@ void FileListViewItem::update() setText(COL_STATUS,infoText()); setText(COL_LAST_AUTHOR,cmtAuthor()); setText(COL_LAST_DATE,KGlobal::locale()->formatDateTime(fullDate())); - setText(COL_LAST_REV,QString("%1").arg(cmtRev())); + setText(COL_LAST_REV,TQString("%1").tqarg(cmtRev())); setText(COL_IS_LOCKED,lockOwner()); } -int FileListViewItem::compare( QListViewItem* item, int col, bool ascending ) const +int FileListViewItem::compare( TQListViewItem* item, int col, bool ascending ) const { FileListViewItem* k = static_cast<FileListViewItem*>( item ); if ( sortChar != k->sortChar ) { @@ -222,40 +222,40 @@ int FileListViewItem::compare( QListViewItem* item, int col, bool ascending ) co void FileListViewItem::removeChilds() { - QListViewItem*temp; + TQListViewItem*temp; while ((temp=firstChild())) { delete temp; } } -void FileListViewItem::updateStatus(const svn::StatusPtr&s) +void FileListViewItem::updatetqStatus(const svn::StatusPtr&s) { setStat(s); } SvnItem* FileListViewItem::getParentItem()const { - return static_cast<FileListViewItem*>(parent()); + return static_cast<FileListViewItem*>(tqparent()); } /*! \fn FileListViewItem::getParentDir()const */ - QString FileListViewItem::getParentDir()const + TQString FileListViewItem::getParentDir()const { SvnItem*temp = getParentItem(); - if (!temp) return QString::null; + if (!temp) return TQString(); return temp->fullName(); } -void FileListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +void FileListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment) { bool colors = Kdesvnsettings::colored_state(); if (!colors||m_bgColor==NONE) { - KListViewItem::paintCell(p,cg,column,width,alignment); + KListViewItem::paintCell(p,cg,column,width,tqalignment); return; } - QColorGroup _cg = cg; - QColor _bgColor; + TQColorGroup _cg = cg; + TQColor _bgColor; switch(m_bgColor) { case UPDATES: _bgColor = Kdesvnsettings::color_need_update(); @@ -285,23 +285,23 @@ void FileListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, _bgColor = Kdesvnsettings::color_need_lock(); break; default: - KListViewItem::paintCell(p,cg,column,width,alignment); + KListViewItem::paintCell(p,cg,column,width,tqalignment); return; break; } - const QPixmap *pm = listView()->viewport()->backgroundPixmap(); + const TQPixmap *pm = listView()->viewport()->backgroundPixmap(); if (pm && !pm->isNull()) { - _cg.setBrush(QColorGroup::Base, QBrush(_bgColor, *pm)); - QPoint o = p->brushOrigin(); + _cg.setBrush(TQColorGroup::Base, TQBrush(_bgColor, *pm)); + TQPoint o = p->brushOrigin(); p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() ); } else { - if (listView()->viewport()->backgroundMode()==Qt::FixedColor) { - _cg.setColor(QColorGroup::Background,_bgColor); + if (listView()->viewport()->backgroundMode()==TQt::FixedColor) { + _cg.setColor(TQColorGroup::Background,_bgColor); } else { - _cg.setColor(QColorGroup::Base,_bgColor); + _cg.setColor(TQColorGroup::Base,_bgColor); } } - QListViewItem::paintCell(p, _cg, column, width, alignment); + TQListViewItem::paintCell(p, _cg, column, width, tqalignment); } const svn::Revision&FileListViewItem::correctPeg()const @@ -309,7 +309,7 @@ const svn::Revision&FileListViewItem::correctPeg()const return m_Ksvnfilelist->remoteRevision(); } -FileListViewItem*FileListViewItem::findChild(const QString&aName) +FileListViewItem*FileListViewItem::findChild(const TQString&aName) { FileListViewItem*_item = (FileListViewItem*)firstChild(); while (_item) { |