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
Tobias Hunger
qt-creator
Commits
bdb4e48e
Commit
bdb4e48e
authored
Dec 07, 2009
by
Roberto Raggi
Browse files
Store the working list in a QHash.
parent
0614e19d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppfindreferences.cpp
View file @
bdb4e48e
...
...
@@ -68,12 +68,12 @@ namespace {
class
ProcessFile
:
public
std
::
unary_function
<
QString
,
QList
<
Usage
>
>
{
const
Q
Map
<
QString
,
QString
>
workingList
;
const
Q
Hash
<
QString
,
QString
>
workingList
;
const
Snapshot
snapshot
;
Symbol
*
symbol
;
public:
ProcessFile
(
const
Q
Map
<
QString
,
QString
>
workingList
,
ProcessFile
(
const
Q
Hash
<
QString
,
QString
>
workingList
,
const
Snapshot
snapshot
,
Symbol
*
symbol
)
:
workingList
(
workingList
),
snapshot
(
snapshot
),
symbol
(
symbol
)
...
...
@@ -168,7 +168,7 @@ QList<int> CppFindReferences::references(Symbol *symbol,
}
static
void
find_helper
(
QFutureInterface
<
Usage
>
&
future
,
const
Q
Map
<
QString
,
QString
>
w
l
,
const
Q
Hash
<
QString
,
QString
>
w
orkingList
,
Snapshot
snapshot
,
Symbol
*
symbol
)
{
...
...
@@ -199,7 +199,7 @@ static void find_helper(QFutureInterface<Usage> &future,
future
.
setProgressRange
(
0
,
files
.
size
());
ProcessFile
process
(
w
l
,
snapshot
,
symbol
);
ProcessFile
process
(
w
orkingList
,
snapshot
,
symbol
);
UpdateUI
reduce
(
&
future
);
QtConcurrent
::
blockingMappedReduced
<
QList
<
Usage
>
>
(
files
,
process
,
reduce
);
...
...
@@ -243,7 +243,7 @@ void CppFindReferences::findAll_helper(Symbol *symbol)
_resultWindow
->
popup
(
true
);
const
Snapshot
snapshot
=
_modelManager
->
snapshot
();
const
Q
Map
<
QString
,
QString
>
wl
=
_modelManager
->
workingCopy
();
const
Q
Hash
<
QString
,
QString
>
wl
=
_modelManager
->
workingCopy
();
Core
::
ProgressManager
*
progressManager
=
Core
::
ICore
::
instance
()
->
progressManager
();
...
...
src/plugins/cpptools/cppmodelmanager.cpp
View file @
bdb4e48e
...
...
@@ -172,7 +172,7 @@ public:
virtual
~
CppPreprocessor
();
void
setRevision
(
unsigned
revision
);
void
setWorkingCopy
(
const
Q
Map
<
QString
,
QString
>
&
workingCopy
);
void
setWorkingCopy
(
const
Q
Hash
<
QString
,
QString
>
&
workingCopy
);
void
setIncludePaths
(
const
QStringList
&
includePaths
);
void
setFrameworkPaths
(
const
QStringList
&
frameworkPaths
);
void
setProjectFiles
(
const
QStringList
&
files
);
...
...
@@ -216,7 +216,7 @@ private:
Preprocessor
preprocess
;
QStringList
m_includePaths
;
QStringList
m_systemIncludePaths
;
Q
Map
<
QString
,
QString
>
m_workingCopy
;
Q
Hash
<
QString
,
QString
>
m_workingCopy
;
QStringList
m_projectFiles
;
QStringList
m_frameworkPaths
;
QSet
<
QString
>
m_included
;
...
...
@@ -242,7 +242,7 @@ CppPreprocessor::~CppPreprocessor()
void
CppPreprocessor
::
setRevision
(
unsigned
revision
)
{
m_revision
=
revision
;
}
void
CppPreprocessor
::
setWorkingCopy
(
const
Q
Map
<
QString
,
QString
>
&
workingCopy
)
void
CppPreprocessor
::
setWorkingCopy
(
const
Q
Hash
<
QString
,
QString
>
&
workingCopy
)
{
m_workingCopy
=
workingCopy
;
}
void
CppPreprocessor
::
setIncludePaths
(
const
QStringList
&
includePaths
)
...
...
@@ -264,13 +264,13 @@ class Process: public std::unary_function<Document::Ptr, void>
{
QPointer
<
CppModelManager
>
_modelManager
;
Snapshot
_snapshot
;
Q
Map
<
QString
,
QString
>
_workingCopy
;
Q
Hash
<
QString
,
QString
>
_workingCopy
;
Document
::
Ptr
_doc
;
public:
Process
(
QPointer
<
CppModelManager
>
modelManager
,
Snapshot
snapshot
,
const
Q
Map
<
QString
,
QString
>
&
workingCopy
)
const
Q
Hash
<
QString
,
QString
>
&
workingCopy
)
:
_modelManager
(
modelManager
),
_snapshot
(
snapshot
),
_workingCopy
(
workingCopy
)
...
...
@@ -789,9 +789,9 @@ void CppModelManager::renameUsages(CPlusPlus::Symbol *symbol)
m_findReferences
->
renameUsages
(
symbol
);
}
Q
Map
<
QString
,
QString
>
CppModelManager
::
buildWorkingCopyList
()
Q
Hash
<
QString
,
QString
>
CppModelManager
::
buildWorkingCopyList
()
{
Q
Map
<
QString
,
QString
>
workingCopy
;
Q
Hash
<
QString
,
QString
>
workingCopy
;
QMapIterator
<
TextEditor
::
ITextEditor
*
,
CppEditorSupport
*>
it
(
m_editorSupport
);
while
(
it
.
hasNext
())
{
it
.
next
();
...
...
@@ -815,7 +815,7 @@ QMap<QString, QString> CppModelManager::buildWorkingCopyList()
return
workingCopy
;
}
Q
Map
<
QString
,
QString
>
CppModelManager
::
workingCopy
()
const
Q
Hash
<
QString
,
QString
>
CppModelManager
::
workingCopy
()
const
{
return
const_cast
<
CppModelManager
*>
(
this
)
->
buildWorkingCopyList
();
}
...
...
@@ -870,7 +870,7 @@ QStringList CppModelManager::includesInPath(const QString &path) const
QFuture
<
void
>
CppModelManager
::
refreshSourceFiles
(
const
QStringList
&
sourceFiles
)
{
if
(
!
sourceFiles
.
isEmpty
()
&&
m_indexerEnabled
)
{
const
Q
Map
<
QString
,
QString
>
workingCopy
=
buildWorkingCopyList
();
const
Q
Hash
<
QString
,
QString
>
workingCopy
=
buildWorkingCopyList
();
CppPreprocessor
*
preproc
=
new
CppPreprocessor
(
this
);
preproc
->
setRevision
(
++
m_revision
);
...
...
src/plugins/cpptools/cppmodelmanager.h
View file @
bdb4e48e
...
...
@@ -36,12 +36,12 @@
#include <texteditor/basetexteditor.h>
#include <Q
Map
>
#include <QFutureInterface>
#include <QFutureSynchronizer>
#include <QMutex>
#include <QTimer>
#include <QTextEdit>
#include <Q
tCore/QHash
>
#include <
QtCore/
QFutureInterface>
#include <
QtCore/
QFutureSynchronizer>
#include <
QtCore/
QMutex>
#include <
QtCore/
QTimer>
#include <
QtGui/
QTextEdit>
// for QTextEdit::ExtraSelection
namespace
Core
{
class
ICore
;
...
...
@@ -73,7 +73,7 @@ public:
virtual
~
CppModelManager
();
virtual
void
updateSourceFiles
(
const
QStringList
&
sourceFiles
);
virtual
Q
Map
<
QString
,
QString
>
workingCopy
()
const
;
virtual
Q
Hash
<
QString
,
QString
>
workingCopy
()
const
;
virtual
QList
<
ProjectInfo
>
projectInfos
()
const
;
virtual
ProjectInfo
projectInfo
(
ProjectExplorer
::
Project
*
project
)
const
;
...
...
@@ -131,7 +131,7 @@ private Q_SLOTS:
void
updateEditorSelections
();
private:
Q
Map
<
QString
,
QString
>
buildWorkingCopyList
();
Q
Hash
<
QString
,
QString
>
buildWorkingCopyList
();
QStringList
projectFiles
()
{
...
...
src/plugins/cpptools/cppmodelmanagerinterface.h
View file @
bdb4e48e
...
...
@@ -33,7 +33,7 @@
#include <cpptools/cpptools_global.h>
#include <cplusplus/CppDocument.h>
#include <QtCore/QObject>
#include <QtCore/Q
Map
>
#include <QtCore/Q
Hash
>
#include <QtCore/QPointer>
#include <QtCore/QStringList>
...
...
@@ -84,7 +84,7 @@ public:
static
CppModelManagerInterface
*
instance
();
virtual
Q
Map
<
QString
,
QString
>
workingCopy
()
const
=
0
;
virtual
Q
Hash
<
QString
,
QString
>
workingCopy
()
const
=
0
;
virtual
CPlusPlus
::
Snapshot
snapshot
()
const
=
0
;
virtual
QList
<
ProjectInfo
>
projectInfos
()
const
=
0
;
...
...
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