kate: remove git++ plugin integration

Use only Kate's built-in project git features. The reviewDiff action
now uses the active document text directly.
This commit is contained in:
Levi Neely 2026-10-09 12:13:01 +02:00
parent 83cae21957
commit 05dd33c1cf
2 changed files with 4 additions and 32 deletions

View File

@ -174,9 +174,6 @@ OllieKateView::OllieKateView(OllieKatePlugin *plugin, KTextEditor::MainWindow *m
// Project tree context menu
setupProjectTreeContextMenu();
// Git++ "Review Diff" action (third-party plugin)
setupGitPlusPlusDiffAction();
// Kate project plugin's built-in Git widget integration
setupProjectGitWidget();
}
@ -463,19 +460,6 @@ void OllieKateView::setupContextMenu(KTextEditor::View *view)
});
}
void OllieKateView::setupGitPlusPlusDiffAction()
{
QObject *gitView = m_mainWindow->pluginView(QStringLiteral("gitplusplus"));
if (!gitView) return;
auto *action = new QAction(QIcon::fromTheme(QStringLiteral("document-preview")),
QStringLiteral("Ollie: Review Diff"), this);
connect(action, &QAction::triggered, this, &OllieKateView::reviewDiff);
QMetaObject::invokeMethod(gitView, "registerDiffAction",
Q_ARG(QAction *, action));
}
void OllieKateView::setupProjectGitWidget()
{
// Don't retry if we already have the button
@ -860,21 +844,10 @@ void OllieKateView::sendVerbatim()
void OllieKateView::reviewDiff()
{
QString diff;
QObject *gitView = m_mainWindow->pluginView(QStringLiteral("gitplusplus"));
if (gitView) {
QByteArray data = gitView->property("lastDiff").toByteArray();
if (!data.isEmpty())
diff = QString::fromUtf8(data);
}
if (diff.isEmpty()) {
auto *view = m_mainWindow->activeView();
if (view && view->document())
diff = view->document()->text();
}
if (!view || !view->document()) return;
QString diff = view->document()->text();
if (diff.trimmed().isEmpty()) return;
ensureAgent();

View File

@ -95,7 +95,6 @@ private:
// Context menu
void setupContextMenu(KTextEditor::View *view);
void setupProjectTreeContextMenu();
void setupGitPlusPlusDiffAction();
void setupProjectGitWidget();
void onProjectTreeContextMenu(const QPoint &pos);