LanguageClient: Add context object into connections

Change-Id: I03bc2c1a9fa36d7c629d63a7fb866b919bb2cc20
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Jarek Kobus
2023-08-01 20:17:54 +02:00
parent 1ceea7a91f
commit a1fbc1a4b7
2 changed files with 3 additions and 5 deletions

View File

@@ -292,10 +292,8 @@ Core::NavigationView CallHierarchyFactory::createWidget()
auto button = new QToolButton; auto button = new QToolButton;
button->setIcon(Icons::RELOAD_TOOLBAR.icon()); button->setIcon(Icons::RELOAD_TOOLBAR.icon());
button->setToolTip(Tr::tr("Reloads the call hierarchy for the symbol under cursor position.")); button->setToolTip(Tr::tr("Reloads the call hierarchy for the symbol under cursor position."));
connect(button, &QToolButton::clicked, [h](){ connect(button, &QToolButton::clicked, this, [h] { h->updateHierarchyAtCursorPosition(); });
h->updateHierarchyAtCursorPosition(); return {h, {button}};
});
return {h,{button}};
} }
} // namespace LanguageClient } // namespace LanguageClient

View File

@@ -590,7 +590,7 @@ void LanguageClientManager::trackClientDeletion(Client *client)
{ {
QTC_ASSERT(!m_scheduledForDeletion.contains(client->id()), return); QTC_ASSERT(!m_scheduledForDeletion.contains(client->id()), return);
m_scheduledForDeletion.insert(client->id()); m_scheduledForDeletion.insert(client->id());
connect(client, &QObject::destroyed, [this, id = client->id()](){ connect(client, &QObject::destroyed, this, [this, id = client->id()] {
m_scheduledForDeletion.remove(id); m_scheduledForDeletion.remove(id);
if (isShutdownFinished()) if (isShutdownFinished())
emit shutdownFinished(); emit shutdownFinished();