Skip to content
GitLab
Menu
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
1969b2eb
Commit
1969b2eb
authored
Jan 28, 2009
by
hjk
Browse files
Fixes: some less caching of the ICore singleton pointer
parent
615660c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
1969b2eb
...
...
@@ -74,9 +74,10 @@ using namespace CPlusPlus;
namespace
CppTools
{
namespace
Internal
{
class
FunctionArgumentWidget
:
public
QLabel
{
class
FunctionArgumentWidget
:
public
QLabel
{
public:
FunctionArgumentWidget
(
Core
::
ICore
*
core
);
FunctionArgumentWidget
();
void
showFunctionHint
(
Function
*
functionSymbol
,
const
Snapshot
&
snapshot
);
protected:
...
...
@@ -183,10 +184,10 @@ protected:
using
namespace
CppTools
::
Internal
;
FunctionArgumentWidget
::
FunctionArgumentWidget
(
Core
::
ICore
*
core
)
FunctionArgumentWidget
::
FunctionArgumentWidget
()
:
m_item
(
0
)
{
QObject
*
editorObject
=
core
->
editorManager
()
->
currentEditor
();
QObject
*
editorObject
=
Core
::
ICore
::
instance
()
->
editorManager
()
->
currentEditor
();
m_editor
=
qobject_cast
<
TextEditor
::
ITextEditor
*>
(
editorObject
);
m_popupFrame
=
new
QFrame
(
0
,
Qt
::
ToolTip
|
Qt
::
WindowStaysOnTopHint
);
...
...
@@ -311,9 +312,8 @@ void FunctionArgumentWidget::updateHintText()
setText
(
text
);
}
CppCodeCompletion
::
CppCodeCompletion
(
CppModelManager
*
manager
,
Core
::
ICore
*
core
)
CppCodeCompletion
::
CppCodeCompletion
(
CppModelManager
*
manager
)
:
ICompletionCollector
(
manager
),
m_core
(
core
),
m_manager
(
manager
),
m_caseSensitivity
(
Qt
::
CaseSensitive
),
m_autoInsertBraces
(
true
),
...
...
@@ -1030,7 +1030,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
Function
*
function
=
symbol
->
type
()
->
asFunction
();
QTC_ASSERT
(
function
,
return
);
m_functionArgumentWidget
=
new
FunctionArgumentWidget
(
m_core
);
m_functionArgumentWidget
=
new
FunctionArgumentWidget
();
m_functionArgumentWidget
->
showFunctionHint
(
function
,
typeOfExpression
.
snapshot
());
}
}
else
if
(
m_completionOperator
==
T_SIGNAL
||
m_completionOperator
==
T_SLOT
)
{
...
...
src/plugins/cpptools/cppcodecompletion.h
View file @
1969b2eb
...
...
@@ -34,23 +34,17 @@
#ifndef CPPCODECOMPLETION_H
#define CPPCODECOMPLETION_H
// C++ front-end
#include <ASTfwd.h>
#include <FullySpecifiedType.h>
#include <cplusplus/Icons.h>
#include <cplusplus/Overview.h>
#include <cplusplus/TypeOfExpression.h>
// Qt Creator
#include <texteditor/icompletioncollector.h>
// Qt
#include <QtCore/QObject>
#include <QtCore/QPointer>
namespace
Core
{
class
ICore
;
}
namespace
TextEditor
{
class
ITextEditor
;
...
...
@@ -66,7 +60,7 @@ class CppCodeCompletion : public TextEditor::ICompletionCollector
{
Q_OBJECT
public:
CppCodeCompletion
(
CppModelManager
*
manager
,
Core
::
ICore
*
core
);
explicit
CppCodeCompletion
(
CppModelManager
*
manager
);
bool
triggersCompletion
(
TextEditor
::
ITextEditable
*
editor
);
int
startCompletion
(
TextEditor
::
ITextEditable
*
editor
);
...
...
@@ -131,7 +125,6 @@ private:
TextEditor
::
ITextEditable
*
m_editor
;
int
m_startPosition
;
// Position of the cursor from which completion started
Core
::
ICore
*
m_core
;
CppModelManager
*
m_manager
;
Qt
::
CaseSensitivity
m_caseSensitivity
;
bool
m_autoInsertBraces
;
...
...
src/plugins/cpptools/cpptoolsplugin.cpp
View file @
1969b2eb
...
...
@@ -87,7 +87,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
// Objects
m_modelManager
=
new
CppModelManager
(
this
);
addAutoReleasedObject
(
m_modelManager
);
m_completion
=
new
CppCodeCompletion
(
m_modelManager
,
core
);
m_completion
=
new
CppCodeCompletion
(
m_modelManager
);
addAutoReleasedObject
(
m_completion
);
CppQuickOpenFilter
*
quickOpenFilter
=
new
CppQuickOpenFilter
(
m_modelManager
,
core
->
editorManager
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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