Git: Enable 'Show' for files, not only commits

Change-Id: I0f49d3a26c801af84bb578478bd4778356507cf6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-02-19 21:23:41 +02:00
committed by Tobias Hunger
parent 68878208d8
commit 6d97c0ecc1
4 changed files with 28 additions and 32 deletions

View File

@@ -438,7 +438,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Remotes..."), Core::Id("Git.RemoteList"),
globalcontext, false, SLOT(remoteList()));
m_showAction = new QAction(tr("Show Commit..."), this);
m_showAction = new QAction(tr("Show..."), this);
Core::Command *showCommitCommand = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext);
connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit()));
gitContainer->addAction(showCommitCommand);
@@ -1038,8 +1038,10 @@ void GitPlugin::showCommit()
if (!m_changeSelectionDialog)
m_changeSelectionDialog = new ChangeSelectionDialog();
if (state.hasTopLevel())
m_changeSelectionDialog->setRepository(state.topLevel());
if (state.hasFile())
m_changeSelectionDialog->setWorkingDirectory(state.currentFileDirectory());
else if (state.hasTopLevel())
m_changeSelectionDialog->setWorkingDirectory(state.topLevel());
if (m_changeSelectionDialog->exec() != QDialog::Accepted)
return;
@@ -1047,7 +1049,7 @@ void GitPlugin::showCommit()
if (change.isEmpty())
return;
m_gitClient->show(m_changeSelectionDialog->repository(), change);
m_gitClient->show(m_changeSelectionDialog->workingDirectory(), change);
}
const GitSettings &GitPlugin::settings() const