forked from qt-creator/qt-creator
Git: Show commit on double-click in fixup editor
Change-Id: I8cb08b0fcba3ddac7223b39b3762ff71e8d61f8c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
8bbad43019
commit
325c0beda5
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user