mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
resize resolver icons before storing them
This commit is contained in:
@@ -333,14 +333,22 @@ QtScriptResolver::init()
|
|||||||
icoData = qUncompress( QByteArray::fromBase64( icoData ) );
|
icoData = qUncompress( QByteArray::fromBase64( icoData ) );
|
||||||
else
|
else
|
||||||
icoData = QByteArray::fromBase64( icoData );
|
icoData = QByteArray::fromBase64( icoData );
|
||||||
bool success = m_icon.loadFromData( icoData );
|
QPixmap ico;
|
||||||
|
ico.loadFromData( icoData );
|
||||||
|
|
||||||
|
bool success = false;
|
||||||
|
if ( !ico.isNull() )
|
||||||
|
{
|
||||||
|
m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio );
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
|
||||||
// load config widget and apply settings
|
// load config widget and apply settings
|
||||||
loadUi();
|
loadUi();
|
||||||
QVariantMap config = resolverUserConfig();
|
QVariantMap config = resolverUserConfig();
|
||||||
fillDataInWidgets( config );
|
fillDataInWidgets( config );
|
||||||
|
|
||||||
qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon found" << success;
|
qDebug() << "JS" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success;
|
||||||
|
|
||||||
m_ready = true;
|
m_ready = true;
|
||||||
}
|
}
|
||||||
|
@@ -383,9 +383,17 @@ ScriptResolver::doSetup( const QVariantMap& m )
|
|||||||
icoData = qUncompress( QByteArray::fromBase64( icoData ) );
|
icoData = qUncompress( QByteArray::fromBase64( icoData ) );
|
||||||
else
|
else
|
||||||
icoData = QByteArray::fromBase64( icoData );
|
icoData = QByteArray::fromBase64( icoData );
|
||||||
bool success = m_icon.loadFromData( icoData );
|
QPixmap ico;
|
||||||
|
ico.loadFromData( icoData );
|
||||||
|
|
||||||
qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon found" << success;
|
bool success = false;
|
||||||
|
if ( !ico.isNull() )
|
||||||
|
{
|
||||||
|
m_icon = ico.scaled( m_icon.size(), Qt::IgnoreAspectRatio );
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "SCRIPT" << filePath() << "READY," << "name" << m_name << "weight" << m_weight << "timeout" << m_timeout << "icon received" << success;
|
||||||
|
|
||||||
m_ready = true;
|
m_ready = true;
|
||||||
m_configSent = false;
|
m_configSent = false;
|
||||||
|
Reference in New Issue
Block a user