summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2008-02-15 00:58:31 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2008-02-15 00:58:31 (GMT)
commitd0d67d00153cad4f460eab7b930f7c2d3572b498 (patch)
tree5d69e530830aaaa88e98eee9cbd7b4e27338b34c /Source/QtDialog/CMakeSetupDialog.cxx
parentdf3169273a3333efe8ecb45da51e4c53b5d27fe9 (diff)
downloadCMake-d0d67d00153cad4f460eab7b930f7c2d3572b498.zip
CMake-d0d67d00153cad4f460eab7b930f7c2d3572b498.tar.gz
CMake-d0d67d00153cad4f460eab7b930f7c2d3572b498.tar.bz2
ENH: Convert native paths from QFileDialog and QDirModel/QCompleter.
BUG: Block possible completion loop.
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 5a280c9..724896c 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -24,8 +24,6 @@
#include <QDialogButtonBox>
#include <QCloseEvent>
#include <QCoreApplication>
-#include <QCompleter>
-#include <QDirModel>
#include <QSettings>
#include <QMenu>
#include <QMenuBar>
@@ -117,16 +115,8 @@ CMakeSetupDialog::CMakeSetupDialog()
QStringList buildPaths = this->loadBuildPaths();
this->BinaryDirectory->addItems(buildPaths);
- QCompleter* compBinaryDir = new QCompleter(this);
- QDirModel* modelBinaryDir = new QDirModel(compBinaryDir);
- modelBinaryDir->setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
- compBinaryDir->setModel(modelBinaryDir);
- this->BinaryDirectory->setCompleter(compBinaryDir);
- QCompleter* compSourceDir = new QCompleter(this);
- QDirModel* modelSourceDir = new QDirModel(compSourceDir);
- modelSourceDir->setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
- compSourceDir->setModel(modelSourceDir);
- this->SourceDirectory->setCompleter(compSourceDir);
+ this->BinaryDirectory->setCompleter(new QCMakeFileCompleter(this, true));
+ this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true));
// start the cmake worker thread
@@ -416,7 +406,7 @@ void CMakeSetupDialog::doSourceBrowse()
tr("Enter Path to Source"), this->SourceDirectory->text());
if(!dir.isEmpty())
{
- this->setSourceDirectory(dir);
+ this->setSourceDirectory(QDir::fromNativeSeparators(dir));
}
}
@@ -424,7 +414,9 @@ void CMakeSetupDialog::updateSourceDirectory(const QString& dir)
{
if(this->SourceDirectory->text() != dir)
{
- this->setSourceDirectory(dir);
+ this->SourceDirectory->blockSignals(true);
+ this->SourceDirectory->setText(dir);
+ this->SourceDirectory->blockSignals(false);
}
}
@@ -434,7 +426,7 @@ void CMakeSetupDialog::doBinaryBrowse()
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
{
- this->setBinaryDirectory(dir);
+ this->setBinaryDirectory(QDir::fromNativeSeparators(dir));
}
}