Avoid holding on lots of data with C++ Find Usages

The snapshots at the moment of search were held as long as the
corresponding search result panel was kept, to allow mapping of the old
symbol to the corresponding symbol in the new snapshot.
Now we just save the file name and ID of the old symbol.

Change-Id: Iaf3c9ca27ec2b788f142bd0dd6b86e34e66d5c8b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Eike Ziller
2013-10-18 12:42:46 +02:00
parent 155567a0b3
commit c30c290631
2 changed files with 117 additions and 112 deletions

View File

@@ -54,8 +54,8 @@ namespace Internal {
class CppFindReferencesParameters
{
public:
CPlusPlus::LookupContext context;
CPlusPlus::Symbol *symbol;
QList<QByteArray> symbolId;
QByteArray symbolFileName;
};
class CppFindReferences: public QObject
@@ -92,12 +92,13 @@ private:
const QString &replacement, bool replace);
void findMacroUses(const CPlusPlus::Macro &macro, const QString &replacement,
bool replace);
void findAll_helper(Find::SearchResult *search);
void findAll_helper(Find::SearchResult *search, CPlusPlus::Symbol *symbol,
const CPlusPlus::LookupContext &context);
CPlusPlus::DependencyTable dependencyTable() const;
void setDependencyTable(const CPlusPlus::DependencyTable &newTable);
void createWatcher(const QFuture<CPlusPlus::Usage> &future, Find::SearchResult *search);
bool findSymbol(CppFindReferencesParameters *parameters,
const CPlusPlus::Snapshot &snapshot);
CPlusPlus::Symbol *findSymbol(const CppFindReferencesParameters &parameters,
const CPlusPlus::Snapshot &snapshot, CPlusPlus::LookupContext *context);
private:
QPointer<CppModelManagerInterface> _modelManager;