aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/logchangedialog.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-05-05 22:28:07 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-05-06 10:25:10 +0200
commit325c0beda530b2f7f04ba34f22fb2f8ccabb52e7 (patch)
treed2533312dd82a28fa6f3e8d92be99dc357fb6bc8 /src/plugins/git/logchangedialog.cpp
parent8bbad43019af98e342d6a5b311016fa20198e4cf (diff)
Git: Show commit on double-click in fixup editor
Change-Id: I8cb08b0fcba3ddac7223b39b3762ff71e8d61f8c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/logchangedialog.cpp')
-rw-r--r--src/plugins/git/logchangedialog.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp
index 8621bc24d9..2bf627be36 100644
--- a/src/plugins/git/logchangedialog.cpp
+++ b/src/plugins/git/logchangedialog.cpp
@@ -62,6 +62,7 @@ LogChangeWidget::LogChangeWidget(QWidget *parent)
setUniformRowHeights(true);
setRootIsDecorated(false);
setSelectionBehavior(QAbstractItemView::SelectRows);
+ connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(emitDoubleClicked(QModelIndex)));
}
bool LogChangeWidget::init(const QString &repository, const QString &commit, bool includeRemote)
@@ -89,6 +90,15 @@ int LogChangeWidget::commitIndex() const
return -1;
}
+void LogChangeWidget::emitDoubleClicked(const QModelIndex &index)
+{
+ if (index.isValid()) {
+ QString commit = index.sibling(index.row(), Sha1Column).data().toString();
+ if (!commit.isEmpty())
+ emit doubleClicked(commit);
+ }
+}
+
bool LogChangeWidget::populateLog(const QString &repository, const QString &commit, bool includeRemote)
{
if (const int rowCount = m_model->rowCount())