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