Hide reload button for diff editor when there is no reloader

Refactor code a bit. Now DiffEditorController has a pointer
to DiffEditorReloader.

Change-Id: I224579127f112923bc665cd59717b0c4d833981b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
jkobus
2014-07-04 13:55:51 +02:00
committed by Jarek Kobus
parent cb7963bc18
commit 91e4271069
8 changed files with 82 additions and 40 deletions

View File

@@ -51,13 +51,14 @@ DiffEditorController *DiffEditorReloader::diffEditorController() const
void DiffEditorReloader::setDiffEditorController(DiffEditorController *controller)
{
if (m_controller == controller)
return; // nothing changes
if (m_controller) {
disconnect(m_controller, SIGNAL(ignoreWhitespaceChanged(bool)),
this, SLOT(requestReload()));
disconnect(m_controller, SIGNAL(contextLinesNumberChanged(int)),
this, SLOT(requestReload()));
disconnect(m_controller, SIGNAL(reloadRequested()),
this, SLOT(requestReload()));
}
m_controller = controller;
@@ -67,8 +68,6 @@ void DiffEditorReloader::setDiffEditorController(DiffEditorController *controlle
this, SLOT(requestReload()));
connect(m_controller, SIGNAL(contextLinesNumberChanged(int)),
this, SLOT(requestReload()));
connect(m_controller, SIGNAL(reloadRequested()),
this, SLOT(requestReload()));
}
}