summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppfindreferences.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-12-15 15:26:40 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2009-12-15 15:26:40 +0100
commitaa8a6706697448dde8a23fabf2c07547ea0a12a7 (patch)
treec8ca17042b93fdd6c032acad6427f04d39671313 /src/plugins/cpptools/cppfindreferences.cpp
parentb168eec2a13da85f2e82f17730a599a77ef93180 (diff)
downloadqt-creator-aa8a6706697448dde8a23fabf2c07547ea0a12a7.tar.gz
Hide the implementation details of CppModelManagerInterface::WorkingCopy.
Diffstat (limited to 'src/plugins/cpptools/cppfindreferences.cpp')
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index d580c89c0e..8758a9f4b4 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -68,15 +68,15 @@ namespace {
class ProcessFile: public std::unary_function<QString, QList<Usage> >
{
- const QHash<QString, QString> workingList;
+ const CppTools::CppModelManagerInterface::WorkingCopy workingCopy;
const Snapshot snapshot;
Symbol *symbol;
public:
- ProcessFile(const QHash<QString, QString> workingList,
- const Snapshot snapshot,
- Symbol *symbol)
- : workingList(workingList), snapshot(snapshot), symbol(symbol)
+ ProcessFile(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy,
+ const Snapshot snapshot,
+ Symbol *symbol)
+ : workingCopy(workingCopy), snapshot(snapshot), symbol(symbol)
{ }
QList<Usage> operator()(const QString &fileName)
@@ -92,8 +92,8 @@ public:
QByteArray source;
- if (workingList.contains(fileName))
- source = snapshot.preprocessedCode(workingList.value(fileName), fileName);
+ if (workingCopy.contains(fileName))
+ source = snapshot.preprocessedCode(workingCopy.source(fileName), fileName);
else {
QFile file(fileName);
if (! file.open(QFile::ReadOnly))
@@ -168,7 +168,7 @@ QList<int> CppFindReferences::references(Symbol *symbol,
}
static void find_helper(QFutureInterface<Usage> &future,
- const QHash<QString, QString> workingList,
+ const CppTools::CppModelManagerInterface::WorkingCopy workingCopy,
Snapshot snapshot,
Symbol *symbol)
{
@@ -199,7 +199,7 @@ static void find_helper(QFutureInterface<Usage> &future,
future.setProgressRange(0, files.size());
- ProcessFile process(workingList, snapshot, symbol);
+ ProcessFile process(workingCopy, snapshot, symbol);
UpdateUI reduce(&future);
QtConcurrent::blockingMappedReduced<QList<Usage> > (files, process, reduce);