forked from qt-creator/qt-creator
ClearCase: Allow use of base name for executable
Change-Id: I329aaafd4dee10321c7342925262aadf539d0270 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
f777930a30
commit
69268b2aab
@@ -1179,7 +1179,7 @@ ClearCaseResponse
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec) const
|
||||
{
|
||||
const QString executable = m_settings.ccCommand;
|
||||
const QString executable = m_settings.ccBinaryPath;
|
||||
ClearCaseResponse response;
|
||||
if (executable.isEmpty()) {
|
||||
response.error = true;
|
||||
@@ -1802,7 +1802,7 @@ void ClearCasePlugin::diffGraphical(const QString &file1, const QString &file2)
|
||||
args << file1;
|
||||
if (!pred)
|
||||
args << file2;
|
||||
QProcess::startDetached(m_settings.ccCommand, args, m_topLevel);
|
||||
QProcess::startDetached(m_settings.ccBinaryPath, args, m_topLevel);
|
||||
}
|
||||
|
||||
QString ClearCasePlugin::runExtDiff(const QString &workingDir,
|
||||
@@ -1847,7 +1847,7 @@ void ClearCasePlugin::sync(QFutureInterface<void> &future, QString topLevel, QSt
|
||||
ClearCasePlugin *plugin = ClearCasePlugin::instance();
|
||||
|
||||
ClearCaseSettings settings = plugin->settings();
|
||||
QString program = settings.ccCommand;
|
||||
QString program = settings.ccBinaryPath;
|
||||
if (program.isEmpty())
|
||||
return;
|
||||
int total = files.size();
|
||||
|
||||
@@ -55,17 +55,19 @@ static const char defaultDiffArgs[] = "-ubp";
|
||||
|
||||
enum { defaultTimeOutS = 30, defaultHistoryCount = 50 };
|
||||
|
||||
static QString defaultCommand(const char *command)
|
||||
static QString defaultCommand()
|
||||
{
|
||||
QString rc = QLatin1String(command);
|
||||
QString expanded = Utils::Environment::systemEnvironment().searchInPath(rc);
|
||||
return expanded.isEmpty() ? rc : expanded;
|
||||
QString rc(QLatin1String("cleartool"));
|
||||
#if defined(Q_OS_WIN32)
|
||||
rc.append(QLatin1String(".exe"));
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
||||
using namespace ClearCase::Internal;
|
||||
|
||||
ClearCaseSettings::ClearCaseSettings() :
|
||||
ccCommand(defaultCommand("cleartool")),
|
||||
ccCommand(defaultCommand()),
|
||||
historyCount(defaultHistoryCount),
|
||||
timeOutS(defaultTimeOutS),
|
||||
diffType(GraphicalDiff),
|
||||
@@ -80,7 +82,8 @@ ClearCaseSettings::ClearCaseSettings() :
|
||||
void ClearCaseSettings::fromSettings(QSettings *settings)
|
||||
{
|
||||
settings->beginGroup(QLatin1String(groupC));
|
||||
ccCommand = settings->value(QLatin1String(commandKeyC), defaultCommand("cleartool")).toString();
|
||||
ccCommand = settings->value(QLatin1String(commandKeyC), defaultCommand()).toString();
|
||||
ccBinaryPath = Utils::Environment::systemEnvironment().searchInPath(ccCommand);
|
||||
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
|
||||
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
bool equals(const ClearCaseSettings &s) const;
|
||||
|
||||
QString ccCommand;
|
||||
QString ccBinaryPath;
|
||||
int historyCount;
|
||||
int timeOutS;
|
||||
DiffType diffType;
|
||||
|
||||
@@ -57,7 +57,8 @@ SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
|
||||
ClearCaseSettings SettingsPageWidget::settings() const
|
||||
{
|
||||
ClearCaseSettings rc;
|
||||
rc.ccCommand = m_ui.commandPathChooser->path();
|
||||
rc.ccCommand = m_ui.commandPathChooser->rawPath();
|
||||
rc.ccBinaryPath = m_ui.commandPathChooser->path();
|
||||
rc.timeOutS = m_ui.timeOutSpinBox->value();
|
||||
rc.autoCheckOut = m_ui.autoCheckOutCheckBox->isChecked();
|
||||
if (m_ui.graphicalDiffRadioButton->isChecked())
|
||||
|
||||
Reference in New Issue
Block a user