ui: Fixes in project setup

* fixed include paths fetched from CDB not canonical
* fixed content names
This commit is contained in:
Eberhard Graether
2017-10-25 00:57:28 +02:00
parent c4de8f1af8
commit c73e58893e
4 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ std::vector<FilePath> utility::getTopLevelPaths(const std::vector<FilePath>& pat
addPath = false;
break;
}
else if(path.contains(topLevelPaths[i]))
else if (path.contains(topLevelPaths[i]))
{
topLevelPaths.erase(topLevelPaths.begin() + i);
break;
+4 -5
View File
@@ -17,7 +17,6 @@ utility::CompilationDatabase::CompilationDatabase(const FilePath& filePath)
std::vector<FilePath> utility::CompilationDatabase::getAllHeaderPaths() const
{
std::vector<FilePath> paths = utility::concat(m_headers, m_systemHeaders);
paths = utility::concat(paths, m_frameworkHeaders);
paths = utility::unique(paths);
return paths;
}
@@ -66,19 +65,19 @@ void utility::CompilationDatabase::init()
if (utility::isPrefix(frameworkIncludeFlag, argument))
{
frameworkHeaders.insert(FilePath(utility::trim(argument.substr(frameworkIncludeFlag.size())), command.Directory));
frameworkHeaders.insert(FilePath(utility::trim(argument.substr(frameworkIncludeFlag.size())), command.Directory).canonical());
}
else if (utility::isPrefix(systemIncludeFlag, argument))
{
systemHeaders.insert(FilePath(utility::trim(argument.substr(systemIncludeFlag.size())), command.Directory));
systemHeaders.insert(FilePath(utility::trim(argument.substr(systemIncludeFlag.size())), command.Directory).canonical());
}
else if (utility::isPrefix(quoteFlag, argument))
{
headers.insert(FilePath(utility::trim(argument.substr(quoteFlag.size())), command.Directory));
headers.insert(FilePath(utility::trim(argument.substr(quoteFlag.size())), command.Directory).canonical());
}
else if (utility::isPrefix(includeFlag, argument))
{
headers.insert(FilePath(utility::trim(argument.substr(includeFlag.size())), command.Directory));
headers.insert(FilePath(utility::trim(argument.substr(includeFlag.size())), command.Directory).canonical());
}
}
}
@@ -15,7 +15,7 @@ QtProjectWizzardContentCDBSource::QtProjectWizzardContentCDBSource(
void QtProjectWizzardContentCDBSource::populate(QGridLayout* layout, int& row)
{
QLabel* title = createFormLabel("Source Files");
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
@@ -276,7 +276,7 @@ void QtProjectWizzardContentPathsCDBHeader::load()
}
m_settings->setSourcePaths(sourcePaths);
}
QtProjectWizzardContentPathsSource::load();
}
@@ -285,7 +285,7 @@ bool QtProjectWizzardContentPathsCDBHeader::check()
if (!m_list->getList().size())
{
QMessageBox msgBox;
msgBox.setText("You didn't specify any Indexed Header Paths.");
msgBox.setText("You didn't specify any Header Files & Directories to Index.");
msgBox.setInformativeText(
"Sourcetrail will only index the source files listed in the compilation database file and none of the included "
"header files.");
@@ -325,9 +325,9 @@ void QtProjectWizzardContentPathsCDBHeader::buttonClicked()
connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizzardContentPathsCDBHeader::savedFilesDialog);
connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizzardContentPathsCDBHeader::closedFilesDialog);
dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->setPathsList(
getTopLevelHeaderSearchPaths(std::dynamic_pointer_cast<SourceGroupSettingsCxxCdb>(m_settings)),
getTopLevelHeaderSearchPaths(std::dynamic_pointer_cast<SourceGroupSettingsCxxCdb>(m_settings)),
m_settings->getSourcePaths()
);
}