diff options
Diffstat (limited to 'kbabel/catalogmanager/catmanlistitem.cpp')
-rw-r--r-- | kbabel/catalogmanager/catmanlistitem.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/kbabel/catalogmanager/catmanlistitem.cpp b/kbabel/catalogmanager/catmanlistitem.cpp index 249cb053..5613a0bd 100644 --- a/kbabel/catalogmanager/catmanlistitem.cpp +++ b/kbabel/catalogmanager/catmanlistitem.cpp @@ -42,29 +42,29 @@ #include <klocale.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qbitmap.h> -#include <qlabel.h> -#include <qpainter.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqbitmap.h> +#include <tqlabel.h> +#include <tqpainter.h> #include <cvshandler.h> #include <svnhandler.h> using namespace KBabel; -CatManListItem::CatManListItem(CatalogManagerView *view, QListViewItem* parent,QString fullPath,QString fullPotPath,QString package) - : QListViewItem(parent) +CatManListItem::CatManListItem(CatalogManagerView *view, TQListViewItem* parent,TQString fullPath,TQString fullPotPath,TQString package) + : TQListViewItem(parent) { _view = view; init(fullPath,fullPotPath,package); } -CatManListItem::CatManListItem(CatalogManagerView *view, QListView* parent,QString fullPath,QString fullPotPath) - : QListViewItem(parent) +CatManListItem::CatManListItem(CatalogManagerView *view, TQListView* parent,TQString fullPath,TQString fullPotPath) + : TQListViewItem(parent) { - _primary=QFileInfo(fullPath); - _template=QFileInfo(fullPotPath); + _primary=TQFileInfo(fullPath); + _template=TQFileInfo(fullPotPath); _package="/"; _type=Dir; _marked=false; @@ -82,10 +82,10 @@ CatManListItem::CatManListItem(CatalogManagerView *view, QListView* parent,QStri } -void CatManListItem::init(const QString& fullPath, const QString& fullPotPath, const QString& package) +void CatManListItem::init(const TQString& fullPath, const TQString& fullPotPath, const TQString& package) { - _primary=QFileInfo(fullPath); - _template=QFileInfo(fullPotPath); + _primary=TQFileInfo(fullPath); + _template=TQFileInfo(fullPotPath); _package=package; _marked=false; @@ -97,7 +97,7 @@ void CatManListItem::init(const QString& fullPath, const QString& fullPotPath, c _template.setCaching(false); // set - _lastUpdated=QDate(1900,1,1); + _lastUpdated=TQDate(1900,1,1); _wordList.clear(); _wordListUpdated = false; @@ -141,11 +141,11 @@ bool CatManListItem::marked() const void CatManListItem::setOpen(bool open) { bool needWork = needsWork(); - QListViewItem::setOpen(open); + TQListViewItem::setOpen(open); if(open && _type==Dir) { - QPixmap icon; + TQPixmap icon; icon = needWork ? ICON_FOLDER_OPEN_WORK : ICON_FOLDER_OPEN_OK; if(!_template.exists()) @@ -164,7 +164,7 @@ void CatManListItem::setOpen(bool open) } else { - QPixmap icon; + TQPixmap icon; if(needsWork()) icon = ICON_FOLDER_CLOSED_WORK; @@ -181,14 +181,14 @@ void CatManListItem::setOpen(bool open) } -QStringList CatManListItem::allChildrenList(bool onlyFiles) const +TQStringList CatManListItem::allChildrenList(bool onlyFiles) const { - QStringList childrenList; + TQStringList childrenList; CatManListItem * myChild = (CatManListItem*)firstChild(); while( myChild ) { - QString name=myChild->package(); + TQString name=myChild->package(); if(myChild->isFile()) { @@ -209,9 +209,9 @@ QStringList CatManListItem::allChildrenList(bool onlyFiles) const } -QStringList CatManListItem::allChildrenFileList(bool onlyFiles, bool emptyDirs, bool onlyModified) const +TQStringList CatManListItem::allChildrenFileList(bool onlyFiles, bool emptyDirs, bool onlyModified) const { - QStringList childrenList; + TQStringList childrenList; CatManListItem * myChild = (CatManListItem*)firstChild(); while( myChild ) @@ -238,14 +238,14 @@ QStringList CatManListItem::allChildrenFileList(bool onlyFiles, bool emptyDirs, } -QStringList CatManListItem::contentsList(bool onlyFiles) const +TQStringList CatManListItem::contentsList(bool onlyFiles) const { - QStringList childList; + TQStringList childList; CatManListItem * myChild = (CatManListItem*)firstChild(); while( myChild ) { - QString name=myChild->package(); + TQString name=myChild->package(); if(onlyFiles) { @@ -292,10 +292,10 @@ void CatManListItem::checkUpdate(bool noParents) } } -QString CatManListItem::key(int col, bool) const +TQString CatManListItem::key(int col, bool) const { // show directories first - QString key=text(col); + TQString key=text(col); if(col==COL_NAME) { @@ -356,7 +356,7 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren { if(_primary.isDir()) { - QDir dir=_primary.dir(); + TQDir dir=_primary.dir(); setText(COL_NAME,dir.dirName()); // count the childen numbers @@ -374,15 +374,15 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren ch = static_cast<CatManListItem*>(ch->nextSibling()); } - setText(COL_FUZZY,QString::number(fuzzy)); - setText(COL_UNTRANS,QString::number(untrans)); - setText(COL_TOTAL,QString::number(total)); + setText(COL_FUZZY,TQString::number(fuzzy)); + setText(COL_UNTRANS,TQString::number(untrans)); + setText(COL_TOTAL,TQString::number(total)); //setSelectable(false); _type=Dir; bool needWork = needsWork(); - QPixmap icon; + TQPixmap icon; if(!isOpen()) { if( needWork ) @@ -403,7 +403,7 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren } else { - QPixmap folder = icon; + TQPixmap folder = icon; icon=paintExclamation(&folder); setPixmap(COL_NAME,folder); @@ -412,18 +412,18 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren else // primary is file { _type=File; - QString name=_primary.fileName(); + TQString name=_primary.fileName(); setText(COL_NAME,name.left(name.length()-3)); if(showPoInfo) { - _lastUpdated=QDateTime::currentDateTime(); + _lastUpdated=TQDateTime::currentDateTime(); bool neededWork=needsWork(); bool needWork=false; PoInfo poInfo; - QPixmap icon = ICON_UPDATING; + TQPixmap icon = ICON_UPDATING; setPixmap(COL_NAME,icon); if ( PoInfo::info( _primary.absFilePath(), poInfo, _wordList, updateWordList, true, true ) == OK ) { @@ -441,7 +441,7 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren _isModified = cvsHandler->isConsideredModified( cvsFileStatus ) || svnHandler->isConsideredModified( svnFileStatus ); - QString versionControl; + TQString versionControl; if ( cvsFileStatus != CVSHandler::NO_REPOSITORY ) versionControl = cvsHandler->fileStatus( cvsFileStatus ); else if ( svnFileStatus != SVNHandler::NO_REPOSITORY ) @@ -449,9 +449,9 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren else versionControl = i18n("No version control"); - setText(COL_FUZZY,QString::number(poInfo.fuzzy)); - setText(COL_UNTRANS,QString::number(poInfo.untranslated)); - setText(COL_TOTAL,QString::number(poInfo.total)); + setText(COL_FUZZY,TQString::number(poInfo.fuzzy)); + setText(COL_UNTRANS,TQString::number(poInfo.untranslated)); + setText(COL_TOTAL,TQString::number(poInfo.total)); setText( COL_CVS_OR_SVN, versionControl ); setText(COL_REVISION,poInfo.revision); setText(COL_TRANSLATOR,poInfo.lastTranslator); @@ -492,7 +492,7 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren { if(_template.isDir()) { - QDir dir=_template.dir(); + TQDir dir=_template.dir(); setText(COL_NAME,dir.dirName()); //setSelectable(false); _type=Dir; @@ -508,10 +508,10 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren ch = static_cast<CatManListItem*>(ch->nextSibling()); } - setText(COL_TOTAL,QString::number(total)); + setText(COL_TOTAL,TQString::number(total)); - QPixmap icon; + TQPixmap icon; if(!isOpen()) { icon = ICON_FOLDER_CLOSED_WORK; @@ -527,20 +527,20 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren else { _type=File; - QString name=_primary.fileName(); + TQString name=_primary.fileName(); setText(COL_NAME,name.left(name.length()-3)); if(showPoInfo) { - _lastUpdated=QDateTime::currentDateTime(); + _lastUpdated=TQDateTime::currentDateTime(); // clean previous state information - setText(COL_FUZZY,QString::null); - setText(COL_UNTRANS,QString::null); - setText(COL_TOTAL,QString::null); - setText(COL_CVS_OR_SVN, QString::null); - setText(COL_REVISION, QString::null); - setText(COL_TRANSLATOR, QString::null); + setText(COL_FUZZY,TQString::null); + setText(COL_UNTRANS,TQString::null); + setText(COL_TOTAL,TQString::null); + setText(COL_CVS_OR_SVN, TQString::null); + setText(COL_REVISION, TQString::null); + setText(COL_TRANSLATOR, TQString::null); setPixmap(COL_NAME,ICON_UPDATING); @@ -548,7 +548,7 @@ void CatManListItem::update(bool showPoInfo,bool includeChildren if ( PoInfo::info( _template.absFilePath(), poInfo, _wordList, false, true, true ) == OK ) { if( _view->isStopped() ) return; - setText(COL_TOTAL,QString::number(poInfo.total)); + setText(COL_TOTAL,TQString::number(poInfo.total)); } if( _view->isStopped() ) return; } @@ -614,21 +614,21 @@ void CatManListItem::updateAfterSave( PoInfo &poInfo ) // primary is existent file _type=File; - QString name=_primary.fileName(); + TQString name=_primary.fileName(); setText(COL_NAME,name.left(name.length()-3)); - _lastUpdated=QDateTime::currentDateTime(); + _lastUpdated=TQDateTime::currentDateTime(); bool neededWork=needsWork(); bool needWork=false; - QPixmap icon; + TQPixmap icon; _hasErrors=false; const CVSHandler::FileStatus cvsFileStatus = _view->cvsHandler()->fstatus(poFile()); const SVNHandler::FileStatus svnFileStatus = _view->svnHandler()->fstatus(poFile()); - QString versionControl; + TQString versionControl; if ( cvsFileStatus != CVSHandler::NO_REPOSITORY ) versionControl = _view->cvsHandler()->fileStatus( cvsFileStatus ); else if ( svnFileStatus != SVNHandler::NO_REPOSITORY ) @@ -636,9 +636,9 @@ void CatManListItem::updateAfterSave( PoInfo &poInfo ) else versionControl = i18n("No version control"); - setText(COL_FUZZY,QString::number(poInfo.fuzzy)); - setText(COL_UNTRANS,QString::number(poInfo.untranslated)); - setText(COL_TOTAL,QString::number(poInfo.total)); + setText(COL_FUZZY,TQString::number(poInfo.fuzzy)); + setText(COL_UNTRANS,TQString::number(poInfo.untranslated)); + setText(COL_TOTAL,TQString::number(poInfo.total)); setText( COL_CVS_OR_SVN, versionControl ); setText(COL_REVISION,poInfo.revision); setText(COL_TRANSLATOR,poInfo.lastTranslator); @@ -777,17 +777,17 @@ bool CatManListItem::isFile() const return type()==File; } -QString CatManListItem::poFile() const +TQString CatManListItem::poFile() const { return _primary.absFilePath(); } -QString CatManListItem::potFile() const +TQString CatManListItem::potFile() const { return _template.absFilePath(); } -QString CatManListItem::package(bool rootSlash) const +TQString CatManListItem::package(bool rootSlash) const { if(rootSlash) return _package; @@ -797,21 +797,21 @@ QString CatManListItem::package(bool rootSlash) const } } -QString CatManListItem::packageDir( ) const +TQString CatManListItem::packageDir( ) const { - return ( _type == Dir ? _package : QString::null ); + return ( _type == Dir ? _package : TQString::null ); } -QString CatManListItem::name() const +TQString CatManListItem::name() const { int index = _package.findRev("/"); return _package.right(_package.length()-index-1); } -QPixmap CatManListItem::paintExclamation(QPixmap* pixmap) +TQPixmap CatManListItem::paintExclamation(TQPixmap* pixmap) { if(!pixmap || pixmap->isNull()) - return QPixmap(0,0); + return TQPixmap(0,0); if(_package=="/" && _template.filePath().isEmpty()) return *pixmap; @@ -827,17 +827,17 @@ QPixmap CatManListItem::paintExclamation(QPixmap* pixmap) int diameter=QMIN(width,height); - QBitmap mask=pixmap->createHeuristicMask(); + TQBitmap mask=pixmap->createHeuristicMask(); - QPainter mp(&mask); - mp.setPen(QPen(Qt::color1,1)); + TQPainter mp(&mask); + mp.setPen(TQPen(Qt::color1,1)); mp.drawEllipse(width-diameter,height-diameter,diameter,diameter); - QPixmap result(width,height); + TQPixmap result(width,height); - QPainter p(&result); + TQPainter p(&result); p.drawPixmap(0,0,*pixmap); - p.setPen( QPen(red,1) ); + p.setPen( TQPen(red,1) ); p.drawEllipse(width-diameter,height-diameter,diameter,diameter); result.setMask(mask); @@ -845,9 +845,9 @@ QPixmap CatManListItem::paintExclamation(QPixmap* pixmap) return result; } -QListViewItem *CatManListItem::previousSibling() +TQListViewItem *CatManListItem::previousSibling() { - QListViewItem * i = parent(); + TQListViewItem * i = parent(); if( !i ) return i; i = i->firstChild(); if( !i ) return i; @@ -856,22 +856,22 @@ QListViewItem *CatManListItem::previousSibling() return i; } -QListViewItem *CatManListItem::lastChild() +TQListViewItem *CatManListItem::lastChild() { - QListViewItem * i = firstChild(); + TQListViewItem * i = firstChild(); if( !i ) return i; while( i->nextSibling() ) i = i->nextSibling(); return i; } -void CatManListItem::checkErrors(KDataTool* tool, QObject* progressSignalHandler, bool ignoreFuzzy, bool markAsFuzzy) +void CatManListItem::checkErrors(KDataTool* tool, TQObject* progressSignalHandler, bool ignoreFuzzy, bool markAsFuzzy) { bool hasError=false; _errors.clear(); Catalog* cat = new Catalog(); - QObject::connect( cat, SIGNAL( signalProgress(int) ), progressSignalHandler, SIGNAL( setValidationProgressBar(int))); - QObject::connect( cat, SIGNAL( signalResetProgressBar(QString, int) ), progressSignalHandler, SLOT( setupFileProgressBar(QString, int))); + TQObject::connect( cat, TQT_SIGNAL( signalProgress(int) ), progressSignalHandler, TQT_SIGNAL( setValidationProgressBar(int))); + TQObject::connect( cat, TQT_SIGNAL( signalResetProgressBar(TQString, int) ), progressSignalHandler, TQT_SLOT( setupFileProgressBar(TQString, int))); if( cat->openURL(KURL( poFile() )) == OK ) { @@ -887,7 +887,7 @@ void CatManListItem::checkErrors(KDataTool* tool, QObject* progressSignalHandler if( hasError ) { - QString errortext; + TQString errortext; _hasErrors = true; DocPosition dummy; |