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

Move FileHistory to libkate

parent 63f3360e
......@@ -63,7 +63,6 @@ target_sources(
gitstatusmodel.cpp
gitcommitdialog.cpp
stashdialog.cpp
filehistorywidget.cpp
pushpulldialog.cpp
comparebranchesview.cpp
branchdeletedialog.cpp
......
......@@ -116,6 +116,8 @@ target_sources(
diff/diffeditor.cpp
diff/difflinenumarea.cpp
diff/gitdiff.cpp
filehistorywidget.cpp
)
if(BUILD_TESTING)
......
......@@ -6,6 +6,8 @@
#ifndef FILEHISTORYWIDGET_H
#define FILEHISTORYWIDGET_H
#include "kateprivate_export.h"
class QString;
namespace KTextEditor
{
......@@ -21,7 +23,7 @@ public:
* @param mainWindow the mainWindow where the toolview with history will open. If null, active mainWindow
* will be used
*/
static void showFileHistory(const QString &file, KTextEditor::MainWindow *mainWindow = nullptr);
static KATE_PRIVATE_EXPORT void showFileHistory(const QString &file, KTextEditor::MainWindow *mainWindow = nullptr);
};
#endif // FILEHISTORYWIDGET_H
......@@ -10,6 +10,7 @@
// BEGIN Includes
#include "katemainwindow.h"
#include "filehistorywidget.h"
#include "kateapp.h"
#include "kateconfigdialog.h"
#include "kateconfigplugindialogpage.h"
......@@ -503,6 +504,17 @@ void KateMainWindow::setupActions()
m_viewManager->activeViewSpace()->goForward();
});
connect(this->m_viewManager, &KateViewManager::historyForwardEnabled, a, &QAction::setEnabled);
a = actionCollection()->addAction(QStringLiteral("git_show_file_history"));
a->setText(i18n("Show File Git History"));
connect(a, &QAction::triggered, this, [this] {
if (activeView()) {
auto url = activeView()->document()->url();
if (url.isValid() && url.isLocalFile()) {
FileHistory::showFileHistory(url.toLocalFile(), m_wrapper);
}
}
});
}
void KateMainWindow::slotDocumentCloseAll()
......
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