forked from qt-creator/qt-creator
VcsManager: Register IVersionControls with VcsManager
Get some more objects out of the pool. Change-Id: Id93021b712307c4777dc39b9d15aa18a46318885 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "vcsbase_global.h"
|
||||
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <QList>
|
||||
@@ -128,7 +130,14 @@ class VCSBASE_EXPORT VcsBasePlugin : public ExtensionSystem::IPlugin
|
||||
protected:
|
||||
explicit VcsBasePlugin();
|
||||
|
||||
void initializeVcs(Core::IVersionControl *vc, const Core::Context &context);
|
||||
template<class T, typename... Args>
|
||||
T *initializeVcs(const Core::Context &context, Args&&... args)
|
||||
{
|
||||
T *vc = Core::VcsManager::registerVersionControl<T>(std::forward<Args>(args)...);
|
||||
initializeVcs(vc, context);
|
||||
return vc;
|
||||
}
|
||||
|
||||
void extensionsInitialized() override;
|
||||
|
||||
public:
|
||||
@@ -204,6 +213,8 @@ private:
|
||||
void slotSubmitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor, bool *result);
|
||||
void slotStateChanged(const VcsBase::Internal::State &s, Core::IVersionControl *vc);
|
||||
|
||||
void initializeVcs(Core::IVersionControl *vc, const Core::Context &context);
|
||||
|
||||
VcsBasePluginPrivate *d;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user