[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdevelop/languages/cpp
From: Adam Treat <manyoso () yahoo ! com>
Date: 2005-03-10 1:37:25
Message-ID: 20050310013725.959EE10B25 () office ! kde ! org
[Download RAW message or body]
CVS commit by treat:
* Tell the completion box to _go_away_ when the completion char
becomes empty or whitespace and the box is already showing.
!!WARNING!! This is very hackish, but KTE doesn't offer a way
to tell the completion box to _go_away_
M +24 -8 cppcodecompletion.cpp 1.157
M +2 -2 cppcodecompletion.h 1.51
--- kdevelop/languages/cpp/cppcodecompletion.cpp #1.156:1.157
@@ -346,13 +346,13 @@ void CppCodeCompletion::slotTimeout()
}
-void CppCodeCompletion::slotArgHintHided( )
+void CppCodeCompletion::slotArgHintHidden()
{
- //kdDebug(9007) << "CppCodeCompletion::slotArgHintHided()" << endl;
+ //kdDebug(9007) << "CppCodeCompletion::slotArgHintHidden()" << endl;
m_bArgHintShow = false;
}
-void CppCodeCompletion::slotCompletionBoxHided( KTextEditor::CompletionEntry entry )
+void CppCodeCompletion::slotCompletionBoxHidden()
{
- Q_UNUSED( entry );
+ //kdDebug( 9007 ) << "CppCodeCompletion::slotCompletionBoxHidden()" << endl;
m_bCompletionBoxShow = false;
}
@@ -372,8 +372,10 @@ void CppCodeCompletion::integratePart( K
kdDebug( 9007 ) << k_funcinfo << "enabling code completion" \
<< endl;
connect( part, SIGNAL( textChanged() ), this, SLOT( \
slotTextChanged() ) );
- connect( part->widget(), SIGNAL( completionDone( \
KTextEditor::CompletionEntry ) ), this,
- SLOT( slotCompletionBoxHided( \
KTextEditor::CompletionEntry ) ) ); + connect( part->widget(), \
SIGNAL( completionDone() ), this, + SLOT( \
slotCompletionBoxHidden() ) ); + connect( part->widget(), \
SIGNAL( completionAborted() ), this, + SLOT( \
slotCompletionBoxHidden() ) );
connect( part->widget(), SIGNAL( argHintHidden() ), this,
- SLOT( slotArgHintHided() ) );
+ SLOT( slotArgHintHidden() ) );
}
@@ -440,4 +442,15 @@ void CppCodeCompletion::slotTextChanged(
QString ch2 = strCurLine.mid( nCol - 2, 2 );
+ // Tell the completion box to _go_away_ when the completion char
+ // becomes empty or whitespace and the box is already showing.
+ // !!WARNING!! This is very hackish, but KTE doesn't offer a way
+ // to tell the completion box to _go_away_
+ if ( ch.simplifyWhiteSpace().isEmpty() && m_bCompletionBoxShow )
+ {
+ QValueList<KTextEditor::CompletionEntry> entryList;
+ m_bCompletionBoxShow = true;
+ m_activeCompletion->showCompletionBox( entryList, 0 );
+ }
+
m_ccLine = 0;
m_ccColumn = 0;
@@ -821,4 +834,5 @@ void CppCodeCompletion::completeText( )
if ( !m_fileEntryList.isEmpty() )
{
+ m_bCompletionBoxShow = true;
m_activeCompletion->showCompletionBox( m_fileEntryList, \
column - m_includeRx.matchedLength() ); }
@@ -1176,4 +1190,5 @@ void CppCodeCompletion::completeText( )
qHeapSort( entryList );
+ m_bCompletionBoxShow = true;
m_activeCompletion->showCompletionBox( entryList, \
word.length() ); }
@@ -1207,4 +1222,5 @@ void CppCodeCompletion::completeText( )
signatureList = unique( signatureList );
qHeapSort( signatureList );
+ m_bArgHintShow = true;
m_activeCompletion->showArgHint( signatureList, "()", "," );
}
--- kdevelop/languages/cpp/cppcodecompletion.h #1.50:1.51
@@ -78,6 +78,6 @@ private slots:
void slotPartAdded( KParts::Part *part );
void slotActivePartChanged( KParts::Part *part );
- void slotArgHintHided();
- void slotCompletionBoxHided( KTextEditor::CompletionEntry entry );
+ void slotArgHintHidden();
+ void slotCompletionBoxHidden();
void slotTextChanged();
void slotFileParsed( const QString& fileName );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic