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

Rename posChanged -> addPositionToHistory


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent 175a6a1c
......@@ -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)
......
......@@ -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});
}
}
......
......@@ -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:
/**
......
......@@ -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(savePosition(const QUrl &, KTextEditor::Cursor)),
SLOT(addPositionToHistory(const QUrl &, KTextEditor::Cursor)),
Qt::UniqueConnection);
}
}
......
......@@ -322,10 +322,10 @@ void KateViewManager::openUrl(const QUrl &url)
openUrl(url, QString());
}
void KateViewManager::savePosition(const QUrl &url, KTextEditor::Cursor pos)
void KateViewManager::addPositionToHistory(const QUrl &url, KTextEditor::Cursor pos)
{
if (KateViewSpace *avs = activeViewSpace()) {
avs->addJump(url, pos, /* calledExternally: */ true);
avs->addPositionToHistory(url, pos, /* calledExternally: */ true);
}
}
......
......@@ -67,7 +67,7 @@ public:
public Q_SLOTS:
void openUrl(const QUrl &url);
void savePosition(const QUrl &url, KTextEditor::Cursor pos);
void addPositionToHistory(const QUrl &url, KTextEditor::Cursor pos);
public:
void closeView(KTextEditor::View *view);
......
......@@ -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())
addJump(view->document()->url(), newPosition);
addPositionToHistory(view->document()->url(), newPosition);
});
// register document, it is shown below through showView() then
......@@ -474,7 +474,7 @@ void KateViewSpace::focusNextTab()
}
}
void KateViewSpace::addJump(const QUrl &url, KTextEditor::Cursor c, bool calledExternally)
void KateViewSpace::addPositionToHistory(const QUrl &url, KTextEditor::Cursor c, bool calledExternally)
{
// We don't care about invalid urls (Fixed Diff View / Untitled docs)
if (!url.isValid()) {
......
......@@ -116,7 +116,7 @@ public:
/**
* Add a jump location for jumping back and forth between history
*/
void addJump(const QUrl &url, KTextEditor::Cursor, bool calledExternally = false);
void addPositionToHistory(const QUrl &url, KTextEditor::Cursor, bool calledExternally = false);
/** END Location History Stuff **/
......
......@@ -352,7 +352,7 @@ void KateQuickOpen::slotReturnPressed()
KateViewManager *vm = m_mainWindow->viewManager();
if (vm) {
if (KTextEditor::View *v = vm->activeView()) {
vm->savePosition(v->document()->url(), v->cursorPosition());
vm->addPositionToHistory(v->document()->url(), v->cursorPosition());
}
}
......@@ -361,7 +361,7 @@ void KateQuickOpen::slotReturnPressed()
m_mainWindow->slotWindowActivated();
if (v) {
vm->savePosition(v->document()->url(), v->cursorPosition());
vm->addPositionToHistory(v->document()->url(), v->cursorPosition());
}
// block signals for input line so that we dont trigger filtering again
......
Markdown is supported
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