Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
7cf76830
Commit
7cf76830
authored
Sep 23, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark unused symbols.
parent
1d75ebec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
14 deletions
+24
-14
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+13
-8
src/plugins/cppeditor/cppeditor.h
src/plugins/cppeditor/cppeditor.h
+1
-0
src/plugins/texteditor/fontsettingspage.cpp
src/plugins/texteditor/fontsettingspage.cpp
+6
-4
src/plugins/texteditor/texteditorconstants.h
src/plugins/texteditor/texteditorconstants.h
+1
-0
src/plugins/texteditor/texteditorsettings.cpp
src/plugins/texteditor/texteditorsettings.cpp
+3
-2
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
7cf76830
...
...
@@ -949,16 +949,22 @@ void CPPEditor::updateMethodBoxIndex()
static
void
highlightUses
(
QTextDocument
*
doc
,
const
QTextCharFormat
&
format
,
const
QTextCharFormat
&
unusedFormat
,
const
QList
<
SemanticInfo
::
Use
>
&
uses
,
QList
<
QTextEdit
::
ExtraSelection
>
*
selections
)
{
if
(
uses
.
size
()
<=
1
)
return
;
bool
isUnused
=
false
;
if
(
uses
.
size
()
==
1
)
isUnused
=
true
;
foreach
(
const
SemanticInfo
::
Use
&
use
,
uses
)
{
QTextEdit
::
ExtraSelection
sel
;
sel
.
format
=
format
;
if
(
isUnused
)
sel
.
format
=
unusedFormat
;
else
sel
.
format
=
format
;
sel
.
cursor
=
QTextCursor
(
doc
);
const
int
anchor
=
doc
->
findBlockByNumber
(
use
.
line
-
1
).
position
()
+
use
.
column
-
1
;
...
...
@@ -1708,6 +1714,7 @@ void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
highlighter
->
rehighlight
();
m_occurrencesFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_OCCURRENCES
));
m_occurrencesUnusedFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_OCCURRENCES_UNUSED
));
m_occurrenceRenameFormat
=
fs
.
toTextCharFormat
(
QLatin1String
(
TextEditor
::
Constants
::
C_OCCURRENCES_RENAME
));
}
...
...
@@ -1786,11 +1793,9 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
}
}
if
(
!
good
)
continue
;
highlightUses
(
document
(),
m_occurrencesFormat
,
uses
,
&
selections
);
break
;
// done
if
(
uses
.
size
()
==
1
||
good
)
highlightUses
(
document
(),
m_occurrencesFormat
,
m_occurrencesUnusedFormat
,
uses
,
&
selections
);
}
setExtraSelections
(
CodeSemanticsSelection
,
selections
);
...
...
src/plugins/cppeditor/cppeditor.h
View file @
7cf76830
...
...
@@ -281,6 +281,7 @@ private:
QTimer
*
m_updateMethodBoxTimer
;
QTimer
*
m_updateUsesTimer
;
QTextCharFormat
m_occurrencesFormat
;
QTextCharFormat
m_occurrencesUnusedFormat
;
QTextCharFormat
m_occurrenceRenameFormat
;
QList
<
QTextEdit
::
ExtraSelection
>
m_renameSelections
;
...
...
src/plugins/texteditor/fontsettingspage.cpp
View file @
7cf76830
...
...
@@ -251,6 +251,8 @@ QColor FormatDescription::foreground() const
}
else
{
return
m_format
.
foreground
();
}
}
else
if
(
m_name
==
QLatin1String
(
Constants
::
C_OCCURRENCES_UNUSED
))
{
return
Qt
::
lightGray
;
}
else
if
(
m_name
==
QLatin1String
(
Constants
::
C_PARENTHESES
))
{
return
QColor
(
Qt
::
red
);
}
...
...
@@ -596,11 +598,11 @@ void FontSettingsPage::apply()
void
FontSettingsPage
::
saveSettings
()
{
if
(
d_ptr
->
m_value
!=
d_ptr
->
m_lastValue
)
{
d_ptr
->
m_lastValue
=
d_ptr
->
m_value
;
if
(
QSettings
*
settings
=
Core
::
ICore
::
instance
()
->
settings
())
d_ptr
->
m_value
.
toSettings
(
d_ptr
->
m_settingsGroup
,
settings
);
d_ptr
->
m_lastValue
=
d_ptr
->
m_value
;
if
(
QSettings
*
settings
=
Core
::
ICore
::
instance
()
->
settings
())
d_ptr
->
m_value
.
toSettings
(
d_ptr
->
m_settingsGroup
,
settings
);
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
delayedChange
()));
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
delayedChange
()));
}
}
...
...
src/plugins/texteditor/texteditorconstants.h
View file @
7cf76830
...
...
@@ -80,6 +80,7 @@ const char * const C_PARENTHESES = "Parentheses";
const
char
*
const
C_CURRENT_LINE
=
"CurrentLine"
;
const
char
*
const
C_CURRENT_LINE_NUMBER
=
"CurrentLineNumber"
;
const
char
*
const
C_OCCURRENCES
=
"Occurrences"
;
const
char
*
const
C_OCCURRENCES_UNUSED
=
"Occurrences.Unused"
;
const
char
*
const
C_OCCURRENCES_RENAME
=
"Occurrences.Rename"
;
const
char
*
const
C_NUMBER
=
"Number"
;
...
...
src/plugins/texteditor/texteditorsettings.cpp
View file @
7cf76830
...
...
@@ -78,6 +78,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescriptions
.
append
(
currentLineNumber
);
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_OCCURRENCES
),
tr
(
"Occurrences"
)));
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_OCCURRENCES_UNUSED
),
tr
(
"Unused Occurrence"
)));
formatDescriptions
.
append
(
FormatDescription
(
QLatin1String
(
C_OCCURRENCES_RENAME
),
tr
(
"Renaming Occurrence"
)));
// Standard categories
...
...
@@ -155,7 +156,7 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
{
// Connect to settings change signals
connect
(
this
,
SIGNAL
(
fontSettingsChanged
(
TextEditor
::
FontSettings
)),
editor
,
SLOT
(
setFontSettingsIfVisible
(
TextEditor
::
FontSettings
)));
editor
,
SLOT
(
setFontSettingsIfVisible
(
TextEditor
::
FontSettings
)));
connect
(
this
,
SIGNAL
(
tabSettingsChanged
(
TextEditor
::
TabSettings
)),
editor
,
SLOT
(
setTabSettings
(
TextEditor
::
TabSettings
)));
connect
(
this
,
SIGNAL
(
storageSettingsChanged
(
TextEditor
::
StorageSettings
)),
...
...
@@ -164,7 +165,7 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
editor
,
SLOT
(
setDisplaySettings
(
TextEditor
::
DisplaySettings
)));
connect
(
editor
,
SIGNAL
(
requestFontSize
(
int
)),
this
,
SLOT
(
fontSizeRequested
(
int
)));
this
,
SLOT
(
fontSizeRequested
(
int
)));
// Apply current settings (tab settings depend on font settings)
editor
->
setFontSettings
(
fontSettings
());
...
...
Write
Preview
Markdown
is supported
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