1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Wipe index on upgrade to settings version 17.

This commit is contained in:
Christian Muehlhaeuser 2014-10-03 00:28:41 +02:00
parent 1e8bab26b2
commit 7758cbb91f
2 changed files with 8 additions and 1 deletions

View File

@ -676,6 +676,10 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
else if ( oldVersion == 15 )
{
// 0.8.0 switches to Lucene++. Force a reindex.
// updateIndex();
}
else if ( oldVersion == 16 )
{
updateIndex();
}
}
@ -1524,12 +1528,15 @@ TomahawkSettings::setPrivateListeningMode( TomahawkSettings::PrivateListeningMod
void
TomahawkSettings::updateIndex()
{
tDebug() << Q_FUNC_INFO;
if ( !Database::instance() || !Database::instance()->isReady() )
{
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
return;
}
tDebug() << Q_FUNC_INFO << "Wiping index.";
Database::instance()->wipeIndex();
Tomahawk::DatabaseCommand* cmd = new Tomahawk::DatabaseCommand_UpdateSearchIndex();
Database::instance()->enqueue( QSharedPointer<Tomahawk::DatabaseCommand>( cmd ) );
}

View File

@ -31,7 +31,7 @@
#include <QNetworkProxy>
#include <QStringList>
#define TOMAHAWK_SETTINGS_VERSION 16
#define TOMAHAWK_SETTINGS_VERSION 17
/**
* Convenience wrapper around QSettings for tomahawk-specific config