From e8eb7300fc40f79bdce0175115fae30051c858cb Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sun, 29 Jan 2012 13:43:21 -0500 Subject: [PATCH] i = iniMap.constFind(sections.at(j)); Q_ASSERT(i != iniMap.constEnd()); Consolidate version macro... --- src/libtomahawk/tomahawksettings.cpp | 12 +++++------- src/libtomahawk/tomahawksettings.h | 3 +++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libtomahawk/tomahawksettings.cpp b/src/libtomahawk/tomahawksettings.cpp index b07564cd3..d456b1879 100644 --- a/src/libtomahawk/tomahawksettings.cpp +++ b/src/libtomahawk/tomahawksettings.cpp @@ -30,8 +30,6 @@ #include "database/databasecommand_updatesearchindex.h" #include "database/database.h" -#define VERSION 6 - using namespace Tomahawk; TomahawkSettings* TomahawkSettings::s_instance = 0; @@ -50,24 +48,24 @@ TomahawkSettings::TomahawkSettings( QObject* parent ) if( !contains( "configversion") ) { - setValue( "configversion", VERSION ); + setValue( "configversion", TOMAHAWK_SETTINGS_VERSION ); doInitialSetup(); } - else if( value( "configversion" ).toUInt() != VERSION ) + else if( value( "configversion" ).toUInt() != TOMAHAWK_SETTINGS_VERSION ) { qDebug() << "Config version outdated, old:" << value( "configversion" ).toUInt() - << "new:" << VERSION + << "new:" << TOMAHAWK_SETTINGS_VERSION << "Doing upgrade, if any..."; int current = value( "configversion" ).toUInt(); - while( current < VERSION ) + while( current < TOMAHAWK_SETTINGS_VERSION ) { doUpgrade( current, current + 1 ); current++; } // insert upgrade code here as required - setValue( "configversion", VERSION ); + setValue( "configversion", TOMAHAWK_SETTINGS_VERSION ); } } diff --git a/src/libtomahawk/tomahawksettings.h b/src/libtomahawk/tomahawksettings.h index de288dcfb..184e5ffcb 100644 --- a/src/libtomahawk/tomahawksettings.h +++ b/src/libtomahawk/tomahawksettings.h @@ -26,6 +26,9 @@ #include #include "dllmacro.h" + +#define TOMAHAWK_SETTINGS_VERSION 6 + /** * Convenience wrapper around QSettings for tomahawk-specific config */