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
33650ac9
Commit
33650ac9
authored
Sep 07, 2010
by
Roberto Raggi
Browse files
Reuse the strings
parent
444e2fd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cpplocatorfilter.cpp
View file @
33650ac9
...
...
@@ -129,3 +129,11 @@ void CppLocatorFilter::accept(Locator::FilterEntry selection) const
ModelItemInfo
info
=
qvariant_cast
<
CppTools
::
Internal
::
ModelItemInfo
>
(
selection
.
internalData
);
TextEditor
::
BaseTextEditor
::
openEditorAt
(
info
.
fileName
,
info
.
line
,
info
.
column
);
}
void
CppLocatorFilter
::
reset
()
{
m_searchList
.
clear
();
m_previousResults
.
clear
();
m_previousEntry
.
clear
();
m_forceNewSearchList
=
true
;
}
src/plugins/cpptools/cpplocatorfilter.h
View file @
33650ac9
...
...
@@ -52,6 +52,8 @@ public:
void
accept
(
Locator
::
FilterEntry
selection
)
const
;
void
refresh
(
QFutureInterface
<
void
>
&
future
);
void
reset
();
protected:
SearchSymbols
search
;
...
...
@@ -64,8 +66,8 @@ private:
QHash
<
QString
,
QList
<
ModelItemInfo
>
>
m_searchList
;
QList
<
ModelItemInfo
>
m_previousResults
;
bool
m_forceNewSearchList
;
QString
m_previousEntry
;
bool
m_forceNewSearchList
;
};
}
// namespace Internal
...
...
src/plugins/cpptools/searchsymbols.cpp
View file @
33650ac9
...
...
@@ -33,6 +33,7 @@
#include <Scope.h>
#include <Names.h>
#include <cplusplus/LookupContext.h>
#include <QDebug>
using
namespace
CPlusPlus
;
using
namespace
CppTools
::
Internal
;
...
...
@@ -67,8 +68,11 @@ QList<ModelItemInfo> SearchSymbols::operator()(Document::Ptr doc, const QString
accept
(
doc
->
globalSymbolAt
(
i
));
}
(
void
)
switchScope
(
previousScope
);
QList
<
ModelItemInfo
>
result
=
items
;
strings
.
clear
();
return
items
;
items
.
clear
();
m_paths
.
clear
();
return
result
;
}
QString
SearchSymbols
::
switchScope
(
const
QString
&
scope
)
...
...
@@ -124,7 +128,7 @@ bool SearchSymbols::visit(Function *symbol)
bool
SearchSymbols
::
visit
(
Namespace
*
symbol
)
{
QString
name
=
findOrInsert
(
scopedSymbolName
(
symbol
)
)
;
QString
name
=
scopedSymbolName
(
symbol
);
QString
previousScope
=
switchScope
(
name
);
for
(
unsigned
i
=
0
;
i
<
symbol
->
memberCount
();
++
i
)
{
accept
(
symbol
->
memberAt
(
i
));
...
...
@@ -216,7 +220,7 @@ void SearchSymbols::appendItem(const QString &name,
QStringList
fullyQualifiedName
;
foreach
(
const
Name
*
name
,
LookupContext
::
fullyQualifiedName
(
symbol
))
fullyQualifiedName
.
append
(
overview
.
prettyName
(
name
));
fullyQualifiedName
.
append
(
findOrInsert
(
overview
.
prettyName
(
name
))
)
;
QString
path
=
m_paths
.
value
(
symbol
->
fileId
(),
QString
());
if
(
path
.
isEmpty
())
{
...
...
@@ -225,7 +229,7 @@ void SearchSymbols::appendItem(const QString &name,
}
const
QIcon
icon
=
icons
.
iconForSymbol
(
symbol
);
items
.
append
(
ModelItemInfo
(
name
,
info
,
type
,
items
.
append
(
ModelItemInfo
(
findOrInsert
(
name
)
,
findOrInsert
(
info
)
,
type
,
fullyQualifiedName
,
path
,
symbol
->
line
(),
...
...
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