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() ...@@ -330,32 +330,20 @@ MainWindow::initVlmcPreferences()
VLMC_CREATE_PRIVATE_PREFERENCE_STRING( "private/VlmcVersion", PROJECT_VERSION_MAJOR ); VLMC_CREATE_PRIVATE_PREFERENCE_STRING( "private/VlmcVersion", PROJECT_VERSION_MAJOR );
//Load saved preferences : //Load saved preferences :
loadVlmcPreferences( "private" ); loadVlmcPreferences();
if ( VLMC_GET_STRING( "private/VlmcVersion" ) == PROJECT_VERSION_MAJOR )
{
loadVlmcPreferences( "keyboard" );
loadVlmcPreferences( "general" );
loadVlmcPreferences( "youtube" );
loadVlmcPreferences( "network" );
}
else
{
QSettings s;
s.clear();
}
SettingsManager::getInstance()->setValue( "private/VlmcVersion", PROJECT_VERSION_MAJOR, SettingsManager::Vlmc ); SettingsManager::getInstance()->setValue( "private/VlmcVersion", PROJECT_VERSION_MAJOR, SettingsManager::Vlmc );
} }
void void
MainWindow::loadVlmcPreferences( const QString &subPart ) MainWindow::loadVlmcPreferences()
{ {
//FIXME: Manually load vlmc version to force settings clear?
QSettings s; QSettings s;
s.beginGroup( subPart );
foreach ( QString key, s.allKeys() ) foreach ( QString key, s.allKeys() )
{ {
QVariant value = s.value( key ); QVariant value = s.value( key );
vlmcDebug() << "Loading" << key << "=>" << value; vlmcDebug() << "Loading" << key << "=>" << value;
SettingsManager::getInstance()->setValue( subPart + "/" + key, value, SettingsManager::Vlmc ); SettingsManager::getInstance()->setValue( key, value, SettingsManager::Vlmc );
} }
} }
......
...@@ -71,7 +71,7 @@ private: ...@@ -71,7 +71,7 @@ private:
void createProjectPreferences(); void createProjectPreferences();
void clearTemporaryFiles(); void clearTemporaryFiles();
void initVlmcPreferences(); void initVlmcPreferences();
void loadVlmcPreferences( const QString& subPart ); void loadVlmcPreferences();
void loadGlobalProxySettings(); void loadGlobalProxySettings();
void initToolbar(); void initToolbar();
bool saveSettings(); 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