1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02: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 ) else if ( oldVersion == 15 )
{ {
// 0.8.0 switches to Lucene++. Force a reindex. // 0.8.0 switches to Lucene++. Force a reindex.
// updateIndex();
}
else if ( oldVersion == 16 )
{
updateIndex(); updateIndex();
} }
} }
@@ -1524,12 +1528,15 @@ TomahawkSettings::setPrivateListeningMode( TomahawkSettings::PrivateListeningMod
void void
TomahawkSettings::updateIndex() TomahawkSettings::updateIndex()
{ {
tDebug() << Q_FUNC_INFO;
if ( !Database::instance() || !Database::instance()->isReady() ) if ( !Database::instance() || !Database::instance()->isReady() )
{ {
QTimer::singleShot( 0, this, SLOT( updateIndex() ) ); QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
return; return;
} }
tDebug() << Q_FUNC_INFO << "Wiping index.";
Database::instance()->wipeIndex();
Tomahawk::DatabaseCommand* cmd = new Tomahawk::DatabaseCommand_UpdateSearchIndex(); Tomahawk::DatabaseCommand* cmd = new Tomahawk::DatabaseCommand_UpdateSearchIndex();
Database::instance()->enqueue( QSharedPointer<Tomahawk::DatabaseCommand>( cmd ) ); Database::instance()->enqueue( QSharedPointer<Tomahawk::DatabaseCommand>( cmd ) );
} }

View File

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