ClangCodeModel: Replace nested ClangCodeModel::Utils namespace

... by the customary ::Internal.

It adds only noise on the user side and conflicts regularly with
the top-level ::Utils namespace.

Remove a (now) duplicated definition of setLastSentDocumentRevision().

Plus minor namespace related fixes.

There are still minor conflicts between Utils::Text and
ClangCodeModel::Text

Change-Id: I2e8df6b3c6c3599192774032822ee7e778355bba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-07-06 15:49:35 +02:00
parent 5671b3a7be
commit f0628cca29
16 changed files with 137 additions and 154 deletions

View File

@@ -52,6 +52,8 @@
#include <QtConcurrent>
using namespace Utils;
namespace ClangCodeModel {
namespace Internal {
@@ -73,8 +75,8 @@ void ClangCodeModelPlugin::generateCompilationDB()
if (!target)
return;
QFuture<Utils::GenerateCompilationDbResult> task
= QtConcurrent::run(&Utils::generateCompilationDB,
QFuture<GenerateCompilationDbResult> task
= QtConcurrent::run(&Internal::generateCompilationDB,
CppModelManager::instance()->projectInfo(target->project()));
Core::ProgressManager::addTask(task, tr("Generating Compilation DB"), "generate compilation db");
m_generatorWatcher.setFuture(task);
@@ -121,10 +123,10 @@ void ClangCodeModelPlugin::createCompilationDBButton()
Core::ActionContainer *mbuild =
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT);
// generate compile_commands.json
m_generateCompilationDBAction = new ::Utils::ParameterAction(
m_generateCompilationDBAction = new ParameterAction(
tr("Generate Compilation Database"),
tr("Generate Compilation Database for \"%1\""),
::Utils::ParameterAction::AlwaysEnabled, this);
ParameterAction::AlwaysEnabled, this);
ProjectExplorer::Project *startupProject = ProjectExplorer::SessionManager::startupProject();
m_generateCompilationDBAction->setEnabled(isDBGenerationEnabled(startupProject));
@@ -137,9 +139,9 @@ void ClangCodeModelPlugin::createCompilationDBButton()
command->setDescription(m_generateCompilationDBAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(&m_generatorWatcher, &QFutureWatcher<Utils::GenerateCompilationDbResult>::finished,
connect(&m_generatorWatcher, &QFutureWatcher<GenerateCompilationDbResult>::finished,
this, [this] () {
const Utils::GenerateCompilationDbResult result = m_generatorWatcher.result();
const GenerateCompilationDbResult result = m_generatorWatcher.result();
QString message;
if (result.error.isEmpty()) {
message = tr("Clang compilation database generated at \"%1\".")