Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
6d0f973f
Commit
6d0f973f
authored
Apr 07, 2009
by
Thorbjørn Lindeijer
Browse files
Better name for method to pick the completion collector
isValid -> supportsEditor
parent
607f622c
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
6d0f973f
...
...
@@ -508,14 +508,11 @@ static int startOfOperator(TextEditor::ITextEditable *editor,
return
start
;
}
bool
CppCodeCompletion
::
isValid
(
TextEditor
::
ITextEditable
*
editor
)
bool
CppCodeCompletion
::
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
)
{
return
m_manager
->
isCppEditor
(
editor
);
}
bool
CppCodeCompletion
::
triggersCompletion
(
TextEditor
::
ITextEditable
*
editor
)
{
if
(
!
m_manager
->
isCppEditor
(
editor
))
// ### remove me
return
false
;
const
int
pos
=
editor
->
position
();
if
(
startOfOperator
(
editor
,
pos
,
/*token =*/
0
,
/*want function call=*/
true
)
!=
pos
)
...
...
src/plugins/cpptools/cppcodecompletion.h
View file @
6d0f973f
...
...
@@ -58,7 +58,7 @@ class CppCodeCompletion : public TextEditor::ICompletionCollector
public:
explicit
CppCodeCompletion
(
CppModelManager
*
manager
);
bool
isValid
(
TextEditor
::
ITextEditable
*
editor
);
bool
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
);
bool
triggersCompletion
(
TextEditor
::
ITextEditable
*
editor
);
int
startCompletion
(
TextEditor
::
ITextEditable
*
editor
);
void
completions
(
QList
<
TextEditor
::
CompletionItem
>
*
completions
);
...
...
src/plugins/find/searchresultwindow.h
View file @
6d0f973f
...
...
@@ -84,7 +84,7 @@ public slots:
private
slots
:
void
handleExpandCollapseToolButton
(
bool
checked
);
void
handleJumpToSearchResult
(
int
index
,
const
QString
&
fileName
,
int
lineNumber
,
int
searchTermStart
,
int
searchTermLength
);
int
searchTermStart
,
int
searchTermLength
);
private:
void
readSettings
();
...
...
src/plugins/qtscripteditor/qtscriptcodecompletion.cpp
View file @
6d0f973f
...
...
@@ -22,7 +22,7 @@ Qt::CaseSensitivity QtScriptCodeCompletion::caseSensitivity() const
void
QtScriptCodeCompletion
::
setCaseSensitivity
(
Qt
::
CaseSensitivity
caseSensitivity
)
{
m_caseSensitivity
=
caseSensitivity
;
}
bool
QtScriptCodeCompletion
::
isValid
(
TextEditor
::
ITextEditable
*
editor
)
bool
QtScriptCodeCompletion
::
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
)
{
if
(
qobject_cast
<
ScriptEditor
*>
(
editor
->
widget
()))
return
true
;
...
...
src/plugins/qtscripteditor/qtscriptcodecompletion.h
View file @
6d0f973f
...
...
@@ -21,7 +21,7 @@ public:
Qt
::
CaseSensitivity
caseSensitivity
()
const
;
void
setCaseSensitivity
(
Qt
::
CaseSensitivity
caseSensitivity
);
virtual
bool
isValid
(
TextEditor
::
ITextEditable
*
editor
);
virtual
bool
supportsEditor
(
TextEditor
::
ITextEditable
*
editor
);
virtual
bool
triggersCompletion
(
TextEditor
::
ITextEditable
*
editor
);
virtual
int
startCompletion
(
TextEditor
::
ITextEditable
*
editor
);
virtual
void
completions
(
QList
<
TextEditor
::
CompletionItem
>
*
completions
);
...
...
src/plugins/texteditor/completionsupport.cpp
View file @
6d0f973f
...
...
@@ -94,7 +94,7 @@ void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
m_completionCollector
=
0
;
foreach
(
ICompletionCollector
*
collector
,
m_completionCollectors
)
{
if
(
collector
->
isValid
(
editor
))
{
if
(
collector
->
supportsEditor
(
editor
))
{
m_completionCollector
=
collector
;
break
;
}
...
...
src/plugins/texteditor/icompletioncollector.h
View file @
6d0f973f
...
...
@@ -80,7 +80,7 @@ public:
/*
* Returns true if this completion collector can be used with the given editor.
*/
virtual
bool
isValid
(
ITextEditable
*
editor
)
=
0
;
virtual
bool
supportsEditor
(
ITextEditable
*
editor
)
=
0
;
/* This method should return whether the cursor is at a position which could
* trigger an autocomplete. It will be called each time a character is typed in
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment