forked from qt-creator/qt-creator
Simplify interface of classes in ClassViewPlugin
Remove unused methods. Replace one slot with a call
to lambda.
Amends a673fca144
Task-number: QTCREATORBUG-25317
Change-Id: I1125b62b9ea66b8dc43038a6b748d52a5a27224f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -199,7 +199,14 @@ void Manager::initialize()
|
||||
|
||||
// translate data update from the parser to listeners
|
||||
connect(&d->parser, &Parser::treeDataUpdate,
|
||||
this, &Manager::onTreeDataUpdate, Qt::QueuedConnection);
|
||||
this, [this](QSharedPointer<QStandardItem> result) {
|
||||
// do nothing if Manager is disabled
|
||||
if (!state())
|
||||
return;
|
||||
|
||||
emit treeDataUpdate(result);
|
||||
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
// connect to the cpp model manager for signals about document updates
|
||||
CppTools::CppModelManager *codeModelManager = CppTools::CppModelManager::instance();
|
||||
@@ -352,19 +359,5 @@ void Manager::setFlatMode(bool flat)
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/*!
|
||||
Sends a new tree data update to a tree view. \a result holds the item with
|
||||
the current tree.
|
||||
*/
|
||||
|
||||
void Manager::onTreeDataUpdate(QSharedPointer<QStandardItem> result)
|
||||
{
|
||||
// do nothing if Manager is disabled
|
||||
if (!state())
|
||||
return;
|
||||
|
||||
emit treeDataUpdate(result);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClassView
|
||||
|
@@ -60,7 +60,6 @@ signals:
|
||||
|
||||
private:
|
||||
void onProjectListChanged();
|
||||
void onTreeDataUpdate(QSharedPointer<QStandardItem> result);
|
||||
void resetParser();
|
||||
|
||||
void initialize();
|
||||
|
@@ -146,36 +146,6 @@ void ParserTreeItem::addSymbolLocation(const SymbolLocation &location)
|
||||
d->symbolLocations.insert(location);
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds information about symbol locations from \a locations.
|
||||
\sa SymbolLocation, removeSymbolLocation, symbolLocations
|
||||
*/
|
||||
|
||||
void ParserTreeItem::addSymbolLocation(const QSet<SymbolLocation> &locations)
|
||||
{
|
||||
d->symbolLocations.unite(locations);
|
||||
}
|
||||
|
||||
/*!
|
||||
Removes information about \a location.
|
||||
\sa SymbolLocation, addSymbolLocation, symbolLocations
|
||||
*/
|
||||
|
||||
void ParserTreeItem::removeSymbolLocation(const SymbolLocation &location)
|
||||
{
|
||||
d->symbolLocations.remove(location);
|
||||
}
|
||||
|
||||
/*!
|
||||
Removes information about \a locations.
|
||||
\sa SymbolLocation, addSymbolLocation, symbolLocations
|
||||
*/
|
||||
|
||||
void ParserTreeItem::removeSymbolLocations(const QSet<SymbolLocation> &locations)
|
||||
{
|
||||
d->symbolLocations.subtract(locations);
|
||||
}
|
||||
|
||||
/*!
|
||||
Gets information about symbol positions.
|
||||
\sa SymbolLocation, addSymbolLocation, removeSymbolLocation
|
||||
@@ -199,15 +169,6 @@ void ParserTreeItem::appendChild(const ParserTreeItem::Ptr &item, const SymbolIn
|
||||
d->symbolInformations[inf] = item;
|
||||
}
|
||||
|
||||
/*!
|
||||
Removes the \a inf symbol information.
|
||||
*/
|
||||
|
||||
void ParserTreeItem::removeChild(const SymbolInformation &inf)
|
||||
{
|
||||
d->symbolInformations.remove(inf);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the child item specified by \a inf symbol information.
|
||||
*/
|
||||
|
@@ -54,18 +54,10 @@ public:
|
||||
|
||||
void addSymbolLocation(const SymbolLocation &location);
|
||||
|
||||
void addSymbolLocation(const QSet<SymbolLocation> &locations);
|
||||
|
||||
void removeSymbolLocation(const SymbolLocation &location);
|
||||
|
||||
void removeSymbolLocations(const QSet<SymbolLocation> &locations);
|
||||
|
||||
QSet<SymbolLocation> symbolLocations() const;
|
||||
|
||||
void appendChild(const ParserTreeItem::Ptr &item, const SymbolInformation &inf);
|
||||
|
||||
void removeChild(const SymbolInformation &inf);
|
||||
|
||||
ParserTreeItem::Ptr child(const SymbolInformation &inf) const;
|
||||
|
||||
int childCount() const;
|
||||
|
Reference in New Issue
Block a user