diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-04-07 23:19:50 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-04-07 23:19:50 (GMT) |
commit | 7d2bbfe84244031c25a9c71483f71fa95b1f29e8 (patch) | |
tree | 9dfd36735ae15fc70628ce1c28a976284db2ba54 /Source/QtDialog | |
parent | 1829bed8b5dd4c1d3b622a14160d3a6706bcc16e (diff) | |
download | CMake-7d2bbfe84244031c25a9c71483f71fa95b1f29e8.zip CMake-7d2bbfe84244031c25a9c71483f71fa95b1f29e8.tar.gz CMake-7d2bbfe84244031c25a9c71483f71fa95b1f29e8.tar.bz2 |
BUG: Fix #6733. Always convert "\" to "/" in source & binary directory fields on Windows.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 19 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 1 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 12 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.h | 2 |
4 files changed, 26 insertions, 8 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 7254abd..1c5e25d 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -181,7 +181,10 @@ void CMakeSetupDialog::initialize() QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(sourceDirChanged(QString)), this, SLOT(updateSourceDirectory(QString))); - + QObject::connect(this->CMakeThread->cmakeInstance(), + SIGNAL(binaryDirChanged(QString)), + this, SLOT(updateBinaryDirectory(QString))); + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(progressChanged(QString, float)), this, SLOT(showProgress(QString,float))); @@ -445,7 +448,7 @@ void CMakeSetupDialog::doSourceBrowse() tr("Enter Path to Source"), this->SourceDirectory->text()); if(!dir.isEmpty()) { - this->setSourceDirectory(QDir::fromNativeSeparators(dir)); + this->setSourceDirectory(dir); } } @@ -459,13 +462,23 @@ void CMakeSetupDialog::updateSourceDirectory(const QString& dir) } } +void CMakeSetupDialog::updateBinaryDirectory(const QString& dir) +{ + if(this->BinaryDirectory->currentText() != dir) + { + this->BinaryDirectory->blockSignals(true); + this->BinaryDirectory->setEditText(dir); + this->BinaryDirectory->blockSignals(false); + } +} + void CMakeSetupDialog::doBinaryBrowse() { QString dir = QFileDialog::getExistingDirectory(this, tr("Enter Path to Build"), this->BinaryDirectory->currentText()); if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText()) { - this->setBinaryDirectory(QDir::fromNativeSeparators(dir)); + this->setBinaryDirectory(dir); } } diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 81ef751..211dfcb 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -59,6 +59,7 @@ protected slots: void doReloadCache(); void doDeleteCache(); void updateSourceDirectory(const QString& dir); + void updateBinaryDirectory(const QString& dir); void showProgress(const QString& msg, float percent); void setEnabledState(bool); bool promptForGenerator(); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index c10d9a6..60ca2fe 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -86,8 +86,8 @@ void QCMake::setSourceDirectory(const QString& dir) { if(this->SourceDirectory != dir) { - this->SourceDirectory = dir; - emit this->sourceDirChanged(dir); + this->SourceDirectory = QDir::fromNativeSeparators(dir); + emit this->sourceDirChanged(this->SourceDirectory); } } @@ -95,12 +95,14 @@ void QCMake::setBinaryDirectory(const QString& dir) { if(this->BinaryDirectory != dir) { + this->BinaryDirectory = QDir::fromNativeSeparators(dir); + emit this->binaryDirChanged(this->BinaryDirectory); cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - this->BinaryDirectory = dir; this->setGenerator(QString()); - if(!this->CMakeInstance->GetCacheManager()->LoadCache(dir.toLocal8Bit().data())) + if(!this->CMakeInstance->GetCacheManager()->LoadCache( + this->BinaryDirectory.toLocal8Bit().data())) { - QDir testDir(dir); + QDir testDir(this->BinaryDirectory); if(testDir.exists("CMakeCache.txt")) { cmSystemTools::Error("There is a CMakeCache.txt file for the current binary " diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 89a19e9..c46aab6 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -112,6 +112,8 @@ signals: /// signal when the source directory changes (binary directory already /// containing a CMakeCache.txt file) void sourceDirChanged(const QString& dir); + /// signal when the binary directory changes + void binaryDirChanged(const QString& dir); /// signal for progress events void progressChanged(const QString& msg, float percent); /// signal when configure is done |