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:
@@ -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 ) );
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user