summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-05-30 13:48:27 +0200
committerEike Ziller <eike.ziller@digia.com>2013-05-30 13:48:27 +0200
commit0a95b28147d9c4ea57ba9b025beec2d503399acf (patch)
tree9032878c4c1b3877167990376d3871db70eb304c /src/plugins/git/gitplugin.cpp
parentcca4cbfb02da327c844c1291d43a8f7f6420e334 (diff)
parent10d7d61e263573116965b1af53cdbda0f668211d (diff)
downloadqt-creator-0a95b28147d9c4ea57ba9b025beec2d503399acf.tar.gz
Merge remote-tracking branch 'origin/2.8'
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 55dcce5364..665c332b21 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -233,7 +233,8 @@ ActionCommandPair
{
QAction *action = new QAction(text, this);
Core::Command *command = Core::ActionManager::registerAction(action, id, context);
- ac->addAction(command);
+ if (ac)
+ ac->addAction(command);
m_repositoryActions.push_back(action);
if (addToLocator)
m_commandLocator->appendCommand(command);
@@ -439,7 +440,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
globalcontext, false, SLOT(resetRepository()));
createRepositoryAction(localRepositoryMenu,
- tr("Interactive Rebase..."), Core::Id("Git.Rebase"),
+ tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
globalcontext, true, SLOT(startRebase()));
createRepositoryAction(localRepositoryMenu,
@@ -591,6 +592,29 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
// --------------
+ /* Actions only in locator */
+ createRepositoryAction(0, tr("Show..."), Core::Id("Git.Show"),
+ globalcontext, true, SLOT(startChangeRelatedAction()));
+
+ createRepositoryAction(0, tr("Revert..."), Core::Id("Git.Revert"),
+ globalcontext, true, SLOT(startChangeRelatedAction()));
+
+ createRepositoryAction(0, tr("Cherry Pick..."), Core::Id("Git.CherryPick"),
+ globalcontext, true, SLOT(startChangeRelatedAction()));
+
+ createRepositoryAction(0, tr("Checkout..."), Core::Id("Git.Checkout"),
+ globalcontext, true, SLOT(startChangeRelatedAction()));
+
+ createRepositoryAction(0, tr("Rebase..."), Core::Id("Git.Rebase"),
+ globalcontext, true, SLOT(branchList()));
+
+ createRepositoryAction(0, tr("Merge..."), Core::Id("Git.Merge"),
+ globalcontext, true, SLOT(branchList()));
+
+ /* \Actions only in locator */
+
+ // --------------
+
/* "Git Tools" menu */
Core::ActionContainer *gitToolsMenu = Core::ActionManager::createMenu(Core::Id("Git.GitToolsMenu"));
gitToolsMenu->menu()->setTitle(tr("Git &Tools"));
@@ -1323,8 +1347,9 @@ void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
foreach (QAction *repositoryAction, m_repositoryActions)
repositoryAction->setEnabled(repositoryEnabled);
+
m_submoduleUpdateAction->setVisible(repositoryEnabled
- && QFile::exists(currentState().topLevel() + QLatin1String("/.gitmodules")));
+ && !m_gitClient->submoduleList(currentState().topLevel()).isEmpty());
updateContinueAndAbortCommands();
updateRepositoryBrowserAction();