BUG: Fix #6733. Always convert "\" to "/" in source & binary directory fields on Windows.
This commit is contained in:
parent
1829bed8b5
commit
7d2bbfe842
@ -181,7 +181,10 @@ void CMakeSetupDialog::initialize()
|
|||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(sourceDirChanged(QString)),
|
SIGNAL(sourceDirChanged(QString)),
|
||||||
this, SLOT(updateSourceDirectory(QString)));
|
this, SLOT(updateSourceDirectory(QString)));
|
||||||
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
|
SIGNAL(binaryDirChanged(QString)),
|
||||||
|
this, SLOT(updateBinaryDirectory(QString)));
|
||||||
|
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(progressChanged(QString, float)),
|
SIGNAL(progressChanged(QString, float)),
|
||||||
this, SLOT(showProgress(QString,float)));
|
this, SLOT(showProgress(QString,float)));
|
||||||
@ -445,7 +448,7 @@ void CMakeSetupDialog::doSourceBrowse()
|
|||||||
tr("Enter Path to Source"), this->SourceDirectory->text());
|
tr("Enter Path to Source"), this->SourceDirectory->text());
|
||||||
if(!dir.isEmpty())
|
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()
|
void CMakeSetupDialog::doBinaryBrowse()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this,
|
QString dir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
|
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
|
||||||
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
|
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
|
||||||
{
|
{
|
||||||
this->setBinaryDirectory(QDir::fromNativeSeparators(dir));
|
this->setBinaryDirectory(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ protected slots:
|
|||||||
void doReloadCache();
|
void doReloadCache();
|
||||||
void doDeleteCache();
|
void doDeleteCache();
|
||||||
void updateSourceDirectory(const QString& dir);
|
void updateSourceDirectory(const QString& dir);
|
||||||
|
void updateBinaryDirectory(const QString& dir);
|
||||||
void showProgress(const QString& msg, float percent);
|
void showProgress(const QString& msg, float percent);
|
||||||
void setEnabledState(bool);
|
void setEnabledState(bool);
|
||||||
bool promptForGenerator();
|
bool promptForGenerator();
|
||||||
|
@ -86,8 +86,8 @@ void QCMake::setSourceDirectory(const QString& dir)
|
|||||||
{
|
{
|
||||||
if(this->SourceDirectory != dir)
|
if(this->SourceDirectory != dir)
|
||||||
{
|
{
|
||||||
this->SourceDirectory = dir;
|
this->SourceDirectory = QDir::fromNativeSeparators(dir);
|
||||||
emit this->sourceDirChanged(dir);
|
emit this->sourceDirChanged(this->SourceDirectory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,12 +95,14 @@ void QCMake::setBinaryDirectory(const QString& dir)
|
|||||||
{
|
{
|
||||||
if(this->BinaryDirectory != dir)
|
if(this->BinaryDirectory != dir)
|
||||||
{
|
{
|
||||||
|
this->BinaryDirectory = QDir::fromNativeSeparators(dir);
|
||||||
|
emit this->binaryDirChanged(this->BinaryDirectory);
|
||||||
cmCacheManager *cachem = this->CMakeInstance->GetCacheManager();
|
cmCacheManager *cachem = this->CMakeInstance->GetCacheManager();
|
||||||
this->BinaryDirectory = dir;
|
|
||||||
this->setGenerator(QString());
|
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"))
|
if(testDir.exists("CMakeCache.txt"))
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("There is a CMakeCache.txt file for the current binary "
|
cmSystemTools::Error("There is a CMakeCache.txt file for the current binary "
|
||||||
|
@ -112,6 +112,8 @@ signals:
|
|||||||
/// signal when the source directory changes (binary directory already
|
/// signal when the source directory changes (binary directory already
|
||||||
/// containing a CMakeCache.txt file)
|
/// containing a CMakeCache.txt file)
|
||||||
void sourceDirChanged(const QString& dir);
|
void sourceDirChanged(const QString& dir);
|
||||||
|
/// signal when the binary directory changes
|
||||||
|
void binaryDirChanged(const QString& dir);
|
||||||
/// signal for progress events
|
/// signal for progress events
|
||||||
void progressChanged(const QString& msg, float percent);
|
void progressChanged(const QString& msg, float percent);
|
||||||
/// signal when configure is done
|
/// signal when configure is done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user