Commit 70d436a6 authored by hjk's avatar hjk

EditorManager: Remove editor parameter of addCurrentPositionToNavigationHistory

This only triggered activity if it's the currentEditor().

Change-Id: If9239901c5b30bbb0156e9f6964965cf41db7c16
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 22aef3b6
......@@ -2397,9 +2397,9 @@ bool EditorManager::closeDocuments(const QList<IDocument *> &documents, bool ask
return m_instance->closeEditors(DocumentModel::editorsForDocuments(documents), askAboutModifiedEditors);
}
void EditorManager::addCurrentPositionToNavigationHistory(IEditor *editor, const QByteArray &saveState)
void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &saveState)
{
EditorManagerPrivate::currentEditorView()->addCurrentPositionToNavigationHistory(editor, saveState);
EditorManagerPrivate::currentEditorView()->addCurrentPositionToNavigationHistory(saveState);
EditorManagerPrivate::updateActions();
}
......
......@@ -137,7 +137,7 @@ public:
static void closeDocument(DocumentModel::Entry *entry);
static void closeOtherDocuments(IDocument *document);
static void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray());
static void addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray());
static void cutForwardNavigationHistory();
static bool saveDocument(IDocument *document);
......
......@@ -414,13 +414,9 @@ void EditorView::updateEditorHistory(IEditor *editor)
updateEditorHistory(editor, m_editorHistory);
}
void EditorView::addCurrentPositionToNavigationHistory(IEditor *editor, const QByteArray &saveState)
void EditorView::addCurrentPositionToNavigationHistory(const QByteArray &saveState)
{
if (editor && editor != currentEditor())
return; // we only save editor sate for the current editor, when the user interacts
if (!editor)
editor = currentEditor();
IEditor *editor = currentEditor();
if (!editor)
return;
IDocument *document = editor->document();
......
......@@ -156,7 +156,7 @@ public slots:
void goForwardInNavigationHistory();
public:
void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray());
void addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray());
void cutForwardNavigationHistory();
inline QList<EditLocation> editorHistory() const { return m_editorHistory; }
......
......@@ -4551,7 +4551,8 @@ void BaseTextEditorWidget::slotCursorPositionChanged()
<< "indent:" << BaseTextDocumentLayout::userData(textCursor().block())->foldingIndent();
#endif
if (!d->m_contentsChanged && d->m_lastCursorChangeWasInteresting) {
EditorManager::addCurrentPositionToNavigationHistory(editor(), d->m_tempNavigationState);
if (EditorManager::currentEditor() && EditorManager::currentEditor()->widget() == this)
EditorManager::addCurrentPositionToNavigationHistory(d->m_tempNavigationState);
d->m_lastCursorChangeWasInteresting = false;
} else if (d->m_contentsChanged) {
d->saveCurrentCursorPositionForNavigation();
......
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