mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-27 07:44:34 +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_UpdateSearchIndex::DatabaseCommand_UpdateSearchIndex()
|
||||||
: DatabaseCommand()
|
: DatabaseCommand()
|
||||||
{
|
{
|
||||||
|
tLog() << Q_FUNC_INFO << "Updating index.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,7 +31,10 @@
|
|||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "utils/tomahawkutils.h"
|
#include "utils/tomahawkutils.h"
|
||||||
|
|
||||||
#define VERSION 4
|
#include "database/databasecommand_updatesearchindex.h"
|
||||||
|
#include "database/database.h"
|
||||||
|
|
||||||
|
#define VERSION 5
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -224,6 +227,10 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
tDebug() << "UPGRADING AND DELETING:" << resolverDir.absolutePath();
|
tDebug() << "UPGRADING AND DELETING:" << resolverDir.absolutePath();
|
||||||
TomahawkUtils::removeDirectory( 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 );
|
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 changed();
|
||||||
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
|
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateIndex();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void doInitialSetup();
|
void doInitialSetup();
|
||||||
void doUpgrade( int oldVersion, int newVersion );
|
void doUpgrade( int oldVersion, int newVersion );
|
||||||
|
Reference in New Issue
Block a user