Skip to content
GitLab
Menu
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
ea099149
Commit
ea099149
authored
Mar 21, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Mar 21, 2021
Browse files
Rename posChanged -> addPositionToHistory
Signed-off-by:
Waqar Ahmed
<
waqar.17a@gmail.com
>
parent
175a6a1c
Changes
9
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
ea099149
...
...
@@ -409,7 +409,7 @@ Q_SIGNALS:
*/
void
message
(
const
QVariantMap
&
message
);
void
posChanged
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
void
addPositionToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
public:
LSPClientActionView
(
LSPClientPlugin
*
plugin
,
KTextEditor
::
MainWindow
*
mainWin
,
KXMLGUIClient
*
client
,
QSharedPointer
<
LSPClientServerManager
>
serverManager
)
...
...
@@ -1029,17 +1029,17 @@ public:
if
(
document
&&
uri
==
document
->
url
())
{
// save current position for location history
Q_EMIT
posChanged
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
// save the position to which we are jumping in location history
Q_EMIT
posChanged
(
activeView
->
document
()
->
url
(),
cdef
);
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
cdef
);
activeView
->
setCursorPosition
(
cdef
);
highlightLandingLocation
(
activeView
,
location
);
}
else
{
KTextEditor
::
View
*
view
=
m_mainWindow
->
openUrl
(
uri
);
if
(
view
)
{
Q_EMIT
posChanged
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
Q_EMIT
posChanged
(
view
->
document
()
->
url
(),
cdef
);
Q_EMIT
addPositionToHistory
(
activeView
->
document
()
->
url
(),
activeView
->
cursorPosition
());
Q_EMIT
addPositionToHistory
(
view
->
document
()
->
url
(),
cdef
);
view
->
setCursorPosition
(
cdef
);
highlightLandingLocation
(
view
,
location
);
}
...
...
@@ -2425,7 +2425,7 @@ public:
m_mainWindow
->
guiFactory
()
->
addClient
(
this
);
connect
(
m_actionView
.
get
(),
&
LSPClientActionView
::
message
,
this
,
&
LSPClientPluginViewImpl
::
message
);
connect
(
m_actionView
.
get
(),
&
LSPClientActionView
::
posChanged
,
this
,
&
LSPClientPluginViewImpl
::
posChanged
);
connect
(
m_actionView
.
get
(),
&
LSPClientActionView
::
addPositionToHistory
,
this
,
&
LSPClientPluginViewImpl
::
addPositionToHistory
);
}
~
LSPClientPluginViewImpl
()
override
...
...
@@ -2452,7 +2452,7 @@ Q_SIGNALS:
* @param document url
* @param c pos in document
*/
void
posChanged
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
void
addPositionToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
};
QObject
*
LSPClientPluginView
::
new_
(
LSPClientPlugin
*
plugin
,
KTextEditor
::
MainWindow
*
mainWin
)
...
...
addons/project/kateprojectinfoviewindex.cpp
View file @
ea099149
...
...
@@ -142,7 +142,7 @@ void KateProjectInfoViewIndex::slotClicked(const QModelIndex &index)
}
/** save current position in location history */
Q_EMIT
m_pluginView
->
posChanged
(
url
,
pos
);
Q_EMIT
m_pluginView
->
addPositionToHistory
(
url
,
pos
);
/**
* set cursor, if possible
...
...
@@ -152,7 +152,7 @@ void KateProjectInfoViewIndex::slotClicked(const QModelIndex &index)
view
->
setCursorPosition
(
KTextEditor
::
Cursor
(
line
-
1
,
0
));
/** save the jump position in location history */
Q_EMIT
m_pluginView
->
posChanged
(
view
->
document
()
->
url
(),
{
line
-
1
,
0
});
Q_EMIT
m_pluginView
->
addPositionToHistory
(
view
->
document
()
->
url
(),
{
line
-
1
,
0
});
}
}
...
...
addons/project/kateprojectpluginview.h
View file @
ea099149
...
...
@@ -228,7 +228,7 @@ Q_SIGNALS:
* @param document url
* @param c pos in document
*/
void
posChanged
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
void
addPositionToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
);
private
Q_SLOTS
:
/**
...
...
kate/katepluginmanager.cpp
View file @
ea099149
...
...
@@ -240,11 +240,11 @@ void KatePluginManager::enablePluginGUI(KatePluginInfo *item, KateMainWindow *wi
}
// ensure location tracking is connected for view
if
(
createdView
->
metaObject
()
->
indexOfSignal
(
"
posChanged
(QUrl,KTextEditor::Cursor)"
)
!=
-
1
)
{
if
(
createdView
->
metaObject
()
->
indexOfSignal
(
"
addPositionToHistory
(QUrl,KTextEditor::Cursor)"
)
!=
-
1
)
{
connect
(
createdView
,
SIGNAL
(
posChanged
(
QUrl
,
KTextEditor
::
Cursor
)),
SIGNAL
(
addPositionToHistory
(
QUrl
,
KTextEditor
::
Cursor
)),
win
->
viewManager
(),
SLOT
(
save
Position
(
const
QUrl
&
,
KTextEditor
::
Cursor
)),
SLOT
(
add
Position
ToHistory
(
const
QUrl
&
,
KTextEditor
::
Cursor
)),
Qt
::
UniqueConnection
);
}
}
...
...
kate/kateviewmanager.cpp
View file @
ea099149
...
...
@@ -322,10 +322,10 @@ void KateViewManager::openUrl(const QUrl &url)
openUrl
(
url
,
QString
());
}
void
KateViewManager
::
save
Position
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
pos
)
void
KateViewManager
::
add
Position
ToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
pos
)
{
if
(
KateViewSpace
*
avs
=
activeViewSpace
())
{
avs
->
add
Jump
(
url
,
pos
,
/* calledExternally: */
true
);
avs
->
add
PositionToHistory
(
url
,
pos
,
/* calledExternally: */
true
);
}
}
...
...
kate/kateviewmanager.h
View file @
ea099149
...
...
@@ -67,7 +67,7 @@ public:
public
Q_SLOTS
:
void
openUrl
(
const
QUrl
&
url
);
void
save
Position
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
pos
);
void
add
Position
ToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
pos
);
public:
void
closeView
(
KTextEditor
::
View
*
view
);
...
...
kate/kateviewspace.cpp
View file @
ea099149
...
...
@@ -213,7 +213,7 @@ KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
connect
(
v
,
&
KTextEditor
::
View
::
cursorPositionChanged
,
this
,
[
this
](
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Cursor
&
newPosition
)
{
if
(
view
&&
view
->
document
())
add
Jump
(
view
->
document
()
->
url
(),
newPosition
);
add
PositionToHistory
(
view
->
document
()
->
url
(),
newPosition
);
});
// register document, it is shown below through showView() then
...
...
@@ -474,7 +474,7 @@ void KateViewSpace::focusNextTab()
}
}
void
KateViewSpace
::
add
Jump
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
,
bool
calledExternally
)
void
KateViewSpace
::
add
PositionToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
,
bool
calledExternally
)
{
// We don't care about invalid urls (Fixed Diff View / Untitled docs)
if
(
!
url
.
isValid
())
{
...
...
kate/kateviewspace.h
View file @
ea099149
...
...
@@ -116,7 +116,7 @@ public:
/**
* Add a jump location for jumping back and forth between history
*/
void
add
Jump
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
,
bool
calledExternally
=
false
);
void
add
PositionToHistory
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
,
bool
calledExternally
=
false
);
/** END Location History Stuff **/
...
...
kate/quickopen/katequickopen.cpp
View file @
ea099149
...
...
@@ -352,7 +352,7 @@ void KateQuickOpen::slotReturnPressed()
KateViewManager
*
vm
=
m_mainWindow
->
viewManager
();
if
(
vm
)
{
if
(
KTextEditor
::
View
*
v
=
vm
->
activeView
())
{
vm
->
save
Position
(
v
->
document
()
->
url
(),
v
->
cursorPosition
());
vm
->
add
Position
ToHistory
(
v
->
document
()
->
url
(),
v
->
cursorPosition
());
}
}
...
...
@@ -361,7 +361,7 @@ void KateQuickOpen::slotReturnPressed()
m_mainWindow
->
slotWindowActivated
();
if
(
v
)
{
vm
->
save
Position
(
v
->
document
()
->
url
(),
v
->
cursorPosition
());
vm
->
add
Position
ToHistory
(
v
->
document
()
->
url
(),
v
->
cursorPosition
());
}
// block signals for input line so that we dont trigger filtering again
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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