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

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

This reverts commit ffa7a222.
Slightly refactor the original version, but load settings by categories.
Loading everything from the settings file won't work on MacOS

Conflicts:
	src/Gui/MainWindow.cpp
parent 76ec5a93
......@@ -334,17 +334,37 @@ MainWindow::initVlmcPreferences()
VLMC_CREATE_PRIVATE_PREFERENCE_STRING( "private/VlmcVersion", PROJECT_VERSION_MAJOR );
}
void MainWindow::loadVlmcPreferences()
{
//Load saved preferences :
loadVlmcPreferencesCategory( "private" );
if ( VLMC_GET_STRING( "private/VlmcVersion" ) == PROJECT_VERSION_MAJOR )
{
loadVlmcPreferencesCategory( "keyboard" );
loadVlmcPreferencesCategory( "vlmc" );
loadVlmcPreferencesCategory( "youtube" );
loadVlmcPreferencesCategory( "network" );
}
else
{
QSettings s;
s.clear();
}
SettingsManager::getInstance()->setValue( "private/VlmcVersion", PROJECT_VERSION_MAJOR, SettingsManager::Vlmc );
}
void
MainWindow::loadVlmcPreferences()
MainWindow::loadVlmcPreferencesCategory( const QString &subPart )
{
//FIXME: Manually load vlmc version to force settings clear?
QSettings s;
s.setFallbacksEnabled( false );
s.beginGroup( subPart );
foreach ( QString key, s.allKeys() )
{
QVariant value = s.value( key );
vlmcDebug() << "Loading" << key << "=>" << value;
SettingsManager::getInstance()->setValue( key, value, SettingsManager::Vlmc );
QString fullKey = subPart + "/" + key;
vlmcDebug() << "Loading" << fullKey << "=>" << value;
SettingsManager::getInstance()->setValue( fullKey, value, SettingsManager::Vlmc );
}
}
......
......@@ -72,6 +72,7 @@ private:
void clearTemporaryFiles();
void initVlmcPreferences();
void loadVlmcPreferences();
void loadVlmcPreferencesCategory( const QString& category );
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