mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Don't manually delete the fuzzy index, instead rely on QObject parenting.
This commit is contained in:
@@ -74,7 +74,7 @@ DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )
|
|||||||
// in case of unclean shutdown last time:
|
// in case of unclean shutdown last time:
|
||||||
query.exec( "UPDATE source SET isonline = 'false'" );
|
query.exec( "UPDATE source SET isonline = 'false'" );
|
||||||
|
|
||||||
m_fuzzyIndex = new FuzzyIndex( schemaUpdated );
|
m_fuzzyIndex = new FuzzyIndex( this, schemaUpdated );
|
||||||
if ( schemaUpdated )
|
if ( schemaUpdated )
|
||||||
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
||||||
|
|
||||||
@@ -113,8 +113,6 @@ DatabaseImpl::init()
|
|||||||
|
|
||||||
DatabaseImpl::~DatabaseImpl()
|
DatabaseImpl::~DatabaseImpl()
|
||||||
{
|
{
|
||||||
delete m_fuzzyIndex;
|
|
||||||
|
|
||||||
tDebug() << "Shutting down database.";
|
tDebug() << "Shutting down database.";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -38,8 +38,8 @@ using namespace lucene::queryParser;
|
|||||||
using namespace lucene::search;
|
using namespace lucene::search;
|
||||||
|
|
||||||
|
|
||||||
FuzzyIndex::FuzzyIndex( bool wipeIndex )
|
FuzzyIndex::FuzzyIndex( QObject* parent, bool wipeIndex )
|
||||||
: QObject()
|
: QObject( parent )
|
||||||
, m_luceneReader( 0 )
|
, m_luceneReader( 0 )
|
||||||
, m_luceneSearcher( 0 )
|
, m_luceneSearcher( 0 )
|
||||||
{
|
{
|
||||||
|
@@ -55,7 +55,7 @@ class FuzzyIndex : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FuzzyIndex( bool wipeIndex = false );
|
explicit FuzzyIndex( QObject* parent, bool wipeIndex = false );
|
||||||
~FuzzyIndex();
|
~FuzzyIndex();
|
||||||
|
|
||||||
void beginIndexing();
|
void beginIndexing();
|
||||||
|
Reference in New Issue
Block a user