summaryrefslogtreecommitdiff
path: root/src/plugins/vcsbase/vcsplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/vcsbase/vcsplugin.cpp')
-rw-r--r--src/plugins/vcsbase/vcsplugin.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp
index d1042d41a8..645a6d2702 100644
--- a/src/plugins/vcsbase/vcsplugin.cpp
+++ b/src/plugins/vcsbase/vcsplugin.cpp
@@ -36,13 +36,17 @@
#include "nicknamedialog.h"
#include "vcsoutputwindow.h"
#include "corelistener.h"
+#include "wizard/vcsconfigurationpage.h"
+#include "wizard/vcsjsextension.h"
#include <coreplugin/iversioncontrol.h>
+#include <coreplugin/jsexpander.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/vcsmanager.h>
+#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
#include <projectexplorer/project.h>
-#include <projectexplorer/projectexplorer.h>
+#include <projectexplorer/projecttree.h>
#include <utils/macroexpander.h>
@@ -74,7 +78,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
- if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/vcsbase/VcsBase.mimetypes.xml"), errorMessage))
+ if (!MimeDatabase::addMimeTypes(QLatin1String(":/vcsbase/VcsBase.mimetypes.xml"), errorMessage))
return false;
m_coreListener = new CoreListener;
@@ -89,12 +93,16 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
this, SLOT(slotSettingsChanged()));
slotSettingsChanged();
+ JsonWizardFactory::registerPageFactory(new Internal::VcsConfigurationPageFactory);
+
+ JsExpander::registerQObjectForJs(QLatin1String("Vcs"), new VcsJsExtension);
+
Utils::MacroExpander *expander = Utils::globalMacroExpander();
expander->registerVariable(Constants::VAR_VCS_NAME,
tr("Name of the version control system in use by the current project."),
[]() -> QString {
IVersionControl *vc = 0;
- if (Project *project = ProjectExplorerPlugin::currentProject())
+ if (Project *project = ProjectTree::currentProject())
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString());
return vc ? vc->displayName() : QString();
});
@@ -104,7 +112,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
[]() -> QString {
IVersionControl *vc = 0;
QString topLevel;
- if (Project *project = ProjectExplorerPlugin::currentProject())
+ if (Project *project = ProjectTree::currentProject())
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString(), &topLevel);
return vc ? vc->vcsTopic(topLevel) : QString();
});
@@ -112,7 +120,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
expander->registerVariable(Constants::VAR_VCS_TOPLEVELPATH,
tr("The top level path to the repository the current project is in."),
[]() -> QString {
- if (Project *project = ProjectExplorerPlugin::currentProject())
+ if (Project *project = ProjectTree::currentProject())
return VcsManager::findTopLevelForDirectory(project->projectDirectory().toString());
return QString();
});