forked from qt-creator/qt-creator
Perforce: Fix testing settings
Changed settings had been taken into account only after an explicit Apply and this may be rather confusing. Change-Id: I344ddf18a3cb15b0bc2d2b41a38587395b592e46 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -106,6 +106,23 @@ QStringList PerforceSettings::commonP4Arguments() const
|
|||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList PerforceSettings::commonP4Arguments_volatile() const
|
||||||
|
{
|
||||||
|
QStringList lst;
|
||||||
|
if (customEnv.volatileValue().toBool()) {
|
||||||
|
auto p4C = p4Client.volatileValue().toString();
|
||||||
|
if (!p4C.isEmpty())
|
||||||
|
lst << "-c" << p4C;
|
||||||
|
auto p4P = p4Port.volatileValue().toString();
|
||||||
|
if (!p4P.isEmpty())
|
||||||
|
lst << "-p" << p4P;
|
||||||
|
auto p4U = p4User.volatileValue().toString();
|
||||||
|
if (!p4U.isEmpty())
|
||||||
|
lst << "-u" << p4U;
|
||||||
|
}
|
||||||
|
return lst;
|
||||||
|
}
|
||||||
|
|
||||||
bool PerforceSettings::isValid() const
|
bool PerforceSettings::isValid() const
|
||||||
{
|
{
|
||||||
return !m_topLevel.isEmpty() && !p4BinaryPath.value().isEmpty();
|
return !m_topLevel.isEmpty() && !p4BinaryPath.value().isEmpty();
|
||||||
@@ -234,7 +251,10 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings)
|
|||||||
|
|
||||||
errorLabel->setStyleSheet(QString());
|
errorLabel->setStyleSheet(QString());
|
||||||
errorLabel->setText(Tr::tr("Testing..."));
|
errorLabel->setText(Tr::tr("Testing..."));
|
||||||
checker->start(settings->p4BinaryPath.filePath(), {}, settings->commonP4Arguments(), 10000);
|
|
||||||
|
const FilePath p4Bin = FilePath::fromUserInput(
|
||||||
|
settings->p4BinaryPath.volatileValue().toString());
|
||||||
|
checker->start(p4Bin, {}, settings->commonP4Arguments_volatile(), 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
Group config {
|
Group config {
|
||||||
|
@@ -64,6 +64,7 @@ public:
|
|||||||
// Return basic arguments, including -d and server connection parameters.
|
// Return basic arguments, including -d and server connection parameters.
|
||||||
QStringList commonP4Arguments() const;
|
QStringList commonP4Arguments() const;
|
||||||
QStringList commonP4Arguments(const QString &workingDir) const;
|
QStringList commonP4Arguments(const QString &workingDir) const;
|
||||||
|
QStringList commonP4Arguments_volatile() const; // remove when auto apply is done
|
||||||
|
|
||||||
void clearTopLevel();
|
void clearTopLevel();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user