cmake-gui: Don't resolve symlinks with using file dialog.

This fixes bug #14274 where a clang++ symlink was resolved to
a clang executable.
This commit is contained in:
Clinton Stimpson 2014-03-29 22:39:43 -06:00
parent ede0419a37
commit 480be00bfa
2 changed files with 8 additions and 4 deletions

View File

@ -578,7 +578,8 @@ void CMakeSetupDialog::doInterrupt()
void CMakeSetupDialog::doSourceBrowse()
{
QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Path to Source"), this->SourceDirectory->text());
tr("Enter Path to Source"), this->SourceDirectory->text(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(!dir.isEmpty())
{
this->setSourceDirectory(dir);
@ -608,7 +609,8 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir)
void CMakeSetupDialog::doBinaryBrowse()
{
QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
tr("Enter Path to Build"), this->BinaryDirectory->currentText(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
{
this->setBinaryDirectory(dir);

View File

@ -67,7 +67,8 @@ void QCMakeFilePathEditor::chooseFile()
title = title.arg(this->Variable);
}
this->fileDialogExists(true);
path = QFileDialog::getOpenFileName(this, title, info.absolutePath());
path = QFileDialog::getOpenFileName(this, title, info.absolutePath(),
QString(), NULL, QFileDialog::DontResolveSymlinks);
this->fileDialogExists(false);
if(!path.isEmpty())
@ -91,7 +92,8 @@ void QCMakePathEditor::chooseFile()
title = title.arg(this->Variable);
}
this->fileDialogExists(true);
path = QFileDialog::getExistingDirectory(this, title, this->text());
path = QFileDialog::getExistingDirectory(this, title, this->text(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
this->fileDialogExists(false);
if(!path.isEmpty())
{