mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 22:56:42 +02:00
i = iniMap.constFind(sections.at(j));
Q_ASSERT(i != iniMap.constEnd()); Consolidate version macro...
This commit is contained in:
@@ -30,8 +30,6 @@
|
|||||||
#include "database/databasecommand_updatesearchindex.h"
|
#include "database/databasecommand_updatesearchindex.h"
|
||||||
#include "database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
#define VERSION 6
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
TomahawkSettings* TomahawkSettings::s_instance = 0;
|
TomahawkSettings* TomahawkSettings::s_instance = 0;
|
||||||
@@ -50,24 +48,24 @@ TomahawkSettings::TomahawkSettings( QObject* parent )
|
|||||||
|
|
||||||
if( !contains( "configversion") )
|
if( !contains( "configversion") )
|
||||||
{
|
{
|
||||||
setValue( "configversion", VERSION );
|
setValue( "configversion", TOMAHAWK_SETTINGS_VERSION );
|
||||||
doInitialSetup();
|
doInitialSetup();
|
||||||
}
|
}
|
||||||
else if( value( "configversion" ).toUInt() != VERSION )
|
else if( value( "configversion" ).toUInt() != TOMAHAWK_SETTINGS_VERSION )
|
||||||
{
|
{
|
||||||
qDebug() << "Config version outdated, old:" << value( "configversion" ).toUInt()
|
qDebug() << "Config version outdated, old:" << value( "configversion" ).toUInt()
|
||||||
<< "new:" << VERSION
|
<< "new:" << TOMAHAWK_SETTINGS_VERSION
|
||||||
<< "Doing upgrade, if any...";
|
<< "Doing upgrade, if any...";
|
||||||
|
|
||||||
int current = value( "configversion" ).toUInt();
|
int current = value( "configversion" ).toUInt();
|
||||||
while( current < VERSION )
|
while( current < TOMAHAWK_SETTINGS_VERSION )
|
||||||
{
|
{
|
||||||
doUpgrade( current, current + 1 );
|
doUpgrade( current, current + 1 );
|
||||||
|
|
||||||
current++;
|
current++;
|
||||||
}
|
}
|
||||||
// insert upgrade code here as required
|
// insert upgrade code here as required
|
||||||
setValue( "configversion", VERSION );
|
setValue( "configversion", TOMAHAWK_SETTINGS_VERSION );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,9 @@
|
|||||||
#include <QtNetwork/QNetworkProxy>
|
#include <QtNetwork/QNetworkProxy>
|
||||||
|
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
|
#define TOMAHAWK_SETTINGS_VERSION 6
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience wrapper around QSettings for tomahawk-specific config
|
* Convenience wrapper around QSettings for tomahawk-specific config
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user