Commit cf5b4c74 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Improve tab title for file history diffs

parent 41d027e6
......@@ -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)));
}
}
......@@ -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);
};
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment