summaryrefslogtreecommitdiffstats
path: root/languages/cpp/cppsupportpart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/cppsupportpart.cpp')
-rw-r--r--languages/cpp/cppsupportpart.cpp196
1 files changed, 101 insertions, 95 deletions
diff --git a/languages/cpp/cppsupportpart.cpp b/languages/cpp/cppsupportpart.cpp
index 9dc2a715..2e77030b 100644
--- a/languages/cpp/cppsupportpart.cpp
+++ b/languages/cpp/cppsupportpart.cpp
@@ -82,7 +82,7 @@
#include <kstatusbar.h>
#include <tdeconfig.h>
#include <tdeversion.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <kiconloader.h>
#include <tdetexteditor/document.h>
@@ -178,7 +178,7 @@ class BackgroundParserConfig
public:
void readConfig()
{
- TDEConfig* config = kapp->config();
+ TDEConfig* config = tdeApp->config();
config->setGroup( "General Options" );
m_useProblemReporter = config->readBoolEntry( "EnableProblemReporter", true );
m_useBackgroundParser = config->readBoolEntry( "EnableCppBgParser", true );
@@ -201,10 +201,10 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
m_pCompletionConfig = new CppCodeCompletionConfig( this, projectDom() );
m_pSplitHeaderSourceConfig = new CppSplitHeaderSourceConfig( this, projectDom() );
- m_pCreateGetterSetterConfiguration = new CreateGetterSetterConfiguration( this ); connect( m_pSplitHeaderSourceConfig, TQT_SIGNAL( stored() ),
- this, TQT_SLOT( splitHeaderSourceConfigStored() ) );
- connect( m_pCompletionConfig, TQT_SIGNAL( stored() ),
- this, TQT_SLOT( codeCompletionConfigStored() ) );
+ m_pCreateGetterSetterConfiguration = new CreateGetterSetterConfiguration( this ); connect( m_pSplitHeaderSourceConfig, TQ_SIGNAL( stored() ),
+ this, TQ_SLOT( splitHeaderSourceConfigStored() ) );
+ connect( m_pCompletionConfig, TQ_SIGNAL( stored() ),
+ this, TQ_SLOT( codeCompletionConfigStored() ) );
m_qtBuildConfig = new QtBuildConfig( this, projectDom() );
m_qtBuildConfig->store();
@@ -215,44 +215,44 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
m_problemReporter = 0;
m_textChangedTimer = new TQTimer( this );
- connect( m_textChangedTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotParseCurrentFile()) );
+ connect( m_textChangedTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotParseCurrentFile()) );
m_cursorMovedTimer = new TQTimer( this );
- connect( m_cursorMovedTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotCursorPositionChanged()) );
+ connect( m_cursorMovedTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotCursorPositionChanged()) );
// m_deleteParserStoreTimer = new TQTimer( this );
m_saveMemoryTimer = new TQTimer( this );
m_buildSafeFileSetTimer = new TQTimer( this );
// m_functionHintTimer = new TQTimer( this );
- connect( m_buildSafeFileSetTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(buildSafeFileSet()) );
- connect( m_saveMemoryTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotSaveMemory()) );
-// connect( m_deleteParserStoreTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDeleteParserStore()) );
+ connect( m_buildSafeFileSetTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(buildSafeFileSet()) );
+ connect( m_saveMemoryTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotSaveMemory()) );
+// connect( m_deleteParserStoreTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotDeleteParserStore()) );
resetParserStoreTimer();
m_saveMemoryTimer->start( 240000, false ); //Free some memory every 4 minutes
- // connect( m_functionHintTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotFunctionHint()) );
+ // connect( m_functionHintTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotFunctionHint()) );
setXMLFile( "kdevcppsupport.rc" );
m_catalogList.setAutoDelete( true );
- connect( core(), TQT_SIGNAL( projectOpened() ), this, TQT_SLOT( projectOpened() ) );
- connect( core(), TQT_SIGNAL( projectClosed() ), this, TQT_SLOT( projectClosed() ) );
- connect( core(), TQT_SIGNAL( languageChanged() ), this, TQT_SLOT( projectOpened() ) );
- connect( partController(), TQT_SIGNAL( savedFile( const KURL& ) ),
- this, TQT_SLOT( savedFile( const KURL& ) ) );
- connect( core(), TQT_SIGNAL( contextMenu( TQPopupMenu *, const Context * ) ),
- this, TQT_SLOT( contextMenu( TQPopupMenu *, const Context * ) ) );
- connect( partController(), TQT_SIGNAL( activePartChanged( KParts::Part* ) ),
- this, TQT_SLOT( activePartChanged( KParts::Part* ) ) );
- connect( partController(), TQT_SIGNAL( partRemoved( KParts::Part* ) ),
- this, TQT_SLOT( partRemoved( KParts::Part* ) ) );
-
- connect( core(), TQT_SIGNAL( configWidget( KDialogBase* ) ),
- this, TQT_SLOT( configWidget( KDialogBase* ) ) );
+ connect( core(), TQ_SIGNAL( projectOpened() ), this, TQ_SLOT( projectOpened() ) );
+ connect( core(), TQ_SIGNAL( projectClosed() ), this, TQ_SLOT( projectClosed() ) );
+ connect( core(), TQ_SIGNAL( languageChanged() ), this, TQ_SLOT( projectOpened() ) );
+ connect( partController(), TQ_SIGNAL( savedFile( const KURL& ) ),
+ this, TQ_SLOT( savedFile( const KURL& ) ) );
+ connect( core(), TQ_SIGNAL( contextMenu( TQPopupMenu *, const Context * ) ),
+ this, TQ_SLOT( contextMenu( TQPopupMenu *, const Context * ) ) );
+ connect( partController(), TQ_SIGNAL( activePartChanged( KParts::Part* ) ),
+ this, TQ_SLOT( activePartChanged( KParts::Part* ) ) );
+ connect( partController(), TQ_SIGNAL( partRemoved( KParts::Part* ) ),
+ this, TQ_SLOT( partRemoved( KParts::Part* ) ) );
+
+ connect( core(), TQ_SIGNAL( configWidget( KDialogBase* ) ),
+ this, TQ_SLOT( configWidget( KDialogBase* ) ) );
m_switchHeaderSourceAction = new TDEAction( i18n( "Switch Header/Implementation" ), SHIFT + Key_F12,
- this, TQT_SLOT( slotSwitchHeader() ),
+ this, TQ_SLOT( slotSwitchHeader() ),
actionCollection(), "edit_switchheader" );
m_switchHeaderSourceAction->setToolTip( i18n( "Switch between header and implementation files" ) );
m_switchHeaderSourceAction->setWhatsThis( i18n( "<b>Switch Header/Implementation</b><p>"
@@ -265,7 +265,7 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
TDEAction *action;
action = new TDEAction( i18n( "Complete Text" ), CTRL + Key_Space,
- this, TQT_SLOT( slotCompleteText() ),
+ this, TQ_SLOT( slotCompleteText() ),
actionCollection(), "edit_complete_text" );
action->setToolTip( i18n( "Complete current expression" ) );
action->setWhatsThis( i18n( "<b>Complete Text</p><p>Completes current expression using "
@@ -274,11 +274,11 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
action->setEnabled( false );
m_createGetterSetterAction = new TDEAction( i18n( "Create Accessor Methods" ), 0,
- this, TQT_SLOT( slotCreateAccessMethods() ), actionCollection(),
+ this, TQ_SLOT( slotCreateAccessMethods() ), actionCollection(),
"edit_create_getter_setter" );
action = new TDEAction( i18n( "Make Member" ), 0, Key_F2,
- this, TQT_SLOT( slotMakeMember() ),
+ this, TQ_SLOT( slotMakeMember() ),
actionCollection(), "edit_make_member" );
action->setToolTip( i18n( "Make member" ) );
action->setWhatsThis( i18n( "<b>Make member</b><p>Creates a class member function in implementation file "
@@ -286,7 +286,7 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
action->plug( &m_DummyActionWidget );
action = new TDEAction( i18n( "Navigation Menu" ), 0, CTRL + ALT + Key_Space,
- this, TQT_SLOT( slotNavigate() ),
+ this, TQ_SLOT( slotNavigate() ),
actionCollection(), "edit_navigate" );
action->setToolTip( i18n( "Show the navigation-menu" ) );
action->setWhatsThis( i18n( "<b>Navigate</b><p>Shows a navigation-menu based on the type-evaluation of the item under the cursor." ) );
@@ -294,7 +294,7 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
action = new TDEAction( i18n( "New Class..." ), "classnew", 0,
- this, TQT_SLOT( slotNewClass() ),
+ this, TQ_SLOT( slotNewClass() ),
actionCollection(), "project_newclass" );
action->setToolTip( i18n( "Generate a new class" ) );
action->setWhatsThis( i18n( "<b>New Class</b><p>Calls the <b>New Class</b> wizard." ) );
@@ -306,8 +306,8 @@ CppSupportPart::CppSupportPart( TQObject *parent, const char *name, const TQStri
withcpp = true;
// daniel
- connect( core( ), TQT_SIGNAL( projectConfigWidget( KDialogBase* ) ), this,
- TQT_SLOT( projectConfigWidget( KDialogBase* ) ) );
+ connect( core( ), TQ_SIGNAL( projectConfigWidget( KDialogBase* ) ), this,
+ TQ_SLOT( projectConfigWidget( KDialogBase* ) ) );
new KDevCppSupportIface( this );
//(void) dcopClient();
@@ -438,7 +438,7 @@ void CppSupportPart::projectConfigWidget( KDialogBase* dlg )
vbox = dlg->addVBoxPage( i18n( "C++ Support" ), i18n( "C++ Support" ),
BarIcon( info() ->icon(), TDEIcon::SizeMedium ) );
CCConfigWidget* w = new CCConfigWidget( this, vbox );
- connect( dlg, TQT_SIGNAL( okClicked( ) ), w, TQT_SLOT( accept( ) ) );
+ connect( dlg, TQ_SIGNAL( okClicked( ) ), w, TQ_SLOT( accept( ) ) );
}
void CppSupportPart::configWidget( KDialogBase *dlg )
@@ -446,13 +446,13 @@ void CppSupportPart::configWidget( KDialogBase *dlg )
TQVBox * vbox = dlg->addVBoxPage( i18n( "C++ Class Generator" ), i18n( "C++ Class Generator" ),
BarIcon( info() ->icon(), TDEIcon::SizeMedium ) );
ClassGeneratorConfig *w = new ClassGeneratorConfig( vbox, "classgenerator config widget" );
- connect( dlg, TQT_SIGNAL( okClicked() ), w, TQT_SLOT( storeConfig() ) );
+ connect( dlg, TQ_SIGNAL( okClicked() ), w, TQ_SLOT( storeConfig() ) );
vbox = dlg->addVBoxPage(i18n("C++ Parsing"), i18n("C++ Parsing"),
BarIcon( "text-x-c++src", TDEIcon::SizeMedium) );
ConfigureProblemReporter* ww = new ConfigureProblemReporter( vbox );
ww->setPart( this );
- connect(dlg, TQT_SIGNAL(okClicked()), ww, TQT_SLOT(accept()));
+ connect(dlg, TQ_SIGNAL(okClicked()), ww, TQ_SLOT(accept()));
}
void CppSupportPart::activePartChanged( KParts::Part *part )
@@ -465,11 +465,11 @@ void CppSupportPart::activePartChanged( KParts::Part *part )
if ( m_activeView )
{
- disconnect( m_activeView, TQT_SIGNAL( cursorPositionChanged() ), this, 0 );
+ disconnect( m_activeView, TQ_SIGNAL( cursorPositionChanged() ), this, 0 );
}
if ( m_activeDocument )
{
- disconnect( m_activeDocument, TQT_SIGNAL(textChanged()), this, 0 );
+ disconnect( m_activeDocument, TQ_SIGNAL(textChanged()), this, 0 );
}
m_isTyping = false;
@@ -500,14 +500,14 @@ void CppSupportPart::activePartChanged( KParts::Part *part )
if ( m_activeDocument )
{
- connect( m_activeDocument, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged()) );
+ connect( m_activeDocument, TQ_SIGNAL(textChanged()), this, TQ_SLOT(slotTextChanged()) );
m_textChangedTimer->start( 250, true ); // kick the parse timer, we might want to parse the current file
}
if ( m_activeViewCursor )
{
- connect( m_activeView, TQT_SIGNAL( cursorPositionChanged() ), this, TQT_SLOT(slotCursorMoved()) );
-// this, TQT_SLOT( slotCursorPositionChanged() ) );
+ connect( m_activeView, TQ_SIGNAL( cursorPositionChanged() ), this, TQ_SLOT(slotCursorMoved()) );
+// this, TQ_SLOT( slotCursorPositionChanged() ) );
}
@@ -516,8 +516,8 @@ void CppSupportPart::activePartChanged( KParts::Part *part )
if ( !textHintIface )
return ;
- connect( view, TQT_SIGNAL( needTextHint( int, int, TQString& ) ),
- this, TQT_SLOT( slotNeedTextHint( int, int, TQString& ) ) );
+ connect( view, TQ_SIGNAL( needTextHint( int, int, TQString& ) ),
+ this, TQ_SLOT( slotNeedTextHint( int, int, TQString& ) ) );
textHintIface->enableTextHints( 1000 );
#endif
@@ -551,17 +551,17 @@ void CppSupportPart::projectOpened( )
embedProblemReporter();
- connect( core(), TQT_SIGNAL( configWidget( KDialogBase* ) ),
- m_problemReporter, TQT_SLOT( configWidget( KDialogBase* ) ) );
+ connect( core(), TQ_SIGNAL( configWidget( KDialogBase* ) ),
+ m_problemReporter, TQ_SLOT( configWidget( KDialogBase* ) ) );
- connect( project( ), TQT_SIGNAL( addedFilesToProject( const TQStringList & ) ),
- this, TQT_SLOT( addedFilesToProject( const TQStringList & ) ) );
- connect( project( ), TQT_SIGNAL( removedFilesFromProject( const TQStringList & ) ),
- this, TQT_SLOT( removedFilesFromProject( const TQStringList & ) ) );
- connect( project( ), TQT_SIGNAL( changedFilesInProject( const TQStringList & ) ),
- this, TQT_SLOT( changedFilesInProject( const TQStringList & ) ) );
- connect( project(), TQT_SIGNAL( projectCompiled() ),
- this, TQT_SLOT( slotProjectCompiled() ) );
+ connect( project( ), TQ_SIGNAL( addedFilesToProject( const TQStringList & ) ),
+ this, TQ_SLOT( addedFilesToProject( const TQStringList & ) ) );
+ connect( project( ), TQ_SIGNAL( removedFilesFromProject( const TQStringList & ) ),
+ this, TQ_SLOT( removedFilesFromProject( const TQStringList & ) ) );
+ connect( project( ), TQ_SIGNAL( changedFilesInProject( const TQStringList & ) ),
+ this, TQ_SLOT( changedFilesInProject( const TQStringList & ) ) );
+ connect( project(), TQ_SIGNAL( projectCompiled() ),
+ this, TQ_SLOT( slotProjectCompiled() ) );
m_timestamp.clear();
m_parseEmitWaiting.clear();
@@ -573,7 +573,7 @@ void CppSupportPart::projectOpened( )
m_buildSafeFileSetTimer->start( 500, true );
updateParserConfiguration(); //Necessary to respect custom include-paths and such
- TQTimer::singleShot( 500, this, TQT_SLOT( initialParse( ) ) );
+ TQTimer::singleShot( 500, this, TQ_SLOT( initialParse( ) ) );
}
void CppSupportPart::embedProblemReporter( bool force )
@@ -687,7 +687,7 @@ void CppSupportPart::contextMenu( TQPopupMenu *popup, const Context *context )
MakeMemberHelper( text, atline, atcol );
if ( !text.isEmpty() )
{
- id = popup->insertItem( i18n( "Make Member" ), this, TQT_SLOT( slotMakeMember() ) );
+ id = popup->insertItem( i18n( "Make Member" ), this, TQ_SLOT( slotMakeMember() ) );
popup->setWhatsThis( id, i18n( "<b>Make member</b><p>Creates a class member function in implementation file "
"based on the member declaration at the current line." ) );
}
@@ -754,7 +754,7 @@ void CppSupportPart::contextMenu( TQPopupMenu *popup, const Context *context )
}
text += formatModelItem( *it, true );
text = text.replace( TQString::fromLatin1( "&" ), TQString::fromLatin1( "&&" ) );
- int id = m2->insertItem( text, this, TQT_SLOT( gotoDeclarationLine( int ) ) );
+ int id = m2->insertItem( text, this, TQ_SLOT( gotoDeclarationLine( int ) ) );
int line, column;
( *it ) ->getStartPosition( &line, &column );
m2->setItemParameter( id, line );
@@ -795,7 +795,7 @@ void CppSupportPart::contextMenu( TQPopupMenu *popup, const Context *context )
}
text += formatModelItem( *it, true );
text = text.replace( TQString::fromLatin1( "&" ), TQString::fromLatin1( "&&" ) );
- int id = m->insertItem( text, this, TQT_SLOT( gotoLine( int ) ) );
+ int id = m->insertItem( text, this, TQ_SLOT( gotoLine( int ) ) );
int line, column;
( *it ) ->getStartPosition( &line, &column );
m->setItemParameter( id, line );
@@ -821,7 +821,7 @@ void CppSupportPart::contextMenu( TQPopupMenu *popup, const Context *context )
if ( mcontext->item() ->isClass() )
{
m_activeClass = ( ClassModel* ) mcontext->item();
- int id = popup->insertItem( i18n( "Extract Interface..." ), this, TQT_SLOT( slotExtractInterface() ) );
+ int id = popup->insertItem( i18n( "Extract Interface..." ), this, TQ_SLOT( slotExtractInterface() ) );
popup->setWhatsThis( id, i18n( "<b>Extract interface</b><p>Extracts interface from the selected class and creates a new class with this interface. "
"No implementation code is extracted and no implementation code is created." ) );
}
@@ -839,7 +839,7 @@ void CppSupportPart::contextMenu( TQPopupMenu *popup, const Context *context )
if ( url.fileName().endsWith( ".ui" ) )
{
m_contextFileName = url.path();
- int id = popup->insertItem( i18n( "Create or Select Implementation..." ), this, TQT_SLOT( slotCreateSubclass() ) );
+ int id = popup->insertItem( i18n( "Create or Select Implementation..." ), this, TQ_SLOT( slotCreateSubclass() ) );
popup->setWhatsThis( id, i18n( "<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner." ) );
}
}
@@ -1393,13 +1393,13 @@ bool CppSupportPart::shouldSplitDocument(const KURL &url)
return false;
}
-Qt::Orientation CppSupportPart::splitOrientation() const
+TQt::Orientation CppSupportPart::splitOrientation() const
{
TQString o = splitHeaderSourceConfig()->orientation();
if ( o == "Vertical" )
- return Qt::Vertical;
+ return TQt::Vertical;
else
- return Qt::Horizontal;
+ return TQt::Horizontal;
}
void CppSupportPart::slotNewClass()
@@ -1464,7 +1464,7 @@ bool CppSupportPart::parseProject( bool force )
mainWindow() ->statusBar() ->message( i18n( "Updating..." ) );
- kapp->setOverrideCursor( waitCursor );
+ tdeApp->setOverrideCursor( waitCursor );
_jd = new JobData;
if( TQFileInfo( project() ->projectDirectory() + "/" + project()->projectName().lower()
@@ -1506,7 +1506,7 @@ bool CppSupportPart::parseProject( bool force )
uint offset;
_jd->stream >> fn >> ts >> offset;
- _jd->pcs[ fn ] = tqMakePair( ts, offset );
+ _jd->pcs[ fn ] = qMakePair( ts, offset );
}
}
}
@@ -1526,7 +1526,7 @@ bool CppSupportPart::parseProject( bool force )
_jd->backgroundCount = 0;
_jd->cycle = 0;
- TQTimer::singleShot( 0, this, TQT_SLOT( slotParseFiles() ) );
+ TQTimer::singleShot( 0, this, TQ_SLOT( slotParseFiles() ) );
m_saveMemoryTimer->stop(); //Do not regularly remove cached files that may still be needed while parsing(the cache anyway be full for the whole parsing-process)
return true;
@@ -1583,7 +1583,7 @@ void CppSupportPart::slotParseFiles()
}
++( _jd->it );
- TQTimer::singleShot( 0, this, TQT_SLOT( slotParseFiles() ) );
+ TQTimer::singleShot( 0, this, TQ_SLOT( slotParseFiles() ) );
if( _jd->it == _jd->files.end()) {
if( _jd->reparseList.isEmpty() ) {
@@ -1604,7 +1604,7 @@ void CppSupportPart::slotParseFiles()
_jd->backgroundState = 0;
_jd->cycle = 1;
_jd->lastParse = TQTime::currentTime();
- kapp->restoreOverrideCursor( );
+ tdeApp->restoreOverrideCursor( );
}
}
else // finished or interrupted
@@ -1615,7 +1615,7 @@ void CppSupportPart::slotParseFiles()
if ( !m_projectClosed )
{
kdDebug( 9007 ) << "updating sourceinfo" << endl;
- kapp->restoreOverrideCursor( );
+ tdeApp->restoreOverrideCursor( );
emit updatedSourceInfo();
mainWindow( ) ->statusBar( ) ->message( i18n( "Done" ), 2000 );
TQFile::remove( project() ->projectDirectory()
@@ -1639,11 +1639,11 @@ void CppSupportPart::slotParseFiles()
_jd->progressBar->setTotalSteps( _jd->backgroundCount );
if( _jd->lastParse.msecsTo( TQTime::currentTime()) > 60000 && !m_backgroundParser->filesInQueue()) {
_jd->backgroundCount = _jd->backgroundState; ///Stop waiting if there is no progress and no file in the background-parser
- TQTimer::singleShot( 0, this, TQT_SLOT( slotParseFiles() ) );
+ TQTimer::singleShot( 0, this, TQ_SLOT( slotParseFiles() ) );
} else {
int timeStep = 0;
if( alwaysParseInBackground ) {
- TQTimer::singleShot( 10, this, TQT_SLOT( slotParseFiles() ) );
+ TQTimer::singleShot( 10, this, TQ_SLOT( slotParseFiles() ) );
} else {
if( _jd->it == _jd->reparseList.end() ) {
/*_jd->it = _jd->files.end();
@@ -1659,7 +1659,7 @@ void CppSupportPart::slotParseFiles()
timeStep = 1;
}*/
}
- TQTimer::singleShot( timeStep, this, TQT_SLOT( slotParseFiles() ) );
+ TQTimer::singleShot( timeStep, this, TQ_SLOT( slotParseFiles() ) );
}
}
}
@@ -1699,25 +1699,29 @@ void CppSupportPart::slotNeedTextHint( int line, int column, TQString& textHint
return ;
m_backgroundParser->lock();
- TranslationUnitAST* ast = *m_backgroundParser->translationUnit( m_activeFileName );
- AST* node = 0;
- if ( ast && ( node = findNodeAt( ast, line, column ) ) )
+ ParsedFilePointer pTransUnit = m_backgroundParser->translationUnit(m_activeFileName);
+ if (pTransUnit)
{
+ TranslationUnitAST* ast = *pTransUnit;
+ AST* node = 0;
+ if ( ast && ( node = findNodeAt( ast, line, column ) ) )
+ {
- while ( node && node->nodeType() != NodeType_FunctionDefinition )
- node = node->parent();
+ while ( node && node->nodeType() != NodeType_FunctionDefinition )
+ node = node->parent();
- if ( node )
- {
- int startLine, startColumn;
- int endLine, endColumn;
- node->getStartPosition( &startLine, &startColumn );
- node->getEndPosition( &endLine, &endColumn );
+ if ( node )
+ {
+ int startLine, startColumn;
+ int endLine, endColumn;
+ node->getStartPosition( &startLine, &startColumn );
+ node->getEndPosition( &endLine, &endColumn );
- if ( !node->text().isNull() )
- textHint = node->text();
- else
- textHint = m_activeEditor->textLine( startLine ).simplifyWhiteSpace();
+ if ( !node->text().isNull() )
+ textHint = node->text();
+ else
+ textHint = m_activeEditor->textLine( startLine ).simplifyWhiteSpace();
+ }
}
}
m_backgroundParser->unlock();
@@ -1734,7 +1738,12 @@ void CppSupportPart::MakeMemberHelper( TQString& text, int& atLine, int& atColum
TQString implFile = findSourceFile();
m_backgroundParser->lock();
- TranslationUnitAST* translationUnit = *m_backgroundParser->translationUnit( m_activeFileName );
+ ParsedFilePointer pTranslationUnit = m_backgroundParser->translationUnit( m_activeFileName );
+ TranslationUnitAST *translationUnit = NULL;
+ if (pTranslationUnit)
+ {
+ translationUnit = *pTranslationUnit;
+ }
if ( translationUnit )
{
bool fail = false;
@@ -1826,7 +1835,7 @@ void CppSupportPart::slotMakeMember()
if ( !implFile.isEmpty() )
{
partController() ->editDocument( KURL( implFile ) );
- kapp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers, 500 );
+ tdeApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers, 500 );
}
if ( atLine == -2 )
atLine = m_activeEditor->numLines() - 1;
@@ -2077,9 +2086,9 @@ void CppSupportPart::splitHeaderSourceConfigStored( )
{
TQString o = splitHeaderSourceConfig()->orientation();
if ( o == "Vertical" )
- emit splitOrientationChanged( Qt::Vertical );
+ emit splitOrientationChanged( TQt::Vertical );
else if ( o == "Horizontal" )
- emit splitOrientationChanged( Qt::Horizontal );
+ emit splitOrientationChanged( TQt::Horizontal );
}
void CppSupportPart::removeWithReferences( const TQString & fileName )
@@ -3160,7 +3169,7 @@ void UIBlockTester::UIBlockTesterThread::stop() {
UIBlockTester::UIBlockTester( uint milliseconds ) : m_thread( *this ), m_msecs( milliseconds ) {
m_timer = new TQTimer( this );
m_timer->start( milliseconds/10 );
- connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timer()) );
+ connect( m_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(timer()) );
timer();
m_thread.start();
}
@@ -3181,6 +3190,3 @@ void UIBlockTester::lockup() {
}
#include "cppsupportpart.moc"
-//kate: indent-mode csands; tab-width 4; space-indent off;
-
-