diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-11-16 12:05:34 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-11-17 10:57:07 +0100 |
commit | a4b4728267ce81880d0fbde6b8c559e3a762d091 (patch) | |
tree | cac57389e4f61fa81f6436cb1e6f3aa31f2f39fe /src/plugins/vcsbase | |
parent | 17c92cdeef9e76ae4f5ff2643b98aa2c8d81f071 (diff) | |
download | qt-creator-a4b4728267ce81880d0fbde6b8c559e3a762d091.tar.gz |
VCS: Rework disabling of ambiguous actions
Task-number: QTCREATORBUG-13364
Change-Id: Ib9dc98964983f1a2808a89d90969089a09d2b55e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.cpp | 6 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 2dcae7c161..6a2662873a 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -529,6 +529,7 @@ public: QPointer<VcsBaseSubmitEditor> m_submitEditor; Core::IVersionControl *m_versionControl; + Core::Context m_context; VcsBasePluginState m_state; int m_actionState; @@ -558,9 +559,10 @@ VcsBasePlugin::~VcsBasePlugin() delete d; } -void VcsBasePlugin::initializeVcs(Core::IVersionControl *vc) +void VcsBasePlugin::initializeVcs(Core::IVersionControl *vc, const Core::Context &context) { d->m_versionControl = vc; + d->m_context = context; addAutoReleasedObject(vc); Internal::VcsPlugin *plugin = Internal::VcsPlugin::instance(); @@ -609,6 +611,7 @@ void VcsBasePlugin::slotStateChanged(const VcsBase::Internal::State &newInternal if (!d->m_state.equals(newInternalState)) { d->m_state.setState(newInternalState); updateActions(VcsEnabled); + Core::ICore::addAdditionalContext(d->m_context); } } else { // Some other VCS plugin or state changed: Reset us to empty state. @@ -619,6 +622,7 @@ void VcsBasePlugin::slotStateChanged(const VcsBase::Internal::State &newInternal d->m_state = emptyState; updateActions(newActionState); } + Core::ICore::removeAdditionalContext(d->m_context); } } diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h index ecc32534b7..789a953250 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.h +++ b/src/plugins/vcsbase/vcsbaseplugin.h @@ -48,6 +48,7 @@ QT_END_NAMESPACE namespace Utils { struct SynchronousProcessResponse; } namespace Core { +class Context; class IVersionControl; class Id; class IDocument; @@ -131,7 +132,7 @@ class VCSBASE_EXPORT VcsBasePlugin : public ExtensionSystem::IPlugin protected: explicit VcsBasePlugin(); - void initializeVcs(Core::IVersionControl *vc); + void initializeVcs(Core::IVersionControl *vc, const Core::Context &context); virtual void extensionsInitialized(); public: |