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
7528b2c6
Commit
7528b2c6
authored
Jul 06, 2010
by
Roberto Raggi
Browse files
Compute the dependecy table on demand.
parent
f30f1b66
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppfindreferences.cpp
View file @
7528b2c6
...
@@ -153,14 +153,6 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa
...
@@ -153,14 +153,6 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa
m_watcher
.
setPendingResultsLimit
(
1
);
m_watcher
.
setPendingResultsLimit
(
1
);
connect
(
&
m_watcher
,
SIGNAL
(
resultsReadyAt
(
int
,
int
)),
this
,
SLOT
(
displayResults
(
int
,
int
)));
connect
(
&
m_watcher
,
SIGNAL
(
resultsReadyAt
(
int
,
int
)),
this
,
SLOT
(
displayResults
(
int
,
int
)));
connect
(
&
m_watcher
,
SIGNAL
(
finished
()),
this
,
SLOT
(
searchFinished
()));
connect
(
&
m_watcher
,
SIGNAL
(
finished
()),
this
,
SLOT
(
searchFinished
()));
m_updateDependencyTableTimer
=
new
QTimer
(
this
);
m_updateDependencyTableTimer
->
setSingleShot
(
true
);
m_updateDependencyTableTimer
->
setInterval
(
2000
);
connect
(
m_updateDependencyTableTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateDependencyTable
()));
connect
(
modelManager
,
SIGNAL
(
documentUpdated
(
CPlusPlus
::
Document
::
Ptr
)),
m_updateDependencyTableTimer
,
SLOT
(
start
()));
}
}
CppFindReferences
::~
CppFindReferences
()
CppFindReferences
::~
CppFindReferences
()
...
@@ -231,8 +223,7 @@ static CPlusPlus::DependencyTable dependencyTable(DependencyTable previous, CPlu
...
@@ -231,8 +223,7 @@ static CPlusPlus::DependencyTable dependencyTable(DependencyTable previous, CPlu
void
CppFindReferences
::
updateDependencyTable
()
void
CppFindReferences
::
updateDependencyTable
()
{
{
m_depsFuture
.
cancel
();
m_deps
=
dependencyTable
(
m_deps
,
_modelManager
->
snapshot
());
m_depsFuture
=
QtConcurrent
::
run
(
&
dependencyTable
,
m_deps
,
_modelManager
->
snapshot
());
}
}
void
CppFindReferences
::
findUsages
(
CPlusPlus
::
Symbol
*
symbol
,
const
CPlusPlus
::
LookupContext
&
context
)
void
CppFindReferences
::
findUsages
(
CPlusPlus
::
Symbol
*
symbol
,
const
CPlusPlus
::
LookupContext
&
context
)
...
@@ -276,7 +267,6 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
...
@@ -276,7 +267,6 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
Core
::
ProgressManager
*
progressManager
=
Core
::
ICore
::
instance
()
->
progressManager
();
Core
::
ProgressManager
*
progressManager
=
Core
::
ICore
::
instance
()
->
progressManager
();
updateDependencyTable
();
// ensure the dependency table is updated
updateDependencyTable
();
// ensure the dependency table is updated
m_deps
=
m_depsFuture
;
QFuture
<
Usage
>
result
;
QFuture
<
Usage
>
result
;
...
@@ -436,7 +426,6 @@ void CppFindReferences::findMacroUses(const Macro ¯o)
...
@@ -436,7 +426,6 @@ void CppFindReferences::findMacroUses(const Macro ¯o)
}
}
updateDependencyTable
();
// ensure the dependency table is updated
updateDependencyTable
();
// ensure the dependency table is updated
m_deps
=
m_depsFuture
;
QFuture
<
Usage
>
result
;
QFuture
<
Usage
>
result
;
result
=
QtConcurrent
::
run
(
&
findMacroUses_helper
,
workingCopy
,
snapshot
,
m_deps
,
macro
);
result
=
QtConcurrent
::
run
(
&
findMacroUses_helper
,
workingCopy
,
snapshot
,
m_deps
,
macro
);
...
...
src/plugins/cpptools/cppfindreferences.h
View file @
7528b2c6
...
@@ -85,8 +85,6 @@ private:
...
@@ -85,8 +85,6 @@ private:
Find
::
SearchResultWindow
*
_resultWindow
;
Find
::
SearchResultWindow
*
_resultWindow
;
QFutureWatcher
<
CPlusPlus
::
Usage
>
m_watcher
;
QFutureWatcher
<
CPlusPlus
::
Usage
>
m_watcher
;
CPlusPlus
::
DependencyTable
m_deps
;
CPlusPlus
::
DependencyTable
m_deps
;
QFuture
<
CPlusPlus
::
DependencyTable
>
m_depsFuture
;
QTimer
*
m_updateDependencyTableTimer
;
};
};
}
// end of namespace Internal
}
// end of namespace Internal
...
...
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