1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

i = iniMap.constFind(sections.at(j));

Q_ASSERT(i != iniMap.constEnd());
Consolidate version macro...
This commit is contained in:
Leo Franchi
2012-01-29 13:43:21 -05:00
parent 9607d6be00
commit e8eb7300fc
2 changed files with 8 additions and 7 deletions

View File

@@ -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 );
}
}

View File

@@ -26,6 +26,9 @@
#include <QtNetwork/QNetworkProxy>
#include "dllmacro.h"
#define TOMAHAWK_SETTINGS_VERSION 6
/**
* Convenience wrapper around QSettings for tomahawk-specific config
*/