ClangCodeModel: remove ClangdTextMark safety net

Since all text mark created by the diagnostic manager get deleted
properly on destruction now, there is no need to react on the client
destruction in ClangdTextMark.

Task-number: QTCREATORBUG-26585
Change-Id: Ifb9b8546c8f0d94debdcf2c8de6081e4e731cfab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-02-24 11:11:07 +01:00
parent b58c57fb3f
commit 967b1d237b
2 changed files with 0 additions and 13 deletions

View File

@@ -406,11 +406,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
ClangDiagnosticManager::addTask(m_diagnostic);
}
m_clientDeleted = QObject::connect(client, &QObject::destroyed, [this] (){
QTC_ASSERT_STRING("ClangdClient deleted before TextMark");
delete this;
});
// Copy to clipboard action
QVector<QAction *> actions;
QAction *action = new QAction();
@@ -438,11 +433,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
setActions(actions);
}
ClangdTextMark::~ClangdTextMark()
{
QObject::disconnect(m_clientDeleted);
}
bool ClangdTextMark::addToolTipContent(QLayout *target) const
{
const auto canApplyFixIt = [c = m_client, diag = m_lspDiagnostic, fp = fileName()] {

View File

@@ -73,7 +73,6 @@ public:
ClangdTextMark(const ::Utils::FilePath &filePath,
const LanguageServerProtocol::Diagnostic &diagnostic,
const LanguageClient::Client *client);
~ClangdTextMark();
private:
bool addToolTipContent(QLayout *target) const override;
@@ -81,8 +80,6 @@ private:
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
const ClangBackEnd::DiagnosticContainer m_diagnostic;
const QPointer<const LanguageClient::Client> m_client;
QMetaObject::Connection m_clientDeleted;
};
} // namespace Internal