forked from qt-creator/qt-creator
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:
@@ -406,11 +406,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
|||||||
ClangDiagnosticManager::addTask(m_diagnostic);
|
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
|
// Copy to clipboard action
|
||||||
QVector<QAction *> actions;
|
QVector<QAction *> actions;
|
||||||
QAction *action = new QAction();
|
QAction *action = new QAction();
|
||||||
@@ -438,11 +433,6 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
|||||||
setActions(actions);
|
setActions(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClangdTextMark::~ClangdTextMark()
|
|
||||||
{
|
|
||||||
QObject::disconnect(m_clientDeleted);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ClangdTextMark::addToolTipContent(QLayout *target) const
|
bool ClangdTextMark::addToolTipContent(QLayout *target) const
|
||||||
{
|
{
|
||||||
const auto canApplyFixIt = [c = m_client, diag = m_lspDiagnostic, fp = fileName()] {
|
const auto canApplyFixIt = [c = m_client, diag = m_lspDiagnostic, fp = fileName()] {
|
||||||
|
@@ -73,7 +73,6 @@ public:
|
|||||||
ClangdTextMark(const ::Utils::FilePath &filePath,
|
ClangdTextMark(const ::Utils::FilePath &filePath,
|
||||||
const LanguageServerProtocol::Diagnostic &diagnostic,
|
const LanguageServerProtocol::Diagnostic &diagnostic,
|
||||||
const LanguageClient::Client *client);
|
const LanguageClient::Client *client);
|
||||||
~ClangdTextMark();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool addToolTipContent(QLayout *target) const override;
|
bool addToolTipContent(QLayout *target) const override;
|
||||||
@@ -81,8 +80,6 @@ private:
|
|||||||
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
|
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
|
||||||
const ClangBackEnd::DiagnosticContainer m_diagnostic;
|
const ClangBackEnd::DiagnosticContainer m_diagnostic;
|
||||||
const QPointer<const LanguageClient::Client> m_client;
|
const QPointer<const LanguageClient::Client> m_client;
|
||||||
|
|
||||||
QMetaObject::Connection m_clientDeleted;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user