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
e7b96347
Commit
e7b96347
authored
Sep 24, 2009
by
Roberto Raggi
Browse files
Revert "Introduced our own document revision."
This reverts commit
6b510cb4
.
parent
7d72996f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
e7b96347
...
...
@@ -538,8 +538,6 @@ CPPEditor::CPPEditor(QWidget *parent)
{
qRegisterMetaType
<
SemanticInfo
>
(
"SemanticInfo"
);
m_revision
=
0
;
m_semanticHighlighter
=
new
SemanticHighlighter
(
this
);
m_semanticHighlighter
->
start
();
...
...
@@ -902,8 +900,6 @@ void CPPEditor::onContentsChanged(int position, int charsRemoved, int charsAdded
Q_UNUSED
(
position
)
Q_UNUSED
(
charsAdded
)
++
m_revision
;
if
(
m_currentRenameSelection
==
-
1
)
return
;
...
...
@@ -1311,11 +1307,6 @@ Symbol *CPPEditor::findDefinition(Symbol *symbol)
return
0
;
}
unsigned
CPPEditor
::
revision
()
const
{
return
m_revision
;
}
SemanticInfo
CPPEditor
::
semanticInfo
()
const
{
return
m_lastSemanticInfo
;
...
...
@@ -1780,7 +1771,7 @@ void CPPEditor::semanticRehighlight()
void
CPPEditor
::
updateSemanticInfo
(
const
SemanticInfo
&
semanticInfo
)
{
if
(
semanticInfo
.
revision
!=
m_
revision
)
{
if
(
semanticInfo
.
revision
!=
document
()
->
revision
()
)
{
// got outdated semantic info
semanticRehighlight
();
return
;
...
...
@@ -1824,10 +1815,10 @@ SemanticHighlighter::Source CPPEditor::currentSource()
const
QString
fileName
=
file
()
->
fileName
();
QString
code
;
if
(
m_lastSemanticInfo
.
revision
!=
m_
revision
)
if
(
m_lastSemanticInfo
.
revision
!=
document
()
->
revision
()
)
code
=
toPlainText
();
// get the source code only when needed.
const
int
revision
=
m_
revision
;
const
int
revision
=
document
()
->
revision
()
;
const
SemanticHighlighter
::
Source
source
(
snapshot
,
fileName
,
code
,
line
,
column
,
revision
);
return
source
;
...
...
src/plugins/cppeditor/cppeditor.h
View file @
e7b96347
...
...
@@ -71,10 +71,10 @@ public:
unsigned
length
;
Use
()
:
line
(
0
),
column
(
0
),
length
(
0
)
{}
:
line
(
0
),
column
(
0
),
length
(
0
)
{}
Use
(
unsigned
line
,
unsigned
column
,
unsigned
length
)
:
line
(
line
),
column
(
column
),
length
(
length
)
{}
:
line
(
line
),
column
(
column
),
length
(
length
)
{}
};
typedef
QHash
<
CPlusPlus
::
Symbol
*
,
QList
<
Use
>
>
LocalUseMap
;
...
...
@@ -84,10 +84,10 @@ public:
typedef
QHashIterator
<
CPlusPlus
::
Identifier
*
,
QList
<
Use
>
>
ExternalUseIterator
;
SemanticInfo
()
:
revision
(
0
)
:
revision
(
-
1
)
{
}
unsigned
revision
;
int
revision
;
CPlusPlus
::
Snapshot
snapshot
;
CPlusPlus
::
Document
::
Ptr
doc
;
LocalUseMap
localUses
;
...
...
@@ -114,7 +114,7 @@ public:
int
revision
;
Source
()
:
line
(
0
),
column
(
0
),
revision
(
0
)
:
line
(
0
),
column
(
0
),
revision
(
0
)
{
}
Source
(
const
CPlusPlus
::
Snapshot
&
snapshot
,
...
...
@@ -190,7 +190,6 @@ public:
void
indentInsertedText
(
const
QTextCursor
&
tc
);
SemanticInfo
semanticInfo
()
const
;
unsigned
revision
()
const
;
public
Q_SLOTS
:
virtual
void
setFontSettings
(
const
TextEditor
::
FontSettings
&
);
...
...
@@ -296,8 +295,6 @@ private:
SemanticHighlighter
*
m_semanticHighlighter
;
SemanticInfo
m_lastSemanticInfo
;
unsigned
m_revision
;
};
...
...
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