Commit 9d7b562f authored by Arnold Dumas's avatar Arnold Dumas Committed by Tobias Hunger
Browse files

ProjectExplorer: Fix project name when selecting kit for new C/C++ project using CMake



Don't base on the build system file name to get the name of the project,
but rather use the name of the parent directory.

Task-number: QTCREATORBUG-16987
Change-Id: Ib55f5cf783ffef5d5d12a03ed8368e04e2fa9381
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 97305136
......@@ -286,9 +286,12 @@ void TargetSetupPage::reset()
void TargetSetupPage::setProjectPath(const QString &path)
{
m_projectPath = path;
if (!m_projectPath.isEmpty())
if (!m_projectPath.isEmpty()) {
QFileInfo fileInfo(QDir::cleanPath(path));
QStringList subDirsList = fileInfo.absolutePath().split('/');
m_ui->headerLabel->setText(tr("Qt Creator can use the following kits for project <b>%1</b>:",
"%1: Project name").arg(QFileInfo(m_projectPath).baseName()));
"%1: Project name").arg(subDirsList.last()));
}
m_ui->headerLabel->setVisible(!m_projectPath.isEmpty());
if (m_widgets.isEmpty())
......
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