1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-14 18:14:50 +02:00

* Make sure our private markAsReady method is connected (and hence called) first. Log a message when db is ready.

This commit is contained in:
Christian Muehlhaeuser
2013-02-24 14:09:57 +01:00
parent 3142e85af6
commit 400f52d10d
2 changed files with 10 additions and 2 deletions

View File

@@ -55,9 +55,9 @@ Database::Database( const QString& dbname, QObject* parent )
tDebug() << Q_FUNC_INFO << "Using" << m_maxConcurrentThreads << "database worker threads"; tDebug() << Q_FUNC_INFO << "Using" << m_maxConcurrentThreads << "database worker threads";
connect( m_impl, SIGNAL( indexReady() ), SLOT( markAsReady() ) );
connect( m_impl, SIGNAL( indexReady() ), SIGNAL( indexReady() ) ); connect( m_impl, SIGNAL( indexReady() ), SIGNAL( indexReady() ) );
connect( m_impl, SIGNAL( indexReady() ), SIGNAL( ready() ) ); connect( m_impl, SIGNAL( indexReady() ), SIGNAL( ready() ) );
connect( m_impl, SIGNAL( indexReady() ), SLOT( setIsReadyTrue() ) );
Q_ASSERT( m_workerRW ); Q_ASSERT( m_workerRW );
m_workerRW.data()->start(); m_workerRW.data()->start();
@@ -192,3 +192,11 @@ Database::impl()
return m_implHash.value( thread ); return m_implHash.value( thread );
} }
void
Database::markAsReady()
{
tLog() << Q_FUNC_INFO << "Database is ready now!";
m_ready = true;
}

View File

@@ -71,7 +71,7 @@ public slots:
void enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc ); void enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc );
private slots: private slots:
void setIsReadyTrue() { m_ready = true; } void markAsReady();
private: private:
bool m_ready; bool m_ready;