Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
cdbf4e11
Commit
cdbf4e11
authored
Sep 01, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Sep 03, 2022
Browse files
Enable DiffWidget for git blame
parent
2ba40c6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
addons/git-blame/commitfilesview.cpp
View file @
cdbf4e11
...
...
@@ -456,5 +456,5 @@ void CommitDiffTreeView::showDiff(const QModelIndex &idx)
}
}
Q_EMIT
showDiffRequested
(
git
.
readAllStandardOutput
());
Q_EMIT
showDiffRequested
(
git
.
readAllStandardOutput
()
,
file
);
}
addons/git-blame/commitfilesview.h
View file @
cdbf4e11
...
...
@@ -36,7 +36,7 @@ public:
void
openCommit
(
const
QString
&
hash
,
const
QString
&
filePath
);
Q_SIGNAL
void
closeRequested
();
Q_SIGNAL
void
showDiffRequested
(
const
QByteArray
&
diffContents
);
Q_SIGNAL
void
showDiffRequested
(
const
QByteArray
&
diffContents
,
const
QString
&
file
);
public:
void
createFileTreeForCommit
(
const
QString
&
filePath
,
const
QByteArray
&
rawNumStat
);
...
...
addons/git-blame/kategitblameplugin.cpp
View file @
cdbf4e11
...
...
@@ -584,21 +584,10 @@ void KateGitBlamePluginView::hideToolView()
// CommitFileView will be destroyed as well as it is the child of m_ToolView
}
void
KateGitBlamePluginView
::
showDiffForFile
(
const
QByteArray
&
diffContents
)
void
KateGitBlamePluginView
::
showDiffForFile
(
const
QByteArray
&
diffContents
,
const
QString
&
file
)
{
if
(
m_diffView
)
{
m_diffView
->
document
()
->
setText
(
QString
::
fromUtf8
(
diffContents
));
m_diffView
->
document
()
->
setModified
(
false
);
m_mainWindow
->
activateView
(
m_diffView
->
document
());
m_diffView
->
setCursorPosition
({
0
,
0
});
return
;
}
m_diffView
=
m_mainWindow
->
openUrl
(
QUrl
());
m_diffView
->
document
()
->
setHighlightingMode
(
QStringLiteral
(
"Diff"
));
m_diffView
->
document
()
->
setText
(
QString
::
fromUtf8
(
diffContents
));
m_diffView
->
document
()
->
setModified
(
false
);
m_mainWindow
->
activateView
(
m_diffView
->
document
());
m_diffView
->
setCursorPosition
({
0
,
0
});
auto
mw
=
m_mainWindow
->
window
();
QMetaObject
::
invokeMethod
(
mw
,
"showDiff"
,
Q_ARG
(
QByteArray
,
diffContents
),
Q_ARG
(
QString
,
file
),
Q_ARG
(
QString
,
{}));
}
#include
"kategitblameplugin.moc"
addons/git-blame/kategitblameplugin.h
View file @
cdbf4e11
...
...
@@ -107,7 +107,7 @@ private:
void
createToolView
();
void
hideToolView
();
void
showDiffForFile
(
const
QByteArray
&
diffContents
);
void
showDiffForFile
(
const
QByteArray
&
diffContents
,
const
QString
&
file
);
const
CommitInfo
&
blameGetUpdateInfo
(
int
lineNr
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment