diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-03-26 12:22:29 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-04-08 09:30:44 +0000 |
commit | 90ce38da39ba7acf6f7883a86916abcfc7efe23c (patch) | |
tree | 48a34950ff0b1a64d1f052ede5609e3a949837fc /src/plugins/git/gitplugin.cpp | |
parent | d3100774f9b2b342fe36b9b3d213934f79e96b64 (diff) | |
download | qt-creator-90ce38da39ba7acf6f7883a86916abcfc7efe23c.tar.gz |
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: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r-- | src/plugins/git/gitplugin.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 3e2f1b8c28..5755352c52 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -274,14 +274,15 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) Context context(Constants::GIT_CONTEXT); - m_settings.readSettings(ICore::settings()); - - m_gitClient = new GitClient(&m_settings); + m_gitClient = new GitClient; initializeVcs(new GitVersionControl(m_gitClient), context); // Create the settings Page - addAutoReleasedObject(new SettingsPage()); + SettingsPage *options = new SettingsPage; + connect(options, &SettingsPage::settingsChanged, + versionControl(), &IVersionControl::configurationChanged); + addAutoReleasedObject(options); static const char *describeSlot = SLOT(show(QString,QString)); const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]); @@ -1109,7 +1110,7 @@ void GitPlugin::pull() const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); QString topLevel = state.topLevel(); - bool rebase = m_settings.boolValue(GitSettings::pullRebaseKey); + bool rebase = gitClient()->settings().boolValue(GitSettings::pullRebaseKey); if (!rebase) { QString currentBranch = m_gitClient->synchronousCurrentLocalBranch(topLevel); @@ -1415,26 +1416,11 @@ void GitPlugin::updateBranches(const QString &repository) void GitPlugin::updateRepositoryBrowserAction() { const bool repositoryEnabled = currentState().hasTopLevel(); - const bool hasRepositoryBrowserCmd = !m_settings.stringValue(GitSettings::repositoryBrowserCmd).isEmpty(); + const bool hasRepositoryBrowserCmd + = !gitClient()->settings().stringValue(GitSettings::repositoryBrowserCmd).isEmpty(); m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd); } -const GitSettings &GitPlugin::settings() const -{ - return m_settings; -} - -void GitPlugin::setSettings(const GitSettings &s) -{ - if (s == m_settings) - return; - - m_settings = s; - m_gitClient->saveSettings(); - static_cast<GitVersionControl *>(versionControl())->emitConfigurationChanged(); - updateRepositoryBrowserAction(); -} - GitClient *GitPlugin::gitClient() const { return m_gitClient; |