[vlmc-devel] MainWindow: don' t bother list settings categories to load. Just load them all
Hugo Beauzée-Luyssen
git at videolan.org
Sun Feb 9 19:44:25 CET 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Feb 9 20:21:23 2014 +0200| [ffa7a222d7e4c1163143a9a727ba0db0e3a9f290] | committer: Hugo Beauzée-Luyssen
MainWindow: don't bother list settings categories to load. Just load them all
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=ffa7a222d7e4c1163143a9a727ba0db0e3a9f290
---
src/Gui/MainWindow.cpp | 20 ++++----------------
src/Gui/MainWindow.h | 2 +-
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 16fe2f8..a98b1d1 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -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 );
}
}
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index 7816077..47e5fb2 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -71,7 +71,7 @@ private:
void createProjectPreferences();
void clearTemporaryFiles();
void initVlmcPreferences();
- void loadVlmcPreferences( const QString& subPart );
+ void loadVlmcPreferences();
void loadGlobalProxySettings();
void initToolbar();
bool saveSettings();
More information about the Vlmc-devel
mailing list