Rescanning after RAID config file change

This commit is contained in:
Caio Carvalho 2018-08-16 23:56:01 +02:00
parent 3c79839152
commit 170a0fadde
1 changed files with 9 additions and 1 deletions

View File

@ -1187,10 +1187,15 @@ void MainWindow::onShowAboutKPMcore()
void MainWindow::onSettingsChanged()
{
if (SoftwareRAID::raidConfigurationFilePath() != Config::raidConfigurationFilePath())
bool raidChanged = false, backendChanged = false;
if (SoftwareRAID::raidConfigurationFilePath() != Config::raidConfigurationFilePath()) {
raidChanged = true;
loadRaidConfiguration();
}
if (CoreBackendManager::self()->backend()->id() != Config::backend()) {
backendChanged = true;
CoreBackendManager::self()->unload();
// FIXME: if loadBackend() fails to load the configured backend and loads the default
// one instead it also sets the default backend in the config; the config dialog will
@ -1203,6 +1208,9 @@ void MainWindow::onSettingsChanged()
close();
}
if (raidChanged && !backendChanged)
scanDevices();
enableActions();
pmWidget().updatePartitions();