Diff/Vcs: Use a function object for reloading

Helps with slimming down the user code side.

Change-Id: I4b0aac76c0d1516eb05bff9c18594e64f8b41a7a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2020-02-06 11:52:59 +01:00
parent 0737291d54
commit b22768e980
6 changed files with 94 additions and 156 deletions

View File

@@ -123,6 +123,11 @@ void DiffEditorController::forceContextLineCount(int lines)
m_document->forceContextLineCount(lines);
}
void DiffEditorController::setReloader(const std::function<void ()> &reloader)
{
m_reloader = reloader;
}
Core::IDocument *DiffEditorController::document() const
{
return m_document;
@@ -135,7 +140,8 @@ void DiffEditorController::requestReload()
{
m_isReloading = true;
m_document->beginReload();
reload();
QTC_ASSERT(m_reloader, reloadFinished(false); return);
m_reloader();
}
void DiffEditorController::reloadFinished(bool success)