diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/commonui/context.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/commonui/context.cpp')
-rw-r--r-- | kbabel/commonui/context.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
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 <qcombobox.h> -#include <qfileinfo.h> -#include <qframe.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qlistbox.h> -#include <qpushbutton.h> -#include <qregexp.h> -#include <qvgroupbox.h> +#include <tqcombobox.h> +#include <tqfileinfo.h> +#include <tqframe.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqregexp.h> +#include <tqvgroupbox.h> #include <kconfig.h> #include <kdebug.h> @@ -62,7 +62,7 @@ #include <ktexteditor/selectioninterface.h> #include <ktexteditor/viewcursorinterface.h> -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<ContextInfo>::const_iterator it = _referenceList.constBegin(); it != _referenceList.constEnd(); ++it ) + for( TQValueList<ContextInfo>::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<KTextEditor::SelectionInterface *>(_part))->setSelection(ci.line-1,0,ci.line,0); } -QValueList<ContextInfo> SourceContext::resolvePath( const QString& packageDir, const QString& packageName, const QString& gettextComment, const KURL& urlPoFile ) +TQValueList<ContextInfo> 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<ContextInfo> 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<ContextInfo> SourceContext::resolvePath( const QString& packageDir, c prefixes.append(pref); } - QValueList<ContextInfo> 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<ContextInfo> 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<ContextInfo> 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<ContextInfo> 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<ContextInfo> SourceContext::resolvePath( const QString& packageDir, c } // Now that we have gathered the references, we need to convert them to absolute paths - QValueList<ContextInfo> results; - for ( QValueList<ContextInfo>::const_iterator it = rawRefList.constBegin(); it != rawRefList.constEnd(); ++it ) + TQValueList<ContextInfo> results; + for ( TQValueList<ContextInfo>::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<QWidget *>(_view), 1); - static_cast<QWidget *>(_view)->show(); + _layout->addWidget(static_cast<TQWidget *>(_view), 1); + static_cast<TQWidget *>(_view)->show(); return true; } |