1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

Make tomahawk.js more portable

This commit is contained in:
Uwe L. Korn
2013-07-17 18:21:37 +02:00
parent fc45207ba7
commit c0b54f0410
2 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
*/ */
// if run in phantomjs add fake Tomahawk environment // if run in phantomjs add fake Tomahawk environment
if (window.Tomahawk === undefined) { if ((typeof Tomahawk === "undefined") || (Tomahawk === null)) {
var Tomahawk = { var Tomahawk = {
fakeEnv: function () { fakeEnv: function () {
return true; return true;
@@ -302,8 +302,8 @@ Tomahawk.asyncRequest = function (url, callback, extraHeaders, options) {
xmlHttpRequest.send(null); xmlHttpRequest.send(null);
}; };
Tomahawk.sha256 = CryptoJS.SHA256; Tomahawk.sha256 = Tomahawk.sha256 || CryptoJS.SHA256;
// some aliases // some aliases
Tomahawk.setTimeout = window.setTimeout; Tomahawk.setTimeout = Tomahawk.setTimeout || window.setTimeout;
Tomahawk.setInterval = window.setInterval; Tomahawk.setInterval = Tomahawk.setInterval || window.setInterval;

View File

@@ -940,7 +940,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
{ {
const QString plid = msg.value( "playlistid" ).toString(); const QString plid = msg.value( "playlistid" ).toString();
// We should already be syncing this playlist if we get updates for it // We should already be syncing this playlist if we get updates for it
Q_ASSERT( m_updaters.contains( plid ) ); // Q_ASSERT( m_updaters.contains( plid ) );
if ( !m_updaters.contains( plid ) ) if ( !m_updaters.contains( plid ) )
return; return;