Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ed97c785
Commit
ed97c785
authored
Mar 06, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the blockingMap, but continue to parse the collected documents in parallel.
parent
215d102a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+7
-21
No files found.
src/plugins/cpptools/cppmodelmanager.cpp
View file @
ed97c785
...
...
@@ -33,7 +33,10 @@
#include "cpptoolsconstants.h"
#include "cpptoolseditorsupport.h"
#include <functional>
#include <QtConcurrentRun>
#include <qtconcurrent/runextensions.h>
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
...
...
@@ -171,8 +174,6 @@ public:
void
resetEnvironment
();
void
parseCollectedDocuments
();
const
QSet
<
QString
>
&
todo
()
const
{
return
m_todo
;
}
...
...
@@ -211,7 +212,6 @@ private:
QSet
<
QString
>
m_included
;
Document
::
Ptr
m_currentDoc
;
QSet
<
QString
>
m_todo
;
QList
<
Document
::
Ptr
>
m_documents
;
};
}
// namespace Internal
...
...
@@ -241,7 +241,7 @@ void CppPreprocessor::setTodo(const QStringList &files)
namespace
{
class
Process
class
Process
:
public
std
::
unary_function
<
Document
::
Ptr
,
void
>
{
QPointer
<
CppModelManager
>
_modelManager
;
...
...
@@ -250,7 +250,7 @@ public:
:
_modelManager
(
modelManager
)
{
}
void
operator
()(
Document
::
Ptr
doc
)
void
operator
()(
Document
::
Ptr
doc
)
const
{
doc
->
parse
();
doc
->
check
();
...
...
@@ -267,22 +267,11 @@ void CppPreprocessor::run(const QString &fileName)
{
QString
absoluteFilePath
=
fileName
;
sourceNeeded
(
absoluteFilePath
,
IncludeGlobal
,
/*line = */
0
);
if
(
m_documents
.
size
()
>=
8
)
parseCollectedDocuments
();
}
void
CppPreprocessor
::
resetEnvironment
()
{
env
.
reset
();
}
void
CppPreprocessor
::
parseCollectedDocuments
()
{
QThread
::
currentThread
()
->
setPriority
(
QThread
::
IdlePriority
);
QtConcurrent
::
blockingMap
(
m_documents
,
Process
(
m_modelManager
));
QThread
::
currentThread
()
->
setPriority
(
QThread
::
NormalPriority
);
m_documents
.
clear
();
}
bool
CppPreprocessor
::
includeFile
(
const
QString
&
absoluteFilePath
,
QByteArray
*
result
)
{
if
(
absoluteFilePath
.
isEmpty
()
||
m_included
.
contains
(
absoluteFilePath
))
{
...
...
@@ -514,12 +503,11 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
doc
->
releaseSource
();
snapshot
.
insert
(
doc
->
fileName
(),
doc
);
m_todo
.
remove
(
fileName
);
m_documents
.
append
(
doc
);
QtConcurrent
::
run
(
Process
(
m_modelManager
),
doc
);
(
void
)
switchDocument
(
previousDoc
);
m_todo
.
remove
(
fileName
);
}
Document
::
Ptr
CppPreprocessor
::
switchDocument
(
Document
::
Ptr
doc
)
...
...
@@ -1041,8 +1029,6 @@ void CppModelManager::parse(QFutureInterface<void> &future,
QThread
::
currentThread
()
->
setPriority
(
QThread
::
NormalPriority
);
}
preproc
->
parseCollectedDocuments
();
future
.
setProgressValue
(
files
.
size
());
delete
preproc
;
...
...
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