From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/java/backgroundparser.cpp | 98 ++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'languages/java/backgroundparser.cpp') diff --git a/languages/java/backgroundparser.cpp b/languages/java/backgroundparser.cpp index 4081949c..0820b4d1 100644 --- a/languages/java/backgroundparser.cpp +++ b/languages/java/backgroundparser.cpp @@ -19,7 +19,7 @@ #if QT_VERSION < 0x030100 #include #else -#include +#include #endif #include @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include +#include +#include class KDevSourceProvider: public SourceProvider { @@ -48,7 +48,7 @@ public: void setReadFromDisk( bool b ) { m_readFromDisk = b; } bool readFromDisk() const { return m_readFromDisk; } - virtual QString contents( const QString& fileName ) + virtual TQString contents( const TQString& fileName ) { if( !m_readFromDisk ){ //kdDebug(9013) << "-------> kapp is locked = " << kapp->locked() << endl; @@ -59,8 +59,8 @@ public: //kdDebug(9013) << "-------> kapp locked" << endl; - QPtrList parts( *m_javaSupport->partController()->parts() ); - QPtrListIterator it( parts ); + TQPtrList parts( *m_javaSupport->partController()->parts() ); + TQPtrListIterator it( parts ); while( it.current() ){ KTextEditor::Document* doc = dynamic_cast( it.current() ); ++it; @@ -69,7 +69,7 @@ public: if( !doc || !editIface || doc->url().path() != fileName ) continue; - QString contents = QString( editIface->text().ascii() ); // deep copy + TQString contents = TQString( editIface->text().ascii() ); // deep copy if( needToLock ) kapp->unlock(); @@ -84,18 +84,18 @@ public: //kdDebug(9013) << "-------> kapp unlocked" << endl; } - QFile f( fileName ); - QTextStream stream( &f ); + TQFile f( fileName ); + TQTextStream stream( &f ); if( f.open(IO_ReadOnly) ){ - QString contents = stream.read(); + TQString contents = stream.read(); f.close(); return contents; } - return QString::null; + return TQString::null; } - virtual bool isModified( const QString& fileName ) + virtual bool isModified( const TQString& fileName ) { Q_UNUSED( fileName ); return true; @@ -116,44 +116,44 @@ public: bool isEmpty() const { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); return m_fileList.isEmpty(); } uint count() const { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); return m_fileList.count(); } - QPair front() const + QPair front() const { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); return m_fileList.front(); } void clear() { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); m_fileList.clear(); } - void push_back( const QString& fileName, bool readFromDisk=false ) + void push_back( const TQString& fileName, bool readFromDisk=false ) { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); m_fileList.append( qMakePair(fileName, readFromDisk) ); /// \FIXME ROBE deepcopy?! } void pop_front() { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); m_fileList.pop_front(); } - bool contains( const QString& fileName ) const + bool contains( const TQString& fileName ) const { - QMutexLocker locker( &m_mutex ); - QValueList< QPair >::ConstIterator it = m_fileList.begin(); + TQMutexLocker locker( &m_mutex ); + TQValueList< QPair >::ConstIterator it = m_fileList.begin(); while( it != m_fileList.end() ){ if( (*it).first == fileName ) return true; @@ -162,10 +162,10 @@ public: return false; } - void remove( const QString& fileName ) + void remove( const TQString& fileName ) { - QMutexLocker locker( &m_mutex ); - QValueList< QPair >::Iterator it = m_fileList.begin(); + TQMutexLocker locker( &m_mutex ); + TQValueList< QPair >::Iterator it = m_fileList.begin(); while( it != m_fileList.end() ){ if( (*it).first == fileName ) m_fileList.remove( it ); @@ -174,11 +174,11 @@ public: } private: - mutable QMutex m_mutex; - QValueList< QPair > m_fileList; + mutable TQMutex m_mutex; + TQValueList< QPair > m_fileList; }; -BackgroundParser::BackgroundParser( JavaSupportPart* part, QWaitCondition* consumed ) +BackgroundParser::BackgroundParser( JavaSupportPart* part, TQWaitCondition* consumed ) : m_consumed( consumed ), m_javaSupport( part ), m_close( false ) { m_fileList = new SynchronizedFileList(); @@ -198,9 +198,9 @@ BackgroundParser::~BackgroundParser() m_fileList = 0; } -void BackgroundParser::addFile( const QString& fileName, bool readFromDisk ) +void BackgroundParser::addFile( const TQString& fileName, bool readFromDisk ) { - QString fn = deepCopy( fileName ); + TQString fn = deepCopy( fileName ); bool added = false; if( !m_fileList->contains(fn) ){ @@ -215,9 +215,9 @@ void BackgroundParser::addFile( const QString& fileName, bool readFromDisk ) void BackgroundParser::removeAllFiles() { kdDebug(9013) << "BackgroundParser::removeAllFiles()" << endl; - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); - QMap::Iterator it = m_unitDict.begin(); + TQMap::Iterator it = m_unitDict.begin(); while( it != m_unitDict.end() ){ Unit* unit = it.data(); ++it; @@ -231,9 +231,9 @@ void BackgroundParser::removeAllFiles() m_isEmpty.wakeAll(); } -void BackgroundParser::removeFile( const QString& fileName ) +void BackgroundParser::removeFile( const TQString& fileName ) { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); if( Unit* unit = findUnit(fileName) ){ m_driver->remove( fileName ); @@ -246,7 +246,7 @@ void BackgroundParser::removeFile( const QString& fileName ) m_isEmpty.wakeAll(); } -Unit* BackgroundParser::parseFile( const QString& fileName, bool readFromDisk ) +Unit* BackgroundParser::parseFile( const TQString& fileName, bool readFromDisk ) { static_cast( m_driver->sourceProvider() )->setReadFromDisk( readFromDisk ); @@ -276,7 +276,7 @@ Unit* BackgroundParser::parseFile( const QString& fileName, bool readFromDisk ) KApplication::postEvent( m_javaSupport, new FileParsedEvent(fileName, unit->problems) ); } - m_currentFile = QString::null; + m_currentFile = TQString::null; if( m_fileList->isEmpty() ) m_isEmpty.wakeAll(); @@ -284,13 +284,13 @@ Unit* BackgroundParser::parseFile( const QString& fileName, bool readFromDisk ) return unit; } -Unit* BackgroundParser::findUnit( const QString& fileName ) +Unit* BackgroundParser::findUnit( const TQString& fileName ) { - QMap::Iterator it = m_unitDict.find( fileName ); + TQMap::Iterator it = m_unitDict.find( fileName ); return it != m_unitDict.end() ? *it : 0; } -RefJavaAST BackgroundParser::translationUnit( const QString& fileName ) +RefJavaAST BackgroundParser::translationUnit( const TQString& fileName ) { Unit* u = 0; if( (u = findUnit(fileName)) == 0 ){ @@ -301,7 +301,7 @@ RefJavaAST BackgroundParser::translationUnit( const QString& fileName ) return u->translationUnit; } -QValueList BackgroundParser::problems( const QString& fileName ) +TQValueList BackgroundParser::problems( const TQString& fileName ) { Unit* u = 0; if( (u = findUnit(fileName)) == 0 ){ @@ -309,26 +309,26 @@ QValueList BackgroundParser::problems( const QString& fileName ) u = parseFile( fileName, false ); } - return u ? u->problems : QValueList(); + return u ? u->problems : TQValueList(); } void BackgroundParser::close() { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); m_close = true; m_canParse.wakeAll(); } bool BackgroundParser::filesInQueue() { - QMutexLocker locker( &m_mutex ); + TQMutexLocker locker( &m_mutex ); return m_fileList->count() || !m_currentFile.isEmpty(); } void BackgroundParser::run() { - // (void) m_javaSupport->codeCompletion()->repository()->getEntriesInScope( QStringList(), false ); + // (void) m_javaSupport->codeCompletion()->repository()->getEntriesInScope( TQStringList(), false ); while( !m_close ){ @@ -346,8 +346,8 @@ void BackgroundParser::run() break; } - QPair entry = m_fileList->front(); - QString fileName = entry.first; + QPair entry = m_fileList->front(); + TQString fileName = entry.first; bool readFromDisk = entry.second; m_currentFile = fileName; m_fileList->pop_front(); @@ -359,5 +359,5 @@ void BackgroundParser::run() kdDebug(9013) << "!!!!!!!!!!!!!!!!!! BG PARSER DESTROYED !!!!!!!!!!!!" << endl; //commented to fix #83352 - //QThread::exit(); + //TQThread::exit(); } -- cgit v1.2.1