Commit ffa7a222 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MainWindow: don't bother list settings categories to load. Just load them all

parent ad245bcc
......@@ -330,32 +330,20 @@ MainWindow::initVlmcPreferences()
VLMC_CREATE_PRIVATE_PREFERENCE_STRING( "private/VlmcVersion", PROJECT_VERSION_MAJOR );
//Load saved preferences :
loadVlmcPreferences( "private" );
if ( VLMC_GET_STRING( "private/VlmcVersion" ) == PROJECT_VERSION_MAJOR )
{
loadVlmcPreferences( "keyboard" );
loadVlmcPreferences( "general" );
loadVlmcPreferences( "youtube" );
loadVlmcPreferences( "network" );
}
else
{
QSettings s;
s.clear();
}
loadVlmcPreferences();
SettingsManager::getInstance()->setValue( "private/VlmcVersion", PROJECT_VERSION_MAJOR, SettingsManager::Vlmc );
}
void
MainWindow::loadVlmcPreferences( const QString &subPart )
MainWindow::loadVlmcPreferences()
{
//FIXME: Manually load vlmc version to force settings clear?
QSettings s;
s.beginGroup( subPart );
foreach ( QString key, s.allKeys() )
{
QVariant value = s.value( key );
vlmcDebug() << "Loading" << key << "=>" << value;
SettingsManager::getInstance()->setValue( subPart + "/" + key, value, SettingsManager::Vlmc );
SettingsManager::getInstance()->setValue( key, value, SettingsManager::Vlmc );
}
}
......
......@@ -71,7 +71,7 @@ private:
void createProjectPreferences();
void clearTemporaryFiles();
void initVlmcPreferences();
void loadVlmcPreferences( const QString& subPart );
void loadVlmcPreferences();
void loadGlobalProxySettings();
void initToolbar();
bool saveSettings();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment