forked from qt-creator/qt-creator
Vcs: Pass settings handles to settings pages more directly
Change-Id: I5fdec80de5678dd544713fc18335cbd805d7b9f4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -772,7 +772,7 @@ static inline void msgCannotRun(const QStringList &args, const QString &workingD
|
||||
|
||||
// ---------------- GitClient
|
||||
|
||||
GitClient::GitClient() : VcsBase::VcsBaseClientImpl(new GitSettings),
|
||||
GitClient::GitClient(GitSettings *settings) : VcsBase::VcsBaseClientImpl(settings),
|
||||
m_cachedGitVersion(0),
|
||||
m_disableEditor(false)
|
||||
{
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
PushAction m_pushAction = NoPush;
|
||||
};
|
||||
|
||||
explicit GitClient();
|
||||
explicit GitClient(GitSettings *settings);
|
||||
|
||||
Utils::FilePath vcsBinary() const override;
|
||||
unsigned gitVersion(QString *errorMessage = nullptr) const;
|
||||
|
||||
@@ -319,13 +319,13 @@ GitPluginPrivate::GitPluginPrivate()
|
||||
|
||||
Context context(Constants::GIT_CONTEXT);
|
||||
|
||||
m_gitClient = new GitClient;
|
||||
m_gitClient = new GitClient(&m_settings);
|
||||
|
||||
auto vc = new GitVersionControl(m_gitClient);
|
||||
initializeVcs(vc, context);
|
||||
|
||||
// Create the settings Page
|
||||
auto settingsPage = new SettingsPage(vc, this);
|
||||
auto settingsPage = new SettingsPage(vc, &m_settings, this);
|
||||
connect(settingsPage, &SettingsPage::settingsChanged,
|
||||
this, &GitPluginPrivate::updateRepositoryBrowserAction);
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ private:
|
||||
Utils::ParameterAction *m_applyCurrentFilePatchAction = nullptr;
|
||||
Gerrit::Internal::GerritPlugin *m_gerritPlugin = nullptr;
|
||||
|
||||
GitSettings m_settings;
|
||||
GitClient *m_gitClient = nullptr;
|
||||
QPointer<StashDialog> m_stashDialog;
|
||||
QPointer<BranchViewFactory> m_branchViewFactory;
|
||||
|
||||
@@ -123,8 +123,8 @@ void SettingsPageWidget::updateNoteField()
|
||||
|
||||
// -------- SettingsPage
|
||||
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, QObject *parent) :
|
||||
VcsClientOptionsPage(control, GitPluginPrivate::client(), parent)
|
||||
SettingsPage::SettingsPage(Core::IVersionControl *control, GitSettings *settings, QObject *parent) :
|
||||
VcsClientOptionsPage(control, settings, parent)
|
||||
{
|
||||
setId(VcsBase::Constants::VCS_ID_GIT);
|
||||
setDisplayName(SettingsPageWidget::tr("Git"));
|
||||
|
||||
@@ -30,10 +30,12 @@
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class GitSettings;
|
||||
|
||||
class SettingsPage final : public VcsBase::VcsClientOptionsPage
|
||||
{
|
||||
public:
|
||||
SettingsPage(Core::IVersionControl *control, QObject *parent);
|
||||
SettingsPage(Core::IVersionControl *control, GitSettings *settings, QObject *parent);
|
||||
void apply() final;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user