Commit d90c03ee authored by Tobias Hunger's avatar Tobias Hunger

GenericProject: Make initial selection of files work

All files where considered to be "out-of-tree" since the base directory
was not known at the time the initially marked files were set.

Also remove the need to selectAllFiles later by making sure an
empty set of initially marked files is treated as "select all files".

Change-Id: I5b9745f8afbcc389bed7032b9e76b647f54d681a
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent 43d571b5
......@@ -63,9 +63,7 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel
void SelectableFilesModel::setInitialMarkedFiles(const Utils::FileNameList &files)
{
m_files = files.toSet();
m_outOfBaseDirFiles
= Utils::filtered(m_files, [this](const Utils::FileName &fn) { return !fn.isChildOf(m_baseDir); });
m_allFiles = false;
m_allFiles = files.isEmpty();
}
void SelectableFilesModel::startParsing(const Utils::FileName &baseDir)
......@@ -95,6 +93,9 @@ void SelectableFilesModel::buildTreeFinished()
delete m_root;
m_root = m_rootForFuture;
m_rootForFuture = nullptr;
m_outOfBaseDirFiles
= Utils::filtered(m_files, [this](const Utils::FileName &fn) { return !fn.isChildOf(m_baseDir); });
endResetModel();
emit parsingFinished();
}
......@@ -694,7 +695,6 @@ void SelectableFilesWidget::parsingFinished()
if (!m_model)
return;
m_model->selectAllFiles();
applyFilter();
smartExpand(m_model->index(0,0, QModelIndex()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment