mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 23:35:32 +02:00
* Force an index update after 0.3.1 upgrade.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
DatabaseCommand_UpdateSearchIndex::DatabaseCommand_UpdateSearchIndex()
|
||||
: DatabaseCommand()
|
||||
{
|
||||
tLog() << Q_FUNC_INFO << "Updating index.";
|
||||
}
|
||||
|
||||
|
||||
|
@@ -31,7 +31,10 @@
|
||||
#include "utils/logger.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#define VERSION 4
|
||||
#include "database/databasecommand_updatesearchindex.h"
|
||||
#include "database/database.h"
|
||||
|
||||
#define VERSION 5
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@@ -224,6 +227,10 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
||||
tDebug() << "UPGRADING AND DELETING:" << resolverDir.absolutePath();
|
||||
TomahawkUtils::removeDirectory( resolverDir.absolutePath() );
|
||||
}
|
||||
} else if ( oldVersion == 4 )
|
||||
{
|
||||
// 0.3.0 contained a bug which prevent indexing local files. Force a reindex.
|
||||
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,3 +1004,11 @@ TomahawkSettings::setPrivateListeningMode( TomahawkSettings::PrivateListeningMod
|
||||
{
|
||||
setValue( "privatelisteningmode", mode );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::updateIndex()
|
||||
{
|
||||
DatabaseCommand* cmd = new DatabaseCommand_UpdateSearchIndex();
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
|
||||
}
|
||||
|
@@ -219,6 +219,9 @@ signals:
|
||||
void changed();
|
||||
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
|
||||
|
||||
private slots:
|
||||
void updateIndex();
|
||||
|
||||
private:
|
||||
void doInitialSetup();
|
||||
void doUpgrade( int oldVersion, int newVersion );
|
||||
|
Reference in New Issue
Block a user