forked from qt-creator/qt-creator
CompilationDatabase: Ask for the root path and scan for headers
Let's use the same approach we have for CMake projects by using the same TreeScanner class. Compilation database does not have a concept of the root directory so let's show a file dialog and ask for it the first time the project is loaded. Next times we open it we take this path from settings. This root path can later be changed from the project tree context menu. Fixes: QTCREATORBUG-22031 Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/treescanner.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
|
||||
@@ -35,7 +36,9 @@ namespace CppTools {
|
||||
class CppProjectUpdater;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
namespace ProjectExplorer {
|
||||
class Kit;
|
||||
}
|
||||
|
||||
namespace CompilationDatabaseProjectManager {
|
||||
namespace Internal {
|
||||
@@ -51,13 +54,16 @@ public:
|
||||
bool needsBuildConfigurations() const override { return false; }
|
||||
|
||||
private:
|
||||
void reparseProject(const Utils::FileName &projectFile);
|
||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||
void reparseProject();
|
||||
void buildTreeAndProjectParts(const Utils::FileName &projectFile);
|
||||
|
||||
QFutureWatcher<void> m_parserWatcher;
|
||||
std::unique_ptr<CppTools::CppProjectUpdater> m_cppCodeModelUpdater;
|
||||
std::unique_ptr<ProjectExplorer::Kit> m_kit;
|
||||
Utils::FileSystemWatcher m_fileSystemWatcher;
|
||||
ProjectExplorer::TreeScanner m_treeScanner;
|
||||
QHash<QString, bool> m_mimeBinaryCache;
|
||||
bool m_hasTarget = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user