Page MenuHomePhabricator

Flushing of the preferences was only done when exiting the application
Closed, ResolvedPublic

Description

The flushing of the preferences is now part of the interface berryIPreferencePage and must be implemented by every child. This way it can be executed by QmitkPreferenceDialog every time the PerformOk() method is processed in any preference page.
Exception is the QmitkDataManagaerHotkeysPrefPage, but for this problem a bug already exists #3717.

Event Timeline

Core UI changes for the flushing preferences directly

[SVN revision 25353]
FIX (#5037): Flushing the preferences is now done in QmitkPreferencesDialog#OnApplyButtonClicked

[SVN revision 25356]
COMP (#5037): Some child classes did not implement the new Flush() method

[SVN revision 25358]
COMP (#5037): namespaces were used incorrectly

Sorry for reopening, but I think the solution is over-engineered.

Instead of introducing another method in the interface IPreferencePage (FlushPreferences()), I think just calling flush on the root node in QmitkPreferencesDialog::OnApplyButtonClicked is enough. This should flush all the child nodes too:

void QmitkPreferencesDialog::OnApplyButtonClicked( bool /*triggered*/ )
{

...

berry::IPreferencesService::Pointer prefService = m_PreferencesService.Lock();
if (prefService)
{
  prefService->GetSystemPreferences()->Flush();
}

this->done(QDialog::Accepted);

}

[SVN revision 25385]
FIX (#5037): reversed changes in interface IPreferencePage and childs;root node now flushes all preferences

(In reply to comment #5)

Sorry for reopening, but I think the solution is over-engineered.

Instead of introducing another method in the interface IPreferencePage
(FlushPreferences()), I think just calling flush on the root node in
QmitkPreferencesDialog::OnApplyButtonClicked is enough. This should flush all
the child nodes too:

void QmitkPreferencesDialog::OnApplyButtonClicked( bool /*triggered*/ )
{

...

berry::IPreferencesService::Pointer prefService =

m_PreferencesService.Lock();

if (prefService)
{
  prefService->GetSystemPreferences()->Flush();
}

this->done(QDialog::Accepted);

}

The root node is called through the berryPreferenceService und flushed entirely, including all child nodes, avoiding the modification in the interface.

Merging "Datamanager" component into ExtApp plugins