mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Back up old config file before upgrading, when it's an ini file
This commit is contained in:
@@ -60,8 +60,22 @@ TomahawkSettings::TomahawkSettings( QObject* parent )
|
||||
{
|
||||
qDebug() << "Config version outdated, old:" << value( "configversion" ).toUInt()
|
||||
<< "new:" << TOMAHAWK_SETTINGS_VERSION
|
||||
<< "Doing upgrade, if any...";
|
||||
<< "Doing upgrade, if any, and backing up";
|
||||
|
||||
// QString newname = QString( "%1.v%2" ).arg( dbname ).arg( version );
|
||||
if ( format() == IniFormat ||
|
||||
( format() == NativeFormat
|
||||
#ifdef Q_OS_WIN
|
||||
&& false
|
||||
#endif
|
||||
) )
|
||||
{
|
||||
qDebug() << "Backing up old ini-style config file";
|
||||
const QString path = fileName();
|
||||
const QString newname = path + QString( ".v%1" ).arg( value( "configversion" ).toString() );
|
||||
QFile::copy( path, newname );
|
||||
|
||||
}
|
||||
int current = value( "configversion" ).toUInt();
|
||||
while ( current < TOMAHAWK_SETTINGS_VERSION )
|
||||
{
|
||||
|
Reference in New Issue
Block a user