BUG: Fix #6733. Always convert "\" to "/" in source & binary directory fields on Windows.

This commit is contained in:
Clinton Stimpson 2008-04-07 19:19:50 -04:00
parent 1829bed8b5
commit 7d2bbfe842
4 changed files with 26 additions and 8 deletions

View File

@ -181,6 +181,9 @@ 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)),
@ -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);
}
}

View File

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

View File

@ -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 "

View File

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