forked from qt-creator/qt-creator
Git: InstantBlame: Add commit subject to annotation
Change-Id: I6bcb8d74ae5d380506f0a98d845b002c76bb9ecb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
a3177a4583
commit
a76e23434b
@@ -102,6 +102,11 @@ GitSettings::GitSettings()
|
|||||||
instantBlameIgnoreLineMoves.setLabelText(trIgnoreLineMoves());
|
instantBlameIgnoreLineMoves.setLabelText(trIgnoreLineMoves());
|
||||||
instantBlameIgnoreLineMoves.setToolTip(
|
instantBlameIgnoreLineMoves.setToolTip(
|
||||||
Tr::tr("Finds the commit that introduced the line before it was moved."));
|
Tr::tr("Finds the commit that introduced the line before it was moved."));
|
||||||
|
instantBlameShowSubject.setSettingsKey("GitInstantShowSubject");
|
||||||
|
instantBlameShowSubject.setDefaultValue(false);
|
||||||
|
instantBlameShowSubject.setLabelText(Tr::tr("Show commit subject"));
|
||||||
|
instantBlameShowSubject.setToolTip(
|
||||||
|
Tr::tr("Adds the commit subject directly to the annotation."));
|
||||||
|
|
||||||
graphLog.setSettingsKey("GraphLog");
|
graphLog.setSettingsKey("GraphLog");
|
||||||
|
|
||||||
@@ -152,7 +157,12 @@ GitSettings::GitSettings()
|
|||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Instant Blame")),
|
title(Tr::tr("Instant Blame")),
|
||||||
groupChecker(instantBlame.groupChecker()),
|
groupChecker(instantBlame.groupChecker()),
|
||||||
Row { instantBlameIgnoreSpaceChanges, instantBlameIgnoreLineMoves, st },
|
Row {
|
||||||
|
instantBlameIgnoreSpaceChanges,
|
||||||
|
instantBlameIgnoreLineMoves,
|
||||||
|
instantBlameShowSubject,
|
||||||
|
st
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
st
|
st
|
||||||
|
@@ -40,6 +40,7 @@ public:
|
|||||||
Utils::BoolAspect instantBlame{this};
|
Utils::BoolAspect instantBlame{this};
|
||||||
Utils::BoolAspect instantBlameIgnoreSpaceChanges{this};
|
Utils::BoolAspect instantBlameIgnoreSpaceChanges{this};
|
||||||
Utils::BoolAspect instantBlameIgnoreLineMoves{this};
|
Utils::BoolAspect instantBlameIgnoreLineMoves{this};
|
||||||
|
Utils::BoolAspect instantBlameShowSubject{this};
|
||||||
|
|
||||||
mutable Utils::FilePath resolvedBinPath;
|
mutable Utils::FilePath resolvedBinPath;
|
||||||
mutable bool tryResolve = true;
|
mutable bool tryResolve = true;
|
||||||
|
@@ -45,7 +45,9 @@ BlameMark::BlameMark(const FilePath &fileName, int lineNumber, const CommitInfo
|
|||||||
{Tr::tr("Git Blame"), Constants::TEXT_MARK_CATEGORY_BLAME})
|
{Tr::tr("Git Blame"), Constants::TEXT_MARK_CATEGORY_BLAME})
|
||||||
, m_info(info)
|
, m_info(info)
|
||||||
{
|
{
|
||||||
const QString text = info.shortAuthor + " " + info.authorTime.toString("yyyy-MM-dd");
|
QString text = info.shortAuthor + " " + info.authorTime.toString("yyyy-MM-dd");
|
||||||
|
if (settings().instantBlameShowSubject())
|
||||||
|
text += " • " + info.summary;
|
||||||
|
|
||||||
setPriority(TextEditor::TextMark::LowPriority);
|
setPriority(TextEditor::TextMark::LowPriority);
|
||||||
setToolTip(toolTipText(info));
|
setToolTip(toolTipText(info));
|
||||||
@@ -198,6 +200,10 @@ void InstantBlame::setup()
|
|||||||
setupBlameForEditor(EditorManager::currentEditor());
|
setupBlameForEditor(EditorManager::currentEditor());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(&settings().instantBlameShowSubject, &BaseAspect::changed, this, [setupBlameForEditor] {
|
||||||
|
setupBlameForEditor(EditorManager::currentEditor());
|
||||||
|
});
|
||||||
|
|
||||||
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
|
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
|
||||||
this, setupBlameForEditor);
|
this, setupBlameForEditor);
|
||||||
connect(EditorManager::instance(), &EditorManager::documentClosed,
|
connect(EditorManager::instance(), &EditorManager::documentClosed,
|
||||||
|
Reference in New Issue
Block a user