logic: Added compilation database project setup

* Added CDB option to project type selection
* show CDB source files in popup
* define header paths separately
* made generic content summary in wizzard and use it everywhere
* fixed file paths not canonical in analysis
* refactored wizzard content paths to use summary instead of subpaths
* refactored files popup to simpler communication with content

bug id = 35
This commit is contained in:
Eberhard Graether
2016-03-08 13:20:37 +01:00
parent 90c0d15d20
commit 8cc8f5d534
45 changed files with 919 additions and 734 deletions
@@ -0,0 +1,63 @@
#include "qt/window/project_wizzard/QtProjectWizzardContentCDBSource.h"
#include "data/parser/cxx/TaskParseCxx.h"
QtProjectWizzardContentCDBSource::QtProjectWizzardContentCDBSource(
ProjectSettings* settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContent(settings, window)
, m_text(nullptr)
{
}
void QtProjectWizzardContentCDBSource::populateWindow(QGridLayout* layout, int& row)
{
layout->setRowMinimumHeight(row++, 10);
QLabel* title = new QLabel("Source Files");
title->setWordWrap(true);
title->setObjectName("section");
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_text = new QLabel("");
layout->addWidget(m_text, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
addFilesButton("show source files", layout, row + 1);
row += 2;
layout->setColumnStretch(QtProjectWizzardWindow::FRONT_COL, 1);
layout->setColumnStretch(QtProjectWizzardWindow::BACK_COL, 2);
}
void QtProjectWizzardContentCDBSource::load()
{
std::vector<FilePath> filePaths = TaskParseCxx::getSourceFilesFromCDB(m_settings->getCompilationDatabasePath());
m_fileNames.clear();
for (const FilePath& path : filePaths)
{
m_fileNames << QString::fromStdString(path.str());
}
if (m_text)
{
m_text->setText(QString::number(m_fileNames.size()) + " source files were found in the compilation database.");
}
}
QStringList QtProjectWizzardContentCDBSource::getFileNames() const
{
return m_fileNames;
}
QString QtProjectWizzardContentCDBSource::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizzardContentCDBSource::getFileNamesDescription() const
{
return "source files will be analyzed.";
}