summaryrefslogtreecommitdiffstats
path: root/languages/cpp/backgroundparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/backgroundparser.cpp')
-rw-r--r--languages/cpp/backgroundparser.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/languages/cpp/backgroundparser.cpp b/languages/cpp/backgroundparser.cpp
index d3f9c2ee..4e22dcc7 100644
--- a/languages/cpp/backgroundparser.cpp
+++ b/languages/cpp/backgroundparser.cpp
@@ -53,7 +53,7 @@ private:
class KDevSourceProvider: public SourceProvider
{
public:
- //Deadlock is a mutex that is locked when KDevSourceProvider::contents(..) is used, and that should be unlocked before TQApplication is locked(that way a deadlock where the thread that holds the QApplication-mutex and tries to lock the given mutex, while the thread that calls contents(..) and holds the given mutex and tries to lock the QApplication-mutex, cannot happen)
+ //Deadlock is a mutex that is locked when KDevSourceProvider::contents(..) is used, and that should be unlocked before TQApplication is locked(that way a deadlock where the thread that holds the TQApplication-mutex and tries to lock the given mutex, while the thread that calls contents(..) and holds the given mutex and tries to lock the TQApplication-mutex, cannot happen)
KDevSourceProvider( CppSupportPart* cppSupport, TQMutex& deadlock )
: m_cppSupport( cppSupport ),
m_readFromDisk( false ),
@@ -71,7 +71,7 @@ public:
virtual TQString contents( const TQString& fileName )
{
- TQString contents = TQString::null;
+ TQString contents = TQString();
if ( !m_readFromDisk )
{
@@ -105,7 +105,7 @@ public:
//kdDebug(9007) << "-------> kapp unlocked" << endl;
}
- if( m_readFromDisk || contents == TQString::null )
+ if( m_readFromDisk || contents == TQString() )
{
TQFile f( fileName );
if ( f.open( IO_ReadOnly ) )
@@ -149,7 +149,7 @@ typedef std::string SafeString;
class SynchronizedFileList
{
- typedef std::list< QPair<SafeString, bool> > ListType;
+ typedef std::list< TQPair<SafeString, bool> > ListType;
public:
SynchronizedFileList()
{}
@@ -166,7 +166,7 @@ public:
return m_fileList.size();
}
- QPair<SafeString, bool> front() const
+ TQPair<SafeString, bool> front() const
{
TQMutexLocker locker( &m_mutex );
return m_fileList.front();
@@ -182,14 +182,14 @@ public:
{
SafeString s( fileName.ascii() );
TQMutexLocker locker( &m_mutex );
- m_fileList.push_front( qMakePair( s, readFromDisk ) );
+ m_fileList.push_front( tqMakePair( s, readFromDisk ) );
}
void push_back( const TQString& fileName, bool readFromDisk = false )
{
SafeString s( fileName.ascii() );
TQMutexLocker locker( &m_mutex );
- m_fileList.push_back( qMakePair( s, readFromDisk ) );
+ m_fileList.push_back( tqMakePair( s, readFromDisk ) );
}
void pop_front()
@@ -212,15 +212,15 @@ public:
return c;
}
- QPair<SafeString, bool> takeFront()
+ TQPair<SafeString, bool> takeFront()
{
TQMutexLocker locker( &m_mutex );
- QPair<SafeString, bool> ret = m_fileList.front();
+ TQPair<SafeString, bool> ret = m_fileList.front();
m_fileList.pop_front();
return ret;
}
- bool contains( const TQString& fileName ) const
+ bool tqcontains( const TQString& fileName ) const
{
TQMutexLocker locker( &m_mutex );
ListType::const_iterator it = m_fileList.begin();
@@ -283,7 +283,7 @@ void BackgroundParser::addFile( const TQString& fileName, bool readFromDisk )
TQString fn = deepCopy( fileName );
//bool added = false;
- /*if ( !m_fileList->contains( fn ) )
+ /*if ( !m_fileList->tqcontains( fn ) )
{
m_fileList->push_back( fn, readFromDisk );
added = true;
@@ -299,7 +299,7 @@ void BackgroundParser::addFileFront( const TQString& fileName, bool readFromDisk
TQString fn = deepCopy( fileName );
bool added = false;
- /*if ( m_fileList->contains( fn ) )
+ /*if ( m_fileList->tqcontains( fn ) )
m_fileList->remove( fn );*/
m_fileList->push_front( fn, readFromDisk );
@@ -387,15 +387,15 @@ void BackgroundParser::fileParsed( ParsedFile& file ) {
ParsedFilePointer translationUnitUnsafe = m_driver->takeTranslationUnit( file.fileName() );
//now file and translationUnitUnsafe are the same
ParsedFilePointer translationUnit;
- //Since the lexer-cache keeps many QStrings like macro-names used in the background, everything must be copied here. The safest solution is just
+ //Since the lexer-cache keeps many TQStrings like macro-names used in the background, everything must be copied here. The safest solution is just
//serializing and deserializing the whole thing(the serialization does not respect the AST, but that can be copied later because that's safe)
TQMemArray<char> data;
{
- TQDataStream stream( data, IO_WriteOnly );
+ TQDataStream stream( TQByteArray(data), IO_WriteOnly );
translationUnitUnsafe->write( stream );
}
{
- TQDataStream stream( data, IO_ReadOnly );
+ TQDataStream stream( TQByteArray(data), IO_ReadOnly );
translationUnit = new ParsedFile( stream );
}
@@ -410,7 +410,7 @@ void BackgroundParser::fileParsed( ParsedFile& file ) {
static_cast<KDevSourceProvider*>( m_driver->sourceProvider() ) ->setReadFromDisk( false );
- if ( m_unitDict.find( file.fileName() ) != m_unitDict.end() )
+ if ( m_unitDict.tqfind( file.fileName() ) != m_unitDict.end() )
{
Unit * u = m_unitDict[ file.fileName() ];
m_unitDict.remove( file.fileName() );
@@ -422,7 +422,7 @@ void BackgroundParser::fileParsed( ParsedFile& file ) {
KApplication::postEvent( m_cppSupport, new FileParsedEvent( file.fileName(), unit->problems, m_readFromDisk ) );
- m_currentFile = TQString::null;
+ m_currentFile = TQString();
if ( m_fileList->isEmpty() )
m_isEmpty.wakeAll();
@@ -430,12 +430,12 @@ void BackgroundParser::fileParsed( ParsedFile& file ) {
Unit* BackgroundParser::findUnit( const TQString& fileName )
{
- TQMap<TQString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ TQMap<TQString, Unit*>::Iterator it = m_unitDict.tqfind( fileName );
return it != m_unitDict.end() ? *it : 0;
}
bool BackgroundParser::hasTranslationUnit( const TQString& fileName ) {
- TQMap<TQString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ TQMap<TQString, Unit*>::Iterator it = m_unitDict.tqfind( fileName );
return it != m_unitDict.end();
}
@@ -526,7 +526,7 @@ void BackgroundParser::run()
if ( m_close )
break;
- QPair<SafeString, bool> entry = m_fileList->takeFront();
+ TQPair<SafeString, bool> entry = m_fileList->takeFront();
TQString fileName = entry.first.c_str();
bool readFromDisk = entry.second;
m_currentFile = deepCopy(fileName);
@@ -534,7 +534,7 @@ void BackgroundParser::run()
( void ) parseFile( fileName, readFromDisk, true );
- m_currentFile = TQString::null;
+ m_currentFile = TQString();
}
kdDebug( 9007 ) << "!!!!!!!!!!!!!!!!!! BG PARSER DESTROYED !!!!!!!!!!!!" << endl;