Commit 90ce38da authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Vcs: Move handling of settings from VcsBaseClient to VcsBaseClientImpl



... and update users of that functionality accordingly.

Unexpected plus: Now every supported VCS actually saves their setting
when requested.

Change-Id: I02db7b2ce14e5f52d26409b2a01aea290c2a294a
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
parent d3100774
......@@ -68,13 +68,13 @@ class BazaarDiffParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
BazaarDiffParameterWidget(BazaarSettings *settings, QWidget *parent = 0) :
BazaarDiffParameterWidget(VcsBaseClientSettings &settings, QWidget *parent = 0) :
VcsBaseEditorParameterWidget(parent)
{
mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore Whitespace")),
settings->boolPointer(BazaarSettings::diffIgnoreWhiteSpaceKey));
settings.boolPointer(BazaarSettings::diffIgnoreWhiteSpaceKey));
mapSetting(addToggleButton(QLatin1String("-B"), tr("Ignore Blank Lines")),
settings->boolPointer(BazaarSettings::diffIgnoreBlankLinesKey));
settings.boolPointer(BazaarSettings::diffIgnoreBlankLinesKey));
}
QStringList arguments() const
......@@ -95,18 +95,18 @@ class BazaarLogParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
BazaarLogParameterWidget(BazaarSettings *settings, QWidget *parent = 0) :
BazaarLogParameterWidget(VcsBaseClientSettings &settings, QWidget *parent = 0) :
VcsBaseEditorParameterWidget(parent)
{
mapSetting(addToggleButton(QLatin1String("--verbose"), tr("Verbose"),
tr("Show files changed in each revision.")),
settings->boolPointer(BazaarSettings::logVerboseKey));
settings.boolPointer(BazaarSettings::logVerboseKey));
mapSetting(addToggleButton(QLatin1String("--forward"), tr("Forward"),
tr("Show from oldest to newest.")),
settings->boolPointer(BazaarSettings::logForwardKey));
settings.boolPointer(BazaarSettings::logForwardKey));
mapSetting(addToggleButton(QLatin1String("--include-merges"), tr("Include Merges"),
tr("Show merged revisions.")),
settings->boolPointer(BazaarSettings::logIncludeMergesKey));
settings.boolPointer(BazaarSettings::logIncludeMergesKey));
QList<ComboBoxItem> logChoices;
logChoices << ComboBoxItem(tr("Detailed"), QLatin1String("long"))
......@@ -114,28 +114,23 @@ public:
<< ComboBoxItem(tr("One Line"), QLatin1String("line"))
<< ComboBoxItem(tr("GNU Change Log"), QLatin1String("gnu-changelog"));
mapSetting(addComboBox(QStringList(QLatin1String("--log-format=%1")), logChoices),
settings->stringPointer(BazaarSettings::logFormatKey));
settings.stringPointer(BazaarSettings::logFormatKey));
}
};
BazaarClient::BazaarClient(BazaarSettings *settings) :
VcsBaseClient(settings)
BazaarClient::BazaarClient() :
VcsBaseClient(new BazaarSettings)
{
setDiffParameterWidgetCreator([=] { return new BazaarDiffParameterWidget(settings); });
setLogParameterWidgetCreator([=] { return new BazaarLogParameterWidget(settings); });
}
BazaarSettings *BazaarClient::settings() const
{
return dynamic_cast<BazaarSettings *>(VcsBaseClient::settings());
setDiffParameterWidgetCreator([this] { return new BazaarDiffParameterWidget(settings()); });
setLogParameterWidgetCreator([this] { return new BazaarLogParameterWidget(settings()); });
}
bool BazaarClient::synchronousSetUserId()
{
QStringList args;
args << QLatin1String("whoami")
<< (settings()->stringValue(BazaarSettings::userNameKey) + QLatin1String(" <")
+ settings()->stringValue(BazaarSettings::userEmailKey) + QLatin1Char('>'));
<< (settings().stringValue(BazaarSettings::userNameKey) + QLatin1String(" <")
+ settings().stringValue(BazaarSettings::userEmailKey) + QLatin1Char('>'));
QByteArray stdOut;
return vcsFullySynchronousExec(QDir::currentPath(), args, &stdOut);
}
......
......@@ -44,9 +44,7 @@ class BazaarClient : public VcsBase::VcsBaseClient
Q_OBJECT
public:
BazaarClient(BazaarSettings *settings);
BazaarSettings *settings() const;
BazaarClient();
bool synchronousSetUserId();
BranchInfo synchronousBranchQuery(const QString &repositoryRoot) const;
......
......@@ -71,7 +71,7 @@ bool BazaarControl::managesFile(const QString &workingDirectory, const QString &
bool BazaarControl::isConfigured() const
{
const Utils::FileName binary = m_bazaarClient->settings()->binaryPath();
const Utils::FileName binary = m_bazaarClient->vcsBinary();
if (binary.isEmpty())
return false;
QFileInfo fi = binary.toFileInfo();
......@@ -148,8 +148,3 @@ void BazaarControl::changed(const QVariant &v)
break;
}
}
void BazaarControl::emitConfigurationChanged()
{
emit configurationChanged();
}
......@@ -69,7 +69,6 @@ public slots:
// files changed signals according to the variant's type:
// String -> repository, StringList -> files
void changed(const QVariant &);
void emitConfigurationChanged();
private:
BazaarClient *m_bazaarClient;
......
......@@ -165,12 +165,14 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
Context context(Constants::BAZAAR_CONTEXT);
m_client = new BazaarClient(&m_bazaarSettings);
m_client = new BazaarClient;
auto vcsCtrl = new BazaarControl(m_client);
initializeVcs(vcsCtrl, context);
addAutoReleasedObject(new OptionsPage);
m_bazaarSettings.readSettings(ICore::settings());
auto options = new OptionsPage;
connect(options, &OptionsPage::settingsChanged,
vcsCtrl, &Core::IVersionControl::configurationChanged);
addAutoReleasedObject(options);
connect(m_client, &VcsBaseClient::changed, vcsCtrl, &BazaarControl::changed);
......@@ -214,22 +216,6 @@ BazaarClient *BazaarPlugin::client() const
return m_client;
}
const BazaarSettings &BazaarPlugin::settings() const
{
return m_bazaarSettings;
}
void BazaarPlugin::setSettings(const BazaarSettings &settings)
{
if (settings != m_bazaarSettings) {
const bool userIdChanged = !m_bazaarSettings.sameUserId(settings);
m_bazaarSettings = settings;
if (userIdChanged)
client()->synchronousSetUserId();
static_cast<BazaarControl *>(versionControl())->emitConfigurationChanged();
}
}
void BazaarPlugin::createMenu(const Context &context)
{
// Create menu item for Bazaar
......@@ -402,7 +388,7 @@ void BazaarPlugin::logRepository()
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
QStringList extraOptions;
extraOptions += QLatin1String("--limit=") + QString::number(settings().intValue(BazaarSettings::logCountKey));
extraOptions += QLatin1String("--limit=") + QString::number(m_client->settings().intValue(BazaarSettings::logCountKey));
m_client->log(state.topLevel(), QStringList(), extraOptions);
}
......@@ -606,9 +592,10 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &stat
commitEditor->document()->setPreferredDisplayName(msg);
const BranchInfo branch = m_client->synchronousBranchQuery(m_submitRepository);
const VcsBaseClientSettings &s = m_client->settings();
commitEditor->setFields(m_submitRepository, branch,
m_bazaarSettings.stringValue(BazaarSettings::userNameKey),
m_bazaarSettings.stringValue(BazaarSettings::userEmailKey), status);
s.stringValue(BazaarSettings::userNameKey),
s.stringValue(BazaarSettings::userEmailKey), status);
}
void BazaarPlugin::diffFromEditorSelected(const QStringList &files)
......
......@@ -70,9 +70,6 @@ public:
static BazaarPlugin *instance();
BazaarClient *client() const;
const BazaarSettings &settings() const;
void setSettings(const BazaarSettings &settings);
private slots:
// File menu action slots
void addCurrentFile();
......
......@@ -79,7 +79,7 @@ VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir)
if (!cwp)
return 0;
const BazaarSettings &settings = BazaarPlugin::instance()->settings();
const VcsBaseClientSettings &settings = BazaarPlugin::instance()->client()->settings();
*checkoutDir = Utils::FileName::fromString(cwp->path() + QLatin1Char('/') + cwp->directory());
const CloneOptionsPanel *panel = cwp->cloneOptionsPanel();
......
......@@ -28,6 +28,7 @@
**
****************************************************************************/
#include "optionspage.h"
#include "bazaarclient.h"
#include "bazaarsettings.h"
#include "bazaarplugin.h"
......@@ -38,6 +39,7 @@
using namespace Bazaar::Internal;
using namespace Bazaar;
using namespace VcsBase;
OptionsPageWidget::OptionsPageWidget(QWidget *parent)
: QWidget(parent)
......@@ -48,9 +50,9 @@ OptionsPageWidget::OptionsPageWidget(QWidget *parent)
m_ui.commandChooser->setHistoryCompleter(QLatin1String("Bazaar.Command.History"));
}
BazaarSettings OptionsPageWidget::settings() const
VcsBaseClientSettings OptionsPageWidget::settings() const
{
BazaarSettings s = BazaarPlugin::instance()->settings();
VcsBaseClientSettings s = BazaarPlugin::instance()->client()->settings();
s.setValue(BazaarSettings::binaryPathKey, m_ui.commandChooser->rawPath());
s.setValue(BazaarSettings::userNameKey, m_ui.defaultUsernameLineEdit->text().trimmed());
s.setValue(BazaarSettings::userEmailKey, m_ui.defaultEmailLineEdit->text().trimmed());
......@@ -59,7 +61,7 @@ BazaarSettings OptionsPageWidget::settings() const
return s;
}
void OptionsPageWidget::setSettings(const BazaarSettings &s)
void OptionsPageWidget::setSettings(const VcsBaseClientSettings &s)
{
m_ui.commandChooser->setPath(s.stringValue(BazaarSettings::binaryPathKey));
m_ui.defaultUsernameLineEdit->setText(s.stringValue(BazaarSettings::userNameKey));
......@@ -78,7 +80,7 @@ QWidget *OptionsPage::widget()
{
if (!m_optionsPageWidget)
m_optionsPageWidget = new OptionsPageWidget;
m_optionsPageWidget->setSettings(BazaarPlugin::instance()->settings());
m_optionsPageWidget->setSettings(BazaarPlugin::instance()->client()->settings());
return m_optionsPageWidget;
}
......@@ -87,11 +89,10 @@ void OptionsPage::apply()
if (!m_optionsPageWidget)
return;
BazaarPlugin *plugin = BazaarPlugin::instance();
const BazaarSettings newSettings = m_optionsPageWidget->settings();
if (newSettings != plugin->settings()) {
//assume success and emit signal that settings are changed;
plugin->setSettings(newSettings);
newSettings.writeSettings(Core::ICore::settings());
const VcsBaseClientSettings newSettings = m_optionsPageWidget->settings();
VcsBaseClientSettings &s = plugin->client()->settings();
if (newSettings != s) {
s = newSettings;
emit settingsChanged();
}
}
......@@ -37,11 +37,13 @@
#include <QWidget>
#include <QPointer>
namespace VcsBase {
class VcsBaseClientSettings;
} // namespace VcsBase
namespace Bazaar {
namespace Internal {
class BazaarSettings;
class OptionsPageWidget : public QWidget
{
Q_OBJECT
......@@ -49,8 +51,8 @@ class OptionsPageWidget : public QWidget
public:
explicit OptionsPageWidget(QWidget *parent = 0);
BazaarSettings settings() const;
void setSettings(const BazaarSettings &s);
VcsBase::VcsBaseClientSettings settings() const;
void setSettings(const VcsBase::VcsBaseClientSettings &s);
private:
Ui::OptionsPage m_ui;
......
......@@ -30,6 +30,7 @@
#include "checkoutwizard.h"
#include "checkoutwizardpage.h"
#include "cvsclient.h"
#include "cvsplugin.h"
#include <coreplugin/iversioncontrol.h>
......@@ -72,7 +73,7 @@ VcsCommand *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
}
QTC_ASSERT(cwp, return 0);
const CvsSettings settings = CvsPlugin::instance()->settings();
const CvsSettings settings = CvsPlugin::instance()->client()->settings();
const Utils::FileName binary = settings.binaryPath();
QStringList args;
......
......@@ -70,40 +70,41 @@ class CvsDiffParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
explicit CvsDiffParameterWidget(CvsSettings *settings, QWidget *parent = 0);
explicit CvsDiffParameterWidget(VcsBaseClientSettings &settings, QWidget *parent = 0);
QStringList arguments() const;
private:
const CvsSettings *m_settings;
VcsBaseClientSettings &m_settings;
};
CvsDiffParameterWidget::CvsDiffParameterWidget(CvsSettings *settings, QWidget *parent)
: VcsBaseEditorParameterWidget(parent),
m_settings(settings)
CvsDiffParameterWidget::CvsDiffParameterWidget(VcsBaseClientSettings &settings,
QWidget *parent) :
VcsBaseEditorParameterWidget(parent),
m_settings(settings)
{
mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore Whitespace")),
settings->boolPointer(CvsSettings::diffIgnoreWhiteSpaceKey));
settings.boolPointer(CvsSettings::diffIgnoreWhiteSpaceKey));
mapSetting(addToggleButton(QLatin1String("-B"), tr("Ignore Blank Lines")),
settings->boolPointer(CvsSettings::diffIgnoreBlankLinesKey));
settings.boolPointer(CvsSettings::diffIgnoreBlankLinesKey));
}
QStringList CvsDiffParameterWidget::arguments() const
{
QStringList args;
args = m_settings->stringValue(CvsSettings::diffOptionsKey).split(QLatin1Char(' '), QString::SkipEmptyParts);
args = m_settings.stringValue(CvsSettings::diffOptionsKey).split(QLatin1Char(' '),
QString::SkipEmptyParts);
args += VcsBaseEditorParameterWidget::arguments();
return args;
}
CvsClient::CvsClient(CvsSettings *settings) :
VcsBaseClient(settings)
CvsClient::CvsClient() : VcsBaseClient(new CvsSettings)
{
setDiffParameterWidgetCreator([=] { return new CvsDiffParameterWidget(settings); });
setDiffParameterWidgetCreator([this] { return new CvsDiffParameterWidget(settings()); });
}
CvsSettings *CvsClient::settings() const
CvsSettings &CvsClient::settings() const
{
return dynamic_cast<CvsSettings *>(VcsBaseClient::settings());
return static_cast<CvsSettings &>(VcsBaseClient::settings());
}
Core::Id CvsClient::vcsEditorKind(VcsCommandTag cmd) const
......
......@@ -44,9 +44,9 @@ class CvsClient : public VcsBase::VcsBaseClient
Q_OBJECT
public:
CvsClient(CvsSettings *settings);
CvsClient();
CvsSettings *settings() const;
CvsSettings &settings() const;
void diff(const QString &workingDir, const QStringList &files,
const QStringList &extraOptions = QStringList());
QString findTopLevelForFile(const QFileInfo &file) const;
......
......@@ -29,6 +29,8 @@
****************************************************************************/
#include "cvscontrol.h"
#include "cvsclient.h"
#include "cvsplugin.h"
#include "cvssettings.h"
......@@ -58,7 +60,7 @@ Core::Id CvsControl::id() const
bool CvsControl::isConfigured() const
{
const Utils::FileName binary = m_plugin->settings().binaryPath();
const Utils::FileName binary = m_plugin->client()->vcsBinary();
if (binary.isEmpty())
return false;
QFileInfo fi = binary.toFileInfo();
......@@ -149,8 +151,3 @@ void CvsControl::emitFilesChanged(const QStringList &l)
{
emit filesChanged(l);
}
void CvsControl::emitConfigurationChanged()
{
emit configurationChanged();
}
......@@ -65,7 +65,6 @@ public:
void emitRepositoryChanged(const QString &s);
void emitFilesChanged(const QStringList &l);
void emitConfigurationChanged();
private:
CvsPlugin *m_plugin;
......
......@@ -211,6 +211,12 @@ CvsPlugin::~CvsPlugin()
cleanCommitMessageFile();
}
CvsClient *CvsPlugin::client() const
{
QTC_CHECK(m_client);
return m_client;
}
void CvsPlugin::cleanCommitMessageFile()
{
if (!m_commitMessageFileName.isEmpty()) {
......@@ -246,9 +252,11 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
Utils::MimeDatabase::addMimeTypes(QLatin1String(":/trolltech.cvs/CVS.mimetypes.xml"));
m_settings.readSettings(ICore::settings());
m_client = new CvsClient(&m_settings);
m_client = new CvsClient;
auto options = new SettingsPage;
connect(options, &SettingsPage::settingsChanged,
versionControl(), &IVersionControl::configurationChanged);
addAutoReleasedObject(new SettingsPage);
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
......@@ -503,12 +511,11 @@ bool CvsPlugin::submitEditorAboutToClose()
// Prompt user. Force a prompt unless submit was actually invoked (that
// is, the editor was closed or shutdown).
CvsSettings newSettings = m_settings;
const VcsBaseSubmitEditor::PromptSubmitResult answer =
editor->promptSubmit(tr("Closing CVS Editor"),
tr("Do you want to commit the change?"),
tr("The commit message check failed. Do you want to commit the change?"),
newSettings.boolPointer(CvsSettings::promptOnSubmitKey),
client()->settings().boolPointer(CvsSettings::promptOnSubmitKey),
!m_submitActionTriggered);
m_submitActionTriggered = false;
switch (answer) {
......@@ -520,7 +527,6 @@ bool CvsPlugin::submitEditorAboutToClose()
default:
break;
}
setSettings(newSettings); // in case someone turned prompting off
const QStringList fileList = editor->checkedFiles();
bool closeEditor = true;
if (!fileList.empty()) {
......@@ -617,7 +623,7 @@ void CvsPlugin::revertAll()
QStringList args;
args << QLatin1String("update") << QLatin1String("-C") << state.topLevel();
const CvsResponse revertResponse =
runCvs(state.topLevel(), args, m_settings.timeOutMs(),
runCvs(state.topLevel(), args, client()->vcsTimeout(),
SshPasswordPrompt|ShowStdOutInLogWindow);
if (revertResponse.result == CvsResponse::Ok)
cvsVersionControl()->emitRepositoryChanged(state.topLevel());
......@@ -633,7 +639,7 @@ void CvsPlugin::revertCurrentFile()
QStringList args;
args << QLatin1String("diff") << state.relativeCurrentFile();
const CvsResponse diffResponse =
runCvs(state.currentFileTopLevel(), args, m_settings.timeOutMs(), 0);
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeout(), 0);
switch (diffResponse.result) {
case CvsResponse::Ok:
return; // Not modified, diff exit code 0
......@@ -655,7 +661,7 @@ void CvsPlugin::revertCurrentFile()
args.clear();
args << QLatin1String("update") << QLatin1String("-C") << state.relativeCurrentFile();
const CvsResponse revertResponse =
runCvs(state.currentFileTopLevel(), args, m_settings.timeOutMs(),
runCvs(state.currentFileTopLevel(), args, client()->vcsTimeout(),
SshPasswordPrompt|ShowStdOutInLogWindow);
if (revertResponse.result == CvsResponse::Ok)
cvsVersionControl()->emitFilesChanged(QStringList(state.currentFile()));
......@@ -717,7 +723,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
// where we are, so, have stdout/stderr channels merged.
QStringList args = QStringList(QLatin1String("status"));
const CvsResponse response =
runCvs(workingDir, args, m_settings.timeOutMs(), MergeOutputChannels);
runCvs(workingDir, args, client()->vcsTimeout(), MergeOutputChannels);
if (response.result != CvsResponse::Ok)
return;
// Get list of added/modified/deleted files and purge out undesired ones
......@@ -765,7 +771,7 @@ bool CvsPlugin::commit(const QString &messageFile,
args << QLatin1String("-F") << messageFile;
args.append(fileList);
const CvsResponse response =
runCvs(m_commitRepository, args, 10 * m_settings.timeOutMs(),
runCvs(m_commitRepository, args, 10 * client()->vcsTimeout(),
SshPasswordPrompt|ShowStdOutInLogWindow);
return response.result == CvsResponse::Ok ;
}
......@@ -803,7 +809,7 @@ void CvsPlugin::filelog(const QString &workingDir,
args << QLatin1String("log");
args.append(file);
const CvsResponse response =
runCvs(workingDir, args, m_settings.timeOutMs(),
runCvs(workingDir, args, client()->vcsTimeout(),
SshPasswordPrompt, codec);
if (response.result != CvsResponse::Ok)
return;
......@@ -844,7 +850,7 @@ bool CvsPlugin::update(const QString &topLevel, const QString &file)
if (!file.isEmpty())
args.append(file);
const CvsResponse response =
runCvs(topLevel, args, 10 * m_settings.timeOutMs(),
runCvs(topLevel, args, 10 * client()->vcsTimeout(),
SshPasswordPrompt|ShowStdOutInLogWindow);
const bool ok = response.result == CvsResponse::Ok;
if (ok)
......@@ -891,7 +897,7 @@ bool CvsPlugin::edit(const QString &topLevel, const QStringList &files)
QStringList args(QLatin1String("edit"));
args.append(files);
const CvsResponse response =
runCvs(topLevel, args, m_settings.timeOutMs(),
runCvs(topLevel, args, client()->vcsTimeout(),
ShowStdOutInLogWindow|SshPasswordPrompt);
return response.result == CvsResponse::Ok;
}
......@@ -903,7 +909,7 @@ bool CvsPlugin::diffCheckModified(const QString &topLevel, const QStringList &fi
QStringList args(QLatin1String("-q"));
args << QLatin1String("diff");
args.append(files);
const CvsResponse response = runCvs(topLevel, args, m_settings.timeOutMs(), 0);
const CvsResponse response = runCvs(topLevel, args, client()->vcsTimeout(), 0);
if (response.result == CvsResponse::OtherError)
return false;
*modified = response.result == CvsResponse::NonNullExitCode;
......@@ -931,7 +937,7 @@ bool CvsPlugin::unedit(const QString &topLevel, const QStringList &files)
args.append(QLatin1String("-y"));
args.append(files);
const CvsResponse response =
runCvs(topLevel, args, m_settings.timeOutMs(),
runCvs(topLevel, args, client()->vcsTimeout(),
ShowStdOutInLogWindow|SshPasswordPrompt);
return response.result == CvsResponse::Ok;
}
......@@ -950,7 +956,7 @@ void CvsPlugin::annotate(const QString &workingDir, const QString &file,
args << QLatin1String("-r") << revision;
args << file;
const CvsResponse response =
runCvs(workingDir, args, m_settings.timeOutMs(),
runCvs(workingDir, args, client()->vcsTimeout(),
SshPasswordPrompt, codec);
if (response.result != CvsResponse::Ok)
return;
......@@ -979,7 +985,7 @@ bool CvsPlugin::status(const QString &topLevel, const QString &file, const QStri
if (!file.isEmpty())
args.append(file);
const CvsResponse response =
runCvs(topLevel, args, m_settings.timeOutMs(), 0);
runCvs(topLevel, args, client()->vcsTimeout(), 0);
const bool ok = response.result == CvsResponse::Ok;
if (ok)
showOutputInEditor(title, response.stdOut, OtherContent, topLevel, 0);
......@@ -1062,7 +1068,7 @@ bool CvsPlugin::describe(const QString &toplevel, const QString &file, const
QStringList args;
args << QLatin1String("log") << (QLatin1String("-r") + changeNr) << file;
const CvsResponse logResponse =
runCvs(toplevel, args, m_settings.timeOutMs(), SshPasswordPrompt);
runCvs(toplevel, args, client()->vcsTimeout(), SshPasswordPrompt);
if (logResponse.result != CvsResponse::Ok) {
*errorMessage = logResponse.message;
return false;
......@@ -1072,7 +1078,7 @@ bool CvsPlugin::describe(const QString &toplevel, const QString &file, const
*errorMessage = msgLogParsingFailed();
return false;
}
if (m_settings.boolValue(CvsSettings::describeByCommitIdKey)) {
if (client()->settings().boolValue(CvsSettings::describeByCommitIdKey)) {
// Run a log command over the repo, filtering by the commit date
// and commit id, collecting all files touched by the commit.
const QString commitId = fileLog.front().revisions.front().commitId;
......@@ -1084,7 +1090,7 @@ bool CvsPlugin::describe(const QString &toplevel, const QString &file, const
args << QLatin1String("log") << QLatin1String("-d") << (dateS + QLatin1Char('<') + nextDayS);
const CvsResponse repoLogResponse =
runCvs(toplevel, args, 10 * m_settings.timeOutMs(), SshPasswordPrompt);
runCvs(toplevel, args, 10 * client()->vcsTimeout(), SshPasswordPrompt);
if (repoLogResponse.result != CvsResponse::Ok) {
*errorMessage = repoLogResponse.message;
return false;
......@@ -1121,7 +1127,7 @@ bool CvsPlugin::describe(const QString &repositoryPath,
QStringList args(QLatin1String("log"));
args << (QLatin1String("-r") + it->revisions.front().revision) << it->file;
const CvsResponse logResponse =
runCvs(repositoryPath, args, m_settings.timeOutMs(), SshPasswordPrompt);
runCvs(repositoryPath, args, client()->vcsTimeout(), SshPasswordPrompt);
if (logResponse.result != CvsResponse::Ok) {
*errorMessage = logResponse.message;
return false;
......@@ -1134,11 +1140,11 @@ bool CvsPlugin::describe(const QString &repositoryPath,
if (!isFirstRevision(revision)) {
const QString previousRev = previousRevision(revision);
QStringList args(QLatin1String("diff"));
args << m_settings.stringValue(CvsSettings::diffOptionsKey) << QLatin1String("-r") << previousRev
<< QLatin1String("-r") << it->revisions.front().revision