Commit 363b230a authored by Tobias Hunger's avatar Tobias Hunger
Browse files

git: Reuse more code from vcsbase

Change-Id: I873d2caa2cead5c339eec887a5fcdef4d33bec24
Reviewed-on: http://codereview.qt-project.org/6071

Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent f6068c1f
......@@ -144,7 +144,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(
const QString checkoutDir = directory();
*checkoutPath = workingDirectory + QLatin1Char('/') + checkoutDir;
const QString binary = client->binary();
const QString binary = client->gitBinaryPath();
VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob;
const QProcessEnvironment env = client->processEnvironment();
......
This diff is collapsed.
......@@ -38,6 +38,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtGui/QWidget>
......@@ -79,9 +80,13 @@ class GitClient : public QObject
public:
static const char *stashNamePrefix;
explicit GitClient(GitPlugin *plugin);
explicit GitClient(GitSettings *settings);
~GitClient();
QString gitBinaryPath(bool *ok = 0, QString *errorMessage = 0) const;
unsigned gitVersion(bool silent, QString *errorMessage = 0) const;
QString gitVersionString(bool silent, QString *errorMessage = 0) const;
static QString findRepositoryForDirectory(const QString &dir);
void diff(const QString &workingDirectory, const QStringList &diffArgs, const QString &fileName);
......@@ -94,7 +99,7 @@ public:
void status(const QString &workingDirectory);
void graphLog(const QString &workingDirectory) { graphLog(workingDirectory, QString()); }
void graphLog(const QString &workingDirectory, const QString &branch);
void log(const QString &workingDirectory, const QStringList &fileNames,
void log(const QString &workingDirectory, const QStringList &fileNames = QStringList(),
bool enableAnnotationContextMenu = false);
void blame(const QString &workingDirectory, const QStringList &args, const QString &fileName,
const QString &revision = QString(), int lineNumber = -1);
......@@ -160,10 +165,6 @@ public:
QStringList *descriptions, QString *errorMessage);
bool synchronousTopRevision(const QString &workingDirectory, QString *revision = 0,
QString *branch = 0, QString *errorMessage = 0);
// determine version as '(major << 16) + (minor << 8) + patch' or 0
// with some smart caching.
unsigned gitVersion(bool silent, QString *errorMessage = 0);
QString gitVersionString(bool silent, QString *errorMessage = 0);
bool cloneRepository(const QString &directory, const QByteArray &url);
QString vcsGetRepositoryURL(const QString &directory);
......@@ -218,12 +219,9 @@ public:
void launchGitK(const QString &workingDirectory);
QStringList synchronousRepositoryBranches(const QString &repositoryURL);
GitSettings settings() const;
void setSettings(const GitSettings &s);
GitSettings *settings() const;
QString binary() const; // Executable + basic arguments
QProcessEnvironment processEnvironment() const;
static QString fakeWinHome(const QProcessEnvironment &e);
static QString msgNoChangedFiles();
......@@ -249,13 +247,13 @@ private:
GitCommand *createCommand(const QString &workingDirectory,
VCSBase::VCSBaseEditorWidget* editor = 0,
bool outputToWindow = false,
bool useOutputToWindow = false,
int editorLineNumber = -1);
GitCommand *executeGit(const QString &workingDirectory,
const QStringList &arguments,
VCSBase::VCSBaseEditorWidget* editor = 0,
bool outputToWindow = false,
bool useOutputToWindow = false,
GitCommand::TerminationReportMode tm = GitCommand::NoReport,
int editorLineNumber = -1,
bool unixTerminalDisabled = false);
......@@ -265,7 +263,7 @@ private:
const QStringList &arguments,
QByteArray* outputText,
QByteArray* errorText,
bool logCommandToWindow = true);
bool logCommandToWindow = true) const;
// Synchronous git execution using Utils::SynchronousProcess, with
// log windows updating (using VCSBasePlugin::runVCS with flags).
......@@ -274,7 +272,7 @@ private:
unsigned flags = 0, QTextCodec *outputCodec = 0);
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
unsigned synchronousGitVersion(bool silent, QString *errorMessage = 0);
unsigned synchronousGitVersion(bool silent, QString *errorMessage = 0) const;
enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed };
RevertResult revertI(QStringList files,
......@@ -289,37 +287,12 @@ private:
const QString &gitBinDirectory,
bool silent);
mutable QString m_gitVersionForBinary;
mutable unsigned m_cachedGitVersion;
const QString m_msgWait;
GitPlugin *m_plugin;
Core::ICore *m_core;
GitSettings m_settings;
QString m_binaryPath;
Core::ICore *m_core;
QSignalMapper *m_repositoryChangedSignalMapper;
unsigned m_cachedGitVersion;
bool m_hasCachedGitVersion;
};
class BaseGitArgumentsWidget : public QWidget {
Q_OBJECT
public:
BaseGitArgumentsWidget(GitSettings *settings,
GitClient *client, const QString &directory,
const QStringList &args);
virtual QStringList arguments() const = 0;
public slots:
virtual void redoCommand() = 0;
protected slots:
virtual void testForArgumentsChanged() = 0;
protected:
GitClient *m_client;
const QString m_workingDirectory;
QStringList m_diffArgs;
GitSettings *m_settings;
};
......
......@@ -122,11 +122,6 @@ void GitCommand::execute()
QLatin1String("Git.action"));
}
QString GitCommand::msgTimeout(int seconds)
{
return tr("Error: Git timed out after %1s.").arg(seconds);
}
void GitCommand::run()
{
const unsigned processFlags = m_unixTerminalDisabled ?
......@@ -160,7 +155,7 @@ void GitCommand::run()
&stdOut, &stdErr, false)) {
Utils::SynchronousProcess::stopProcess(*process);
ok = false;
error += msgTimeout(timeOutSeconds);
error += tr("Error: Git timed out after %1s.").arg(timeOutSeconds);
break;
}
......@@ -233,6 +228,5 @@ QVariant GitCommand::cookie() const
return m_cookie;
}
} // namespace Internal
} // namespace Git
......@@ -73,8 +73,6 @@ public:
bool unixTerminalDisabled() const;
void setUnixTerminalDisabled(bool);
static QString msgTimeout(int seconds);
void setCookie(const QVariant &cookie);
QVariant cookie() const;
......
......@@ -57,7 +57,6 @@ const char * const GITSUBMITEDITOR_DISPLAY_NAME = QT_TRANSLATE_NOOP("VCS", "Git
const char * const SUBMIT_CURRENT = "Git.SubmitCurrentLog";
const char * const DIFF_SELECTED = "Git.DiffSelectedFilesInLog";
const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.git.submit";
const char * const GIT_BINARY = "git";
} // namespace Constants
} // namespace Git
......
......@@ -197,7 +197,7 @@ void GitEditor::setPlainTextDataFiltered(const QByteArray &a)
QByteArray array = a;
// If desired, filter out the date from annotation
const bool omitAnnotationDate = contentType() == VCSBase::AnnotateOutput
&& GitPlugin::instance()->settings().omitAnnotationDate;
&& GitPlugin::instance()->settings().boolValue(GitSettings::omitAnnotationDateKey);
if (omitAnnotationDate)
array = removeAnnotationDate(a);
setPlainTextData(array);
......
......@@ -44,6 +44,7 @@
#include "clonewizard.h"
#include "gitoriousclonewizard.h"
#include "stashdialog.h"
#include "settingspage.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......@@ -280,7 +281,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
Q_UNUSED(errorMessage)
m_core = Core::ICore::instance();
m_gitClient = new GitClient(this);
m_settings.readSettings(m_core->settings());
m_gitClient = new GitClient(&m_settings);
typedef VCSBase::VCSEditorFactory<GitEditor> GitEditorFactory;
typedef VCSBase::VCSSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory;
......@@ -753,13 +756,12 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
return true;
// Prompt user. Force a prompt unless submit was actually invoked (that
// is, the editor was closed or shutdown).
GitSettings settings = m_gitClient->settings();
const bool wantedPrompt = settings.promptToSubmit;
bool *promptData = m_settings.boolPointer(GitSettings::promptOnSubmitKey);
const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer =
editor->promptSubmit(tr("Closing Git Editor"),
tr("Do you want to commit the change?"),
tr("Git will not accept this commit. Do you want to continue to edit it?"),
&settings.promptToSubmit, !m_submitActionTriggered, false);
promptData, !m_submitActionTriggered, false);
m_submitActionTriggered = false;
switch (answer) {
case VCSBase::VCSBaseSubmitEditor::SubmitCanceled:
......@@ -770,8 +772,6 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
default:
break;
}
if (wantedPrompt != settings.promptToSubmit)
m_gitClient->setSettings(settings);
// Go ahead!
const QStringList fileList = editor->checkedFiles();
bool closeEditor = true;
......@@ -1059,14 +1059,18 @@ void GitPlugin::showCommit()
m_gitClient->show(m_changeSelectionDialog->repository(), change);
}
GitSettings GitPlugin::settings() const
const GitSettings &GitPlugin::settings() const
{
return m_gitClient->settings();
return m_settings;
}
void GitPlugin::setSettings(const GitSettings &s)
{
m_gitClient->setSettings(s);
if (s == m_settings)
return;
m_settings = s;
static_cast<GitVersionControl *>(versionControl())->emitConfigurationChanged();
}
GitClient *GitPlugin::gitClient() const
......
......@@ -33,7 +33,8 @@
#ifndef GITPLUGIN_H
#define GITPLUGIN_H
#include "settingspage.h"
#include "gitsettings.h"
#include "vcsbase/vcsbaseplugin.h"
#include <coreplugin/editormanager/ieditorfactory.h>
......@@ -69,13 +70,11 @@ namespace Locator {
namespace Git {
namespace Internal {
class GitPlugin;
class GitVersionControl;
class GitClient;
class ChangeSelectionDialog;
class GitSubmitEditor;
class CommitData;
class GitSettings;
class StashDialog;
class BranchDialog;
class RemoteDialog;
......@@ -99,7 +98,7 @@ public:
GitVersionControl *gitVersionControl() const;
GitSettings settings() const;
const GitSettings &settings() const;
void setSettings(const GitSettings &s);
GitClient *gitClient() const;
......@@ -213,6 +212,7 @@ private:
QString m_commitAmendSHA1;
bool m_submitActionTriggered;
GitSettings m_settings;
};
} // namespace Git
......
......@@ -31,105 +31,46 @@
**************************************************************************/
#include "gitsettings.h"
#include "gitconstants.h"
#include <utils/synchronousprocess.h>
#include <QtCore/QSettings>
#include <QtCore/QTextStream>
#include <QtCore/QCoreApplication>
static const char groupC[] = "Git";
static const char sysEnvKeyC[] = "SysEnv";
static const char pathKeyC[] = "Path";
static const char logCountKeyC[] = "LogCount";
static const char timeoutKeyC[] = "TimeOut";
static const char pullRebaseKeyC[] = "PullRebase";
static const char promptToSubmitKeyC[] = "PromptForSubmit";
static const char omitAnnotationDateKeyC[] = "OmitAnnotationDate";
static const char ignoreSpaceChangesBlameKeyC[] = "SpaceIgnorantBlame";
static const char ignoreSpaceChangesDiffKeyC[] = "SpaceIgnorantDiff";
static const char diffPatienceKeyC[] = "DiffPatience";
static const char winSetHomeEnvironmentKeyC[] = "WinSetHomeEnvironment";
static const char gitkOptionsKeyC[] = "GitKOptions";
static const char showPrettyFormatC[] = "DiffPrettyFormat";
enum {
defaultPullRebase = 0,
defaultLogCount = 100,
#ifdef Q_OS_WIN
defaultTimeOut = 60
#else
defaultTimeOut = 30
#endif
};
namespace Git {
namespace Internal {
GitSettings::GitSettings() :
adoptPath(false),
logCount(defaultLogCount),
timeoutSeconds(defaultTimeOut),
pullRebase(bool(defaultPullRebase)),
promptToSubmit(true),
omitAnnotationDate(false),
ignoreSpaceChangesInDiff(false),
ignoreSpaceChangesInBlame(true),
diffPatience(true),
winSetHomeEnvironment(false),
showPrettyFormat(5)
{
}
const QLatin1String GitSettings::adoptPathKey("SysEnv");
const QLatin1String GitSettings::pathKey("Path");
const QLatin1String GitSettings::pullRebaseKey("PullRebase");
const QLatin1String GitSettings::omitAnnotationDateKey("OmitAnnotationDate");
const QLatin1String GitSettings::ignoreSpaceChangesInDiffKey("SpaceIgnorantDiff");
const QLatin1String GitSettings::ignoreSpaceChangesInBlameKey("SpaceIgnorantBlame");
const QLatin1String GitSettings::diffPatienceKey("DiffPatience");
const QLatin1String GitSettings::winSetHomeEnvironmentKey("WinSetHomeEnvironment");
const QLatin1String GitSettings::showPrettyFormatKey("DiffPrettyFormat");
const QLatin1String GitSettings::gitkOptionsKey("GitKOptions");
void GitSettings::fromSettings(QSettings *settings)
GitSettings::GitSettings()
{
settings->beginGroup(QLatin1String(groupC));
adoptPath = settings->value(QLatin1String(sysEnvKeyC), false).toBool();
path = settings->value(QLatin1String(pathKeyC), QString()).toString();
logCount = settings->value(QLatin1String(logCountKeyC), defaultLogCount).toInt();
timeoutSeconds = settings->value(QLatin1String(timeoutKeyC), defaultTimeOut).toInt();
pullRebase = settings->value(QLatin1String(pullRebaseKeyC), bool(defaultPullRebase)).toBool();
promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
omitAnnotationDate = settings->value(QLatin1String(omitAnnotationDateKeyC), false).toBool();
ignoreSpaceChangesInDiff = settings->value(QLatin1String(ignoreSpaceChangesDiffKeyC), true).toBool();
ignoreSpaceChangesInBlame = settings->value(QLatin1String(ignoreSpaceChangesBlameKeyC), true).toBool();
diffPatience = settings->value(QLatin1String(diffPatienceKeyC), true).toBool();
winSetHomeEnvironment = settings->value(QLatin1String(winSetHomeEnvironmentKeyC), false).toBool();
gitkOptions = settings->value(QLatin1String(gitkOptionsKeyC)).toString();
showPrettyFormat = settings->value(QLatin1String(showPrettyFormatC), 5).toInt();
settings->endGroup();
}
setSettingsGroup(QLatin1String("Git"));
void GitSettings::toSettings(QSettings *settings) const
{
settings->beginGroup(QLatin1String(groupC));
settings->setValue(QLatin1String(sysEnvKeyC), adoptPath);
settings->setValue(QLatin1String(pathKeyC), path);
settings->setValue(QLatin1String(logCountKeyC), logCount);
settings->setValue(QLatin1String(timeoutKeyC), timeoutSeconds);
settings->setValue(QLatin1String(pullRebaseKeyC), pullRebase);
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
settings->setValue(QLatin1String(omitAnnotationDateKeyC), omitAnnotationDate);
settings->setValue(QLatin1String(ignoreSpaceChangesDiffKeyC), ignoreSpaceChangesInDiff);
settings->setValue(QLatin1String(ignoreSpaceChangesBlameKeyC), ignoreSpaceChangesInBlame);
settings->setValue(QLatin1String(diffPatienceKeyC), diffPatience);
settings->setValue(QLatin1String(winSetHomeEnvironmentKeyC), winSetHomeEnvironment);
settings->setValue(QLatin1String(gitkOptionsKeyC), gitkOptions);
settings->setValue(QLatin1String(showPrettyFormatC), showPrettyFormat);
settings->endGroup();
}
bool GitSettings::equals(const GitSettings &s) const
{
return adoptPath == s.adoptPath && path == s.path && logCount == s.logCount
&& timeoutSeconds == s.timeoutSeconds && promptToSubmit == s.promptToSubmit
&& pullRebase == s.pullRebase
&& omitAnnotationDate == s.omitAnnotationDate
&& ignoreSpaceChangesInBlame == s.ignoreSpaceChangesInBlame
&& ignoreSpaceChangesInDiff == s.ignoreSpaceChangesInDiff
&& diffPatience == s.diffPatience && winSetHomeEnvironment == s.winSetHomeEnvironment
&& gitkOptions == s.gitkOptions && showPrettyFormat == s.showPrettyFormat;
#ifdef Q_OS_WIN
declareKey(binaryPathKey, QLatin1String("git.exe"));
declareKey(timeoutKey, 60);
#else
declareKey(binaryPathKey, QLatin1String("git"));
declareKey(timeoutKey, 30);
#endif
declareKey(adoptPathKey, false);
declareKey(pathKey, QString());
declareKey(pullRebaseKey, false);
declareKey(omitAnnotationDateKey, false);
declareKey(ignoreSpaceChangesInDiffKey, true);
declareKey(ignoreSpaceChangesInBlameKey, true);
declareKey(diffPatienceKey, true);
declareKey(winSetHomeEnvironmentKey, false);
declareKey(gitkOptionsKey, QString());
declareKey(showPrettyFormatKey, 5);
}
QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
......@@ -140,22 +81,31 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
*ok = true;
if (errorMessage)
errorMessage->clear();
const QString binary = QLatin1String(Constants::GIT_BINARY);
QString currentPath = path;
// Easy, git is assumed to be elsewhere accessible
if (!adoptPath)
currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
// Search in path?
const QString pathBinary = Utils::SynchronousProcess::locateBinary(currentPath, binary);
if (pathBinary.isEmpty()) {
if (ok)
*ok = false;
if (errorMessage)
*errorMessage = QCoreApplication::translate("Git::Internal::GitSettings",
"The binary '%1' could not be located in the path '%2'").arg(binary, path);
return binary;
if (m_binaryPath.isEmpty()) {
const QString binary = stringValue(binaryPathKey);
QString currentPath = stringValue(pathKey);
// Easy, git is assumed to be elsewhere accessible
if (!boolValue(adoptPathKey))
currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
// Search in path?
m_binaryPath = Utils::SynchronousProcess::locateBinary(currentPath, binary);
if (m_binaryPath.isEmpty()) {
if (ok)
*ok = false;
if (errorMessage)
*errorMessage = QCoreApplication::translate("Git::Internal::GitSettings",
"The binary '%1' could not be located in the path '%2'")
.arg(binary, currentPath);
}
}
return pathBinary;
return m_binaryPath;
}
GitSettings &GitSettings::operator = (const GitSettings &s)
{
VCSBaseClientSettings::operator =(s);
m_binaryPath.clear();
}
} // namespace Internal
......
......@@ -33,49 +33,38 @@
#ifndef GITSETTINGS_H
#define GITSETTINGS_H
#include <QtCore/QStringList>
#include <vcsbase/vcsbaseclientsettings.h>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
#include <QtCore/QStringList>
namespace Git {
namespace Internal {
// Todo: Add user name and password?
class GitSettings
class GitSettings : public VCSBase::VCSBaseClientSettings
{
public:
GitSettings();
void fromSettings(QSettings *);
void toSettings(QSettings *) const;
static const QLatin1String adoptPathKey;
static const QLatin1String pathKey;
static const QLatin1String pullRebaseKey;
static const QLatin1String omitAnnotationDateKey;
static const QLatin1String ignoreSpaceChangesInDiffKey;
static const QLatin1String ignoreSpaceChangesInBlameKey;
static const QLatin1String diffPatienceKey;
static const QLatin1String winSetHomeEnvironmentKey;
static const QLatin1String showPrettyFormatKey;
static const QLatin1String gitkOptionsKey;
/** Return the full path to the git executable */
QString gitBinaryPath(bool *ok = 0, QString *errorMessage = 0) const;
bool equals(const GitSettings &s) const;
GitSettings &operator = (const GitSettings &s);
bool adoptPath;
QString path;
int logCount;
int timeoutSeconds;
bool pullRebase;
bool promptToSubmit;
bool omitAnnotationDate;
bool ignoreSpaceChangesInDiff;
bool ignoreSpaceChangesInBlame;
bool diffPatience;
bool winSetHomeEnvironment;
int showPrettyFormat;
QString gitkOptions;
private:
mutable QString m_binaryPath;
};
inline bool operator==(const GitSettings &p1, const GitSettings &p2)
{ return p1.equals(p2); }
inline bool operator!=(const GitSettings &p1, const GitSettings &p2)
{ return !p1.equals(p2); }
} // namespace Internal
} // namespace Git
......
......@@ -65,7 +65,7 @@ QString GitVersionControl::id() const
bool GitVersionControl::isConfigured() const
{
bool ok = false;
m_client->settings().gitBinaryPath(&ok);
m_client->gitBinaryPath(&ok);
return ok;
}
......
......@@ -70,27 +70,28 @@ SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
GitSettings SettingsPageWidget::settings() const
{
GitSettings rc;
rc.path = m_ui.pathLineEdit->text();
rc.adoptPath = m_ui.environmentGroupBox->isChecked() && !rc.path.isEmpty();
rc.logCount = m_ui.logCountSpinBox->value();
rc.timeoutSeconds = m_ui.timeoutSpinBox->value();
rc.pullRebase = m_ui.pullRebaseCheckBox->isChecked();
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
rc.winSetHomeEnvironment = m_ui.winHomeCheckBox->isChecked();
rc.gitkOptions = m_ui.gitkOptionsLineEdit->text().trimmed();
rc.setValue(GitSettings::pathKey, m_ui.pathLineEdit->text());
rc.setValue(GitSettings::adoptPathKey, m_ui.environmentGroupBox->isChecked()
&& !rc.stringValue(GitSettings::pathKey).isEmpty());
rc.setValue(GitSettings::logCountKey, m_ui.logCountSpinBox->value());
rc.setValue(GitSettings::timeoutKey, m_ui.timeoutSpinBox->value());
rc.setValue(GitSettings::pullRebaseKey, m_ui.pullRebaseCheckBox->isChecked());
rc.setValue(GitSettings::promptOnSubmitKey, m_ui.promptToSubmitCheckBox->isChecked());
rc.setValue(GitSettings::winSetHomeEnvironmentKey, m_ui.winHomeCheckBox->isChecked());
rc.setValue(GitSettings::gitkOptionsKey, m_ui.gitkOptionsLineEdit->text().trimmed());
return rc;
}
void SettingsPageWidget::setSettings(const GitSettings &s)
{
m_ui.environmentGroupBox->setChecked(s.adoptPath);
m_ui.pathLineEdit->setText(s.path);
m_ui.logCountSpinBox->setValue(s.logCount);
m_ui.timeoutSpinBox->setValue(s.timeoutSeconds);
m_ui.pullRebaseCheckBox->setChecked(s.pullRebase);
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
m_ui.winHomeCheckBox->setChecked(s.winSetHomeEnvironment);
m_ui.gitkOptionsLineEdit->setText(s.gitkOptions);
m_ui.environmentGroupBox->setChecked(s.boolValue(GitSettings::adoptPathKey));
m_ui.pathLineEdit->setText(s.stringValue(GitSettings::pathKey));
m_ui.logCountSpinBox->setValue(s.intValue(GitSettings::logCountKey));
m_ui.timeoutSpinBox->setValue(s.intValue(GitSettings::timeoutKey));
m_ui.pullRebaseCheckBox->setChecked(s.boolValue(GitSettings::pullRebaseKey));