CompilationDatabase: enable the listing of non-cpp files

Files listed in an optional "compile_database.json.files" are also
visible in the project, similar to the GenericProjectManager.

Change-Id: I1250b674298079bab90a0ffe036107a09b4ac6e5
Reviewed-by: Thomas Otto <totto@zbh.uni-hamburg.de>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Thomas Otto
2019-05-01 16:59:52 +02:00
parent de8827b53f
commit b32c1453b4
3 changed files with 56 additions and 3 deletions

View File

@@ -43,13 +43,18 @@ namespace CompilationDatabaseProjectManager {
namespace Internal {
const char CHANGEROOTDIR[] = "CompilationDatabaseProjectManager.ChangeRootDirectory";
const char COMPILE_COMMANDS_JSON[] = "compile_commands.json";
bool CompilationDatabaseProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments);
Q_UNUSED(errorMessage);
Core::FileIconProvider::registerIconOverlayForFilename(Utils::Icons::PROJECT.imageFileName(),
"compile_commands.json");
Core::FileIconProvider::registerIconOverlayForFilename(
Utils::Icons::PROJECT.imageFileName(),
COMPILE_COMMANDS_JSON);
Core::FileIconProvider::registerIconOverlayForFilename(
Utils::Icons::PROJECT.imageFileName(),
QString(COMPILE_COMMANDS_JSON) + Constants::COMPILATIONDATABASEPROJECT_FILES_SUFFIX);
ProjectExplorer::ProjectManager::registerProjectType<CompilationDatabaseProject>(
Constants::COMPILATIONDATABASEMIMETYPE);