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,
|
unsigned flags,
|
||||||
QTextCodec *outputCodec) const
|
QTextCodec *outputCodec) const
|
||||||
{
|
{
|
||||||
const QString executable = m_settings.ccCommand;
|
const QString executable = m_settings.ccBinaryPath;
|
||||||
ClearCaseResponse response;
|
ClearCaseResponse response;
|
||||||
if (executable.isEmpty()) {
|
if (executable.isEmpty()) {
|
||||||
response.error = true;
|
response.error = true;
|
||||||
@@ -1802,7 +1802,7 @@ void ClearCasePlugin::diffGraphical(const QString &file1, const QString &file2)
|
|||||||
args << file1;
|
args << file1;
|
||||||
if (!pred)
|
if (!pred)
|
||||||
args << file2;
|
args << file2;
|
||||||
QProcess::startDetached(m_settings.ccCommand, args, m_topLevel);
|
QProcess::startDetached(m_settings.ccBinaryPath, args, m_topLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ClearCasePlugin::runExtDiff(const QString &workingDir,
|
QString ClearCasePlugin::runExtDiff(const QString &workingDir,
|
||||||
@@ -1847,7 +1847,7 @@ void ClearCasePlugin::sync(QFutureInterface<void> &future, QString topLevel, QSt
|
|||||||
ClearCasePlugin *plugin = ClearCasePlugin::instance();
|
ClearCasePlugin *plugin = ClearCasePlugin::instance();
|
||||||
|
|
||||||
ClearCaseSettings settings = plugin->settings();
|
ClearCaseSettings settings = plugin->settings();
|
||||||
QString program = settings.ccCommand;
|
QString program = settings.ccBinaryPath;
|
||||||
if (program.isEmpty())
|
if (program.isEmpty())
|
||||||
return;
|
return;
|
||||||
int total = files.size();
|
int total = files.size();
|
||||||
|
|||||||
@@ -55,17 +55,19 @@ static const char defaultDiffArgs[] = "-ubp";
|
|||||||
|
|
||||||
enum { defaultTimeOutS = 30, defaultHistoryCount = 50 };
|
enum { defaultTimeOutS = 30, defaultHistoryCount = 50 };
|
||||||
|
|
||||||
static QString defaultCommand(const char *command)
|
static QString defaultCommand()
|
||||||
{
|
{
|
||||||
QString rc = QLatin1String(command);
|
QString rc(QLatin1String("cleartool"));
|
||||||
QString expanded = Utils::Environment::systemEnvironment().searchInPath(rc);
|
#if defined(Q_OS_WIN32)
|
||||||
return expanded.isEmpty() ? rc : expanded;
|
rc.append(QLatin1String(".exe"));
|
||||||
|
#endif
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ClearCase::Internal;
|
using namespace ClearCase::Internal;
|
||||||
|
|
||||||
ClearCaseSettings::ClearCaseSettings() :
|
ClearCaseSettings::ClearCaseSettings() :
|
||||||
ccCommand(defaultCommand("cleartool")),
|
ccCommand(defaultCommand()),
|
||||||
historyCount(defaultHistoryCount),
|
historyCount(defaultHistoryCount),
|
||||||
timeOutS(defaultTimeOutS),
|
timeOutS(defaultTimeOutS),
|
||||||
diffType(GraphicalDiff),
|
diffType(GraphicalDiff),
|
||||||
@@ -80,7 +82,8 @@ ClearCaseSettings::ClearCaseSettings() :
|
|||||||
void ClearCaseSettings::fromSettings(QSettings *settings)
|
void ClearCaseSettings::fromSettings(QSettings *settings)
|
||||||
{
|
{
|
||||||
settings->beginGroup(QLatin1String(groupC));
|
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();
|
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||||
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
|
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
|
||||||
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
|
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public:
|
|||||||
bool equals(const ClearCaseSettings &s) const;
|
bool equals(const ClearCaseSettings &s) const;
|
||||||
|
|
||||||
QString ccCommand;
|
QString ccCommand;
|
||||||
|
QString ccBinaryPath;
|
||||||
int historyCount;
|
int historyCount;
|
||||||
int timeOutS;
|
int timeOutS;
|
||||||
DiffType diffType;
|
DiffType diffType;
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
|
|||||||
ClearCaseSettings SettingsPageWidget::settings() const
|
ClearCaseSettings SettingsPageWidget::settings() const
|
||||||
{
|
{
|
||||||
ClearCaseSettings rc;
|
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.timeOutS = m_ui.timeOutSpinBox->value();
|
||||||
rc.autoCheckOut = m_ui.autoCheckOutCheckBox->isChecked();
|
rc.autoCheckOut = m_ui.autoCheckOutCheckBox->isChecked();
|
||||||
if (m_ui.graphicalDiffRadioButton->isChecked())
|
if (m_ui.graphicalDiffRadioButton->isChecked())
|
||||||
|
|||||||
Reference in New Issue
Block a user