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:
@@ -21,6 +21,11 @@ QtProjectWizzardContentBuildFile::QtProjectWizzardContentBuildFile(
|
||||
}
|
||||
}
|
||||
|
||||
QtProjectWizzardContentSelect::ProjectType QtProjectWizzardContentBuildFile::getType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentBuildFile::populateForm(QGridLayout* layout, int& row)
|
||||
{
|
||||
QString name;
|
||||
@@ -54,6 +59,11 @@ void QtProjectWizzardContentBuildFile::populateForm(QGridLayout* layout, int& ro
|
||||
button->setToolTip("refresh paths");
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(refreshClicked()));
|
||||
|
||||
if (m_type == QtProjectWizzardContentSelect::PROJECT_CDB)
|
||||
{
|
||||
button->hide();
|
||||
}
|
||||
|
||||
m_picker->layout()->addWidget(button);
|
||||
|
||||
layout->addWidget(m_picker, row, QtProjectWizzardWindow::BACK_COL);
|
||||
@@ -76,6 +86,49 @@ void QtProjectWizzardContentBuildFile::load()
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentBuildFile::save()
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case QtProjectWizzardContentSelect::PROJECT_EMPTY:
|
||||
case QtProjectWizzardContentSelect::PROJECT_VS:
|
||||
break;
|
||||
case QtProjectWizzardContentSelect::PROJECT_CDB:
|
||||
{
|
||||
FilePath path = m_picker->getText().toStdString();
|
||||
if (!path.exists() || path.extension() != ".json")
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_settings->setCompilationDatabasePath(m_picker->getText().toStdString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool QtProjectWizzardContentBuildFile::check()
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case QtProjectWizzardContentSelect::PROJECT_EMPTY:
|
||||
case QtProjectWizzardContentSelect::PROJECT_VS:
|
||||
break;
|
||||
case QtProjectWizzardContentSelect::PROJECT_CDB:
|
||||
{
|
||||
FilePath path = m_picker->getText().toStdString();
|
||||
if (!path.exists() || path.extension() != ".json")
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText("Please enter a valid compilation database file (*.json).");
|
||||
msgBox.exec();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentBuildFile::refreshClicked()
|
||||
{
|
||||
FilePath path = FilePath(m_picker->getText().toStdString());
|
||||
@@ -101,14 +154,10 @@ void QtProjectWizzardContentBuildFile::refreshClicked()
|
||||
switch (m_type)
|
||||
{
|
||||
case QtProjectWizzardContentSelect::PROJECT_EMPTY:
|
||||
case QtProjectWizzardContentSelect::PROJECT_CDB:
|
||||
break;
|
||||
case QtProjectWizzardContentSelect::PROJECT_VS:
|
||||
{
|
||||
emit refreshVisualStudioSolution(path.str());
|
||||
break;
|
||||
}
|
||||
case QtProjectWizzardContentSelect::PROJECT_CDB:
|
||||
emit refreshCompilationDatabase(path.str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user