forked from qt-creator/qt-creator
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user