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
a4935fc3
Commit
a4935fc3
authored
Sep 05, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Sep 05, 2022
Browse files
Move FileHistory to libkate
parent
63f3360e
Changes
5
Hide whitespace changes
Inline
Side-by-side
addons/project/CMakeLists.txt
View file @
a4935fc3
...
...
@@ -63,7 +63,6 @@ target_sources(
gitstatusmodel.cpp
gitcommitdialog.cpp
stashdialog.cpp
filehistorywidget.cpp
pushpulldialog.cpp
comparebranchesview.cpp
branchdeletedialog.cpp
...
...
apps/lib/CMakeLists.txt
View file @
a4935fc3
...
...
@@ -116,6 +116,8 @@ target_sources(
diff/diffeditor.cpp
diff/difflinenumarea.cpp
diff/gitdiff.cpp
filehistorywidget.cpp
)
if
(
BUILD_TESTING
)
...
...
a
ddons/project
/filehistorywidget.cpp
→
a
pps/lib
/filehistorywidget.cpp
View file @
a4935fc3
File moved
a
ddons/project
/filehistorywidget.h
→
a
pps/lib
/filehistorywidget.h
View file @
a4935fc3
...
...
@@ -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
apps/lib/katemainwindow.cpp
View file @
a4935fc3
...
...
@@ -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
()
...
...
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