summaryrefslogtreecommitdiffstats
path: root/languages/java/backgroundparser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /languages/java/backgroundparser.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/java/backgroundparser.cpp')
-rw-r--r--languages/java/backgroundparser.cpp98
1 files changed, 49 insertions, 49 deletions
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 <kdevmutex.h>
#else
-#include <qmutex.h>
+#include <tqmutex.h>
#endif
#include <kparts/part.h>
@@ -34,9 +34,9 @@
#include <kdebug.h>
#include <kapplication.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
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<KParts::Part> parts( *m_javaSupport->partController()->parts() );
- QPtrListIterator<KParts::Part> it( parts );
+ TQPtrList<KParts::Part> parts( *m_javaSupport->partController()->parts() );
+ TQPtrListIterator<KParts::Part> it( parts );
while( it.current() ){
KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( 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<QString, bool> front() const
+ QPair<TQString, bool> 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<QString, bool> >::ConstIterator it = m_fileList.begin();
+ TQMutexLocker locker( &m_mutex );
+ TQValueList< QPair<TQString, bool> >::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<QString, bool> >::Iterator it = m_fileList.begin();
+ TQMutexLocker locker( &m_mutex );
+ TQValueList< QPair<TQString, bool> >::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<QString, bool> > m_fileList;
+ mutable TQMutex m_mutex;
+ TQValueList< QPair<TQString, bool> > 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<QString, Unit*>::Iterator it = m_unitDict.begin();
+ TQMap<TQString, Unit*>::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<KDevSourceProvider*>( 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<QString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ TQMap<TQString, Unit*>::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<Problem> BackgroundParser::problems( const QString& fileName )
+TQValueList<Problem> BackgroundParser::problems( const TQString& fileName )
{
Unit* u = 0;
if( (u = findUnit(fileName)) == 0 ){
@@ -309,26 +309,26 @@ QValueList<Problem> BackgroundParser::problems( const QString& fileName )
u = parseFile( fileName, false );
}
- return u ? u->problems : QValueList<Problem>();
+ return u ? u->problems : TQValueList<Problem>();
}
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<QString, bool> entry = m_fileList->front();
- QString fileName = entry.first;
+ QPair<TQString, bool> 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();
}