Browse Source

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

This fixes bug #14274 where a clang++ symlink was resolved to
a clang executable.
Clinton Stimpson 11 years ago
parent
commit
480be00bfa
2 changed files with 8 additions and 4 deletions
  1. 4 2
      Source/QtDialog/CMakeSetupDialog.cxx
  2. 4 2
      Source/QtDialog/QCMakeWidgets.cxx

+ 4 - 2
Source/QtDialog/CMakeSetupDialog.cxx

@@ -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);

+ 4 - 2
Source/QtDialog/QCMakeWidgets.cxx

@@ -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())
     {