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
cf5b4c74
Commit
cf5b4c74
authored
Sep 03, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Sep 03, 2022
Browse files
Improve tab title for file history diffs
parent
41d027e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/project/filehistorywidget.cpp
View file @
cf5b4c74
...
...
@@ -287,6 +287,6 @@ void FileHistoryWidget::itemClicked(const QModelIndex &idx)
QByteArray
contents
(
git
.
readAllStandardOutput
());
// we send this signal to the parent, which will pass it on to
// the GitWidget from where a temporary file is opened
Q_EMIT
commitClicked
(
contents
);
Q_EMIT
commitClicked
(
contents
,
QString
::
fromUtf8
(
commit
.
hash
.
mid
(
0
,
7
))
);
}
}
addons/project/filehistorywidget.h
View file @
cf5b4c74
...
...
@@ -31,7 +31,7 @@ private:
Q_SIGNALS:
void
backClicked
();
void
commitClicked
(
const
QByteArray
&
contents
);
void
commitClicked
(
const
QByteArray
&
contents
,
const
QString
&
commit
);
void
errorMessage
(
const
QString
&
msg
,
bool
warn
);
};
...
...
addons/project/kateprojectview.cpp
View file @
cf5b4c74
...
...
@@ -156,9 +156,10 @@ void KateProjectView::showFileGitHistory(const QString &file)
auto
fhs
=
new
FileHistoryWidget
(
dotGitPath
.
value
(),
file
);
connect
(
fhs
,
&
FileHistoryWidget
::
backClicked
,
this
,
&
KateProjectView
::
setTreeViewAsCurrent
);
connect
(
fhs
,
&
FileHistoryWidget
::
commitClicked
,
this
,
[
this
,
file
](
const
QByteArray
&
diff
)
{
connect
(
fhs
,
&
FileHistoryWidget
::
commitClicked
,
this
,
[
this
,
file
](
const
QByteArray
&
diff
,
const
QString
&
commit
)
{
auto
mw
=
m_pluginView
->
mainWindow
()
->
window
();
QMetaObject
::
invokeMethod
(
mw
,
"showDiff"
,
Q_ARG
(
QByteArray
,
diff
),
Q_ARG
(
QString
,
file
),
Q_ARG
(
QString
,
{}));
const
QString
name
=
QStringLiteral
(
"%1[%2]"
).
arg
(
file
,
commit
);
QMetaObject
::
invokeMethod
(
mw
,
"showDiff"
,
Q_ARG
(
QByteArray
,
diff
),
Q_ARG
(
QString
,
name
),
Q_ARG
(
QString
,
{}));
});
connect
(
fhs
,
&
FileHistoryWidget
::
errorMessage
,
m_pluginView
,
[
this
](
const
QString
&
s
,
bool
warn
)
{
QVariantMap
genericMessage
;
...
...
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