From 4ae0c208b66e0f7954e194384464fe2d0a2c56dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:51:49 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kbabel/commonui/context.cpp | 88 ++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'kbabel/commonui/context.cpp') diff --git a/kbabel/commonui/context.cpp b/kbabel/commonui/context.cpp index db468795..55c0f196 100644 --- a/kbabel/commonui/context.cpp +++ b/kbabel/commonui/context.cpp @@ -34,17 +34,17 @@ #include "klisteditor.h" #include "kbprojectsettings.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -62,7 +62,7 @@ #include #include -SourceContext::SourceContext(QWidget *parent, KBabel::Project::Ptr project): QWidget(parent) +SourceContext::SourceContext(TQWidget *parent, KBabel::Project::Ptr project): TQWidget(parent) , m_parent( parent ) , _part(0) , _view(0) @@ -71,20 +71,20 @@ SourceContext::SourceContext(QWidget *parent, KBabel::Project::Ptr project): QWi , _project(project) { _referenceList.clear(); - _referenceCombo = new QComboBox( this ); - connect( _referenceCombo, SIGNAL(activated(int)), this, SLOT(updateToSelected(int))); + _referenceCombo = new TQComboBox( this ); + connect( _referenceCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateToSelected(int))); - _layout= new QVBoxLayout(this); + _layout= new TQVBoxLayout(this); _layout->addWidget(_referenceCombo); } -void SourceContext::setContext( const QString& packageDir, const QString& packageName, const QString& gettextComment, const KURL& urlPoFile ) +void SourceContext::setContext( const TQString& packageDir, const TQString& packageName, const TQString& gettextComment, const KURL& urlPoFile ) { if( !_part && !loadPart() ) return; _referenceCombo->clear(); _referenceList = resolvePath( packageDir, packageName, gettextComment, urlPoFile ); - for( QValueList::const_iterator it = _referenceList.constBegin(); it != _referenceList.constEnd(); ++it ) + for( TQValueList::const_iterator it = _referenceList.constBegin(); it != _referenceList.constEnd(); ++it ) _referenceCombo->insertItem((*it).path); _referenceCombo->setEnabled( !_referenceList.isEmpty() ); @@ -120,24 +120,24 @@ void SourceContext::updateToSelected(int index) (dynamic_cast(_part))->setSelection(ci.line-1,0,ci.line,0); } -QValueList SourceContext::resolvePath( const QString& packageDir, const QString& packageName, const QString& gettextComment, const KURL& urlPoFile ) +TQValueList SourceContext::resolvePath( const TQString& packageDir, const TQString& packageName, const TQString& gettextComment, const KURL& urlPoFile ) { //kdDebug() << "GETTEXTCOMMENT:" << gettextComment << endl; // Find the directory name of the PO file, if the PO file is local // ### TODO: find a way to allow remote files too - QString poDir; + TQString poDir; #if KDE_IS_VERSION( 3, 5, 0 ) const KURL localUrl( KIO::NetAccess::mostLocalURL( urlPoFile, m_parent ) ); if ( localUrl.isLocalFile() ) { - const QFileInfo fi( localUrl.path() ); + const TQFileInfo fi( localUrl.path() ); poDir = fi.dirPath( true ); } #else if ( urlPoFile.isLocalFile() ) { - const QFileInfo fi( urlPoFile.path() ); + const TQFileInfo fi( urlPoFile.path() ); poDir = fi.dirPath( true ); } #endif @@ -151,12 +151,12 @@ QValueList SourceContext::resolvePath( const QString& packageDir, c kdDebug() << "CONTEXT VARIABLE END" << endl; #endif - QStringList prefixes; - const QStringList paths = _project->settings()->paths(); + TQStringList prefixes; + const TQStringList paths = _project->settings()->paths(); - for( QStringList::const_iterator it = paths.constBegin(); it!=paths.constEnd() ; ++it ) + for( TQStringList::const_iterator it = paths.constBegin(); it!=paths.constEnd() ; ++it ) { - QString pref = (*it); + TQString pref = (*it); if ( !poDir.isEmpty() ) { @@ -171,19 +171,19 @@ QValueList SourceContext::resolvePath( const QString& packageDir, c prefixes.append(pref); } - QValueList rawRefList; // raw references - QRegExp re("^\\s*(.+):(\\d+)\\s*$"); // Reg. exp. for Gettext references - QRegExp rex( "^#. i18n: file (.+) line (\\d+)\\s*$" ); //Reg. exp. for KDE extractrc/extractattr references - QRegExp res( "^# [Ff]ile: (.+), line(?: number)?: (\\d+)\\s*$"); // Reg. exp. for "strict" PO format - const QStringList lines = QStringList::split( "\n", gettextComment ); - for ( QStringList::const_iterator it = lines.constBegin() ; it != lines.constEnd() ; ++it) + TQValueList rawRefList; // raw references + TQRegExp re("^\\s*(.+):(\\d+)\\s*$"); // Reg. exp. for Gettext references + TQRegExp rex( "^#. i18n: file (.+) line (\\d+)\\s*$" ); //Reg. exp. for KDE extractrc/extractattr references + TQRegExp res( "^# [Ff]ile: (.+), line(?: number)?: (\\d+)\\s*$"); // Reg. exp. for "strict" PO format + const TQStringList lines = TQStringList::split( "\n", gettextComment ); + for ( TQStringList::const_iterator it = lines.constBegin() ; it != lines.constEnd() ; ++it) { - const QString curLine = (*it).stripWhiteSpace(); + const TQString curLine = (*it).stripWhiteSpace(); if( curLine.startsWith( "#:" ) ) { // We have a Gettext line with references - const QStringList references( QStringList::split( " ", curLine.mid( 2 ), false ) ); - for ( QStringList::const_iterator it = references.constBegin(); it != references.constEnd(); ++it ) + const TQStringList references( TQStringList::split( " ", curLine.mid( 2 ), false ) ); + for ( TQStringList::const_iterator it = references.constBegin(); it != references.constEnd(); ++it ) { if ( re.exactMatch( (*it) ) ) { @@ -191,7 +191,7 @@ QValueList SourceContext::resolvePath( const QString& packageDir, c ref.line = re.cap(2).toInt(); ref.path = re.cap(1); // ### TODO KDE4: perhaps we should not do the replace if compiled for Windows - ref.path.replace( QChar( '\\' ), QChar( '/' ) ); + ref.path.replace( TQChar( '\\' ), TQChar( '/' ) ); rawRefList.append( ref ); } } @@ -223,7 +223,7 @@ QValueList SourceContext::resolvePath( const QString& packageDir, c ref.line = res.cap(2).toInt(); ref.path = res.cap(1); // ### TODO KDE4: perhaps we should not do the replace if compiled for Windows - ref.path.replace( QChar( '\\' ), QChar( '/' ) ); + ref.path.replace( TQChar( '\\' ), TQChar( '/' ) ); rawRefList.append( ref ); } } @@ -232,18 +232,18 @@ QValueList SourceContext::resolvePath( const QString& packageDir, c } // Now that we have gathered the references, we need to convert them to absolute paths - QValueList results; - for ( QValueList::const_iterator it = rawRefList.constBegin(); it != rawRefList.constEnd(); ++it ) + TQValueList results; + for ( TQValueList::const_iterator it = rawRefList.constBegin(); it != rawRefList.constEnd(); ++it ) { const int lineNum = (*it).line; - const QString fileName = (*it).path; - for ( QStringList::const_iterator it1 = prefixes.constBegin(); it1 != prefixes.constEnd(); ++it1 ) + const TQString fileName = (*it).path; + for ( TQStringList::const_iterator it1 = prefixes.constBegin(); it1 != prefixes.constEnd(); ++it1 ) { - QString path = (*it1); + TQString path = (*it1); path.replace( "@COMMENTPATH@", fileName); //kdDebug() << "CONTEXT PATH: " << path << endl; // DEBUG - QFileInfo pathInfo( path ); + TQFileInfo pathInfo( path ); if( pathInfo.exists() ) { ContextInfo ref; @@ -289,8 +289,8 @@ bool SourceContext::loadPart() return false; } _view = _part->createView( this, 0 ); - _layout->addWidget(static_cast(_view), 1); - static_cast(_view)->show(); + _layout->addWidget(static_cast(_view), 1); + static_cast(_view)->show(); return true; } -- cgit v1.2.1