1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* This should fix sources being stuck in 'Parsing'.

This commit is contained in:
Christian Muehlhaeuser 2011-11-18 11:39:47 +01:00
parent 0c0a2ea55c
commit b9537802e3
4 changed files with 9 additions and 12 deletions

View File

@ -276,14 +276,15 @@ Connection::socketDisconnected()
}
}
void
Connection::socketDisconnectedError(QAbstractSocket::SocketError e)
Connection::socketDisconnectedError( QAbstractSocket::SocketError e )
{
qDebug() << "SOCKET ERROR CODE" << e << this->name() << "CALLING Connection::shutdown(false)";
if ( e == QAbstractSocket::RemoteHostClosedError )
return;
qDebug() << "SOCKET ERROR CODE" << e << this->name() << "CALLING Connection::shutdown(false)";
m_peer_disconnected = true;
emit socketErrored(e);

View File

@ -63,7 +63,7 @@ DBSyncConnection::DBSyncConnection( Servent* s, const source_ptr& src )
DBSyncConnection::~DBSyncConnection()
{
tDebug() << "DTOR" << Q_FUNC_INFO << m_source->friendlyName();
tDebug() << "DTOR" << Q_FUNC_INFO << m_source->id() << m_source->friendlyName();
m_state = SHUTDOWN;
}
@ -117,8 +117,6 @@ DBSyncConnection::check()
}
m_uscache.clear();
m_us.clear();
changeState( CHECKING );
// load last-modified etc data for our collection and theirs from our DB:
@ -144,7 +142,6 @@ DBSyncConnection::check()
void
DBSyncConnection::gotUs( const QVariantMap& m )
{
m_us = m;
if ( !m_uscache.empty() )
sendOps();
}
@ -227,8 +224,7 @@ DBSyncConnection::handleMsg( msg_ptr msg )
if ( m.value( "method" ).toString() == "fetchops" )
{
m_uscache = m;
if ( !m_us.empty() )
sendOps();
sendOps();
return;
}
@ -278,6 +274,7 @@ DBSyncConnection::sendOpsData( QString sinceguid, QString lastguid, QList< dbop_
m_lastSentOp = lastguid;
if ( ops.length() == 0 )
{
tDebug() << "Sending ok" << m_source->id() << m_source->friendlyName();
sendMsg( Msg::factory( "ok", Msg::DBOP ) );
return;
}

View File

@ -79,7 +79,7 @@ private:
void changeState( State newstate );
Tomahawk::source_ptr m_source;
QVariantMap m_us, m_uscache;
QVariantMap m_uscache;
QString m_lastSentOp;

View File

@ -97,6 +97,7 @@ Source::setStats( const QVariantMap& m )
{
m_stats = m;
emit stats( m_stats );
emit stateChanged();
}
@ -431,8 +432,6 @@ Source::updateTracks()
connect( cmd, SIGNAL( done( QVariantMap ) ),
this, SLOT( setStats( QVariantMap ) ), Qt::QueuedConnection );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
connect( cmd, SIGNAL( finished() ), SIGNAL( stateChanged() ) );
}
}