ClangCodeModel: fix setting clangd to the fallback client

When manually defining clangd to the fallback clangd in the settings the
setting was not saved and after a restart the previous clangd was setup
again.

Change-Id: I6ce71d20d510c0cf6c605247563349b38c204e56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-05-04 14:46:02 +02:00
parent cf8a2e6589
commit 4a3c4dec09

View File

@@ -480,8 +480,9 @@ QVariantMap ClangdSettings::Data::toMap() const
{
QVariantMap map;
map.insert(useClangdKey(), useClangd);
if (executableFilePath != fallbackClangdFilePath())
map.insert(clangdPathKey(), executableFilePath.toString());
map.insert(clangdPathKey(),
executableFilePath != fallbackClangdFilePath() ? executableFilePath.toString()
: QString());
map.insert(clangdIndexingKey(), enableIndexing);
map.insert(clangdHeaderInsertionKey(), autoIncludeHeaders);
map.insert(clangdThreadLimitKey(), workerThreadLimit);