1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-28 16:20:01 +02:00

* Fixed using resolv-hints for offline sources.

This commit is contained in:
Christian Muehlhaeuser
2011-01-10 12:00:52 +01:00
parent 18d5d43695
commit 0dd7d1e0e0
2 changed files with 15 additions and 5 deletions

View File

@@ -37,14 +37,21 @@ DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
if ( !m.isEmpty() )
{
if ( m.value( "srcid" ).toUInt() > 0 )
coll = SourceList::instance()->get( m.value( "srcid" ).toUInt() )->collection();
{
source_ptr s = SourceList::instance()->get( m.value( "srcid" ).toUInt() );
if ( !s.isNull() )
coll = s->collection();
}
else
coll = SourceList::instance()->getLocal()->collection();
res << Tomahawk::result_ptr( new Tomahawk::Result( m, coll ) );
emit results( qid, res );
if ( !coll.isNull() )
{
res << Tomahawk::result_ptr( new Tomahawk::Result( m, coll ) );
emit results( qid, res );
return;
return;
}
}
}

View File

@@ -477,6 +477,7 @@ DatabaseImpl::result( const QString& url )
{
TomahawkSqlQuery query = newquery();
Tomahawk::source_ptr s;
QVariantMap m;
QString fileUrl;
if ( url.contains( "servent://" ) )
@@ -484,6 +485,9 @@ DatabaseImpl::result( const QString& url )
QStringList parts = url.mid( QString( "servent://" ).length() ).split( "\t" );
s = SourceList::instance()->get( parts.at( 0 ) );
fileUrl = parts.at( 1 );
if ( s.isNull() )
return m;
}
else if ( url.contains( "file://" ) )
{
@@ -518,7 +522,6 @@ DatabaseImpl::result( const QString& url )
query.bindValue( 0, fileUrl );
query.exec();
QVariantMap m;
if( query.next() )
{
const QString url_str = query.value( 0 ).toString();