1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-14 12:59:41 +01:00

Style and debug spam cleanup

This commit is contained in:
Dominik Schmidt 2014-11-17 16:13:08 +01:00
parent b3ace2f05a
commit 91af16fc18
2 changed files with 4 additions and 10 deletions

View File

@ -96,10 +96,9 @@ Tomahawk.InfoSystem.PushInfoFlags.PushShortUrlFlag = 2;
Tomahawk.InfoSystem._infoPluginIdCounter = 0; Tomahawk.InfoSystem._infoPluginIdCounter = 0;
Tomahawk.InfoSystem._infoPluginHash = Object.create(null); Tomahawk.InfoSystem._infoPluginHash = Object.create(null);
Tomahawk.InfoSystem.addInfoPlugin = function(infoPlugin) { Tomahawk.InfoSystem.addInfoPlugin = function (infoPlugin) {
var infoPluginId = Tomahawk.InfoSystem._infoPluginIdCounter++; var infoPluginId = Tomahawk.InfoSystem._infoPluginIdCounter++;
Tomahawk.InfoSystem._infoPluginHash[infoPluginId] = infoPlugin; Tomahawk.InfoSystem._infoPluginHash[infoPluginId] = infoPlugin;
Tomahawk.log("Call nativeAddInfoPlugin");
Tomahawk.InfoSystem.nativeAddInfoPlugin(infoPluginId); Tomahawk.InfoSystem.nativeAddInfoPlugin(infoPluginId);
}; };
@ -113,7 +112,7 @@ Tomahawk.InfoSystem.removeInfoPlugin = function (infoPluginId) {
}; };
Tomahawk.InfoSystem.InfoPlugin = { Tomahawk.InfoSystem.InfoPlugin = {
infoTypeString: function(infoType) { infoTypeString: function (infoType) {
for (var currentInfoTypeString in Tomahawk.InfoSystem.InfoType) { for (var currentInfoTypeString in Tomahawk.InfoSystem.InfoType) {
if (Tomahawk.InfoSystem.InfoType[currentInfoTypeString] === infoType) { if (Tomahawk.InfoSystem.InfoType[currentInfoTypeString] === infoType) {
return currentInfoTypeString; return currentInfoTypeString;
@ -123,7 +122,6 @@ Tomahawk.InfoSystem.InfoPlugin = {
// we can get around infoPluginId here probably ... but internal either way // we can get around infoPluginId here probably ... but internal either way
_notInCache: function (infoPluginId, requestId, requestType, criteria) { _notInCache: function (infoPluginId, requestId, requestType, criteria) {
this.notInCache(requestType, criteria).then(function(result) { this.notInCache(requestType, criteria).then(function(result) {
Tomahawk.log("Call nativeAddInfoRequestResult");
Tomahawk.InfoSystem.nativeAddInfoRequestResult(infoPluginId, requestId, result.maxAge, result.data); Tomahawk.InfoSystem.nativeAddInfoRequestResult(infoPluginId, requestId, result.maxAge, result.data);
}).catch(function() { }).catch(function() {
// TODO: how to handle errors here?! // TODO: how to handle errors here?!
@ -131,7 +129,6 @@ Tomahawk.InfoSystem.InfoPlugin = {
}, },
notInCache: function (infoType, criteria) { notInCache: function (infoType, criteria) {
var requestMethod = 'request' + this.infoTypeString(infoType); var requestMethod = 'request' + this.infoTypeString(infoType);
Tomahawk.log('Calling requestMethod: ' + requestMethod);
return Promise.resolve(this[requestMethod](criteria)); return Promise.resolve(this[requestMethod](criteria));
}, },
@ -141,10 +138,7 @@ Tomahawk.InfoSystem.InfoPlugin = {
}, },
// we can get around infoPluginId here probably ... but internal either way // we can get around infoPluginId here probably ... but internal either way
_getInfo: function (infoPluginId, requestId, type, infoHash) { _getInfo: function (infoPluginId, requestId, type, infoHash) {
Tomahawk.log("currentInfoPlugin._getInfo");
window.getInfo = arguments;
this.getInfo(type, infoHash).then(function(result) { this.getInfo(type, infoHash).then(function(result) {
Tomahawk.log("Call nativeGetCachedInfo");
Tomahawk.InfoSystem.nativeGetCachedInfo(infoPluginId, requestId, result.newMaxAge, result.criteria) Tomahawk.InfoSystem.nativeGetCachedInfo(infoPluginId, requestId, result.newMaxAge, result.criteria)
}, function() { }, function() {
Tomahawk.log("Call nativeDataError"); Tomahawk.log("Call nativeDataError");
@ -152,7 +146,6 @@ Tomahawk.InfoSystem.InfoPlugin = {
}); });
}, },
getInfo: function (type, infoHash) { getInfo: function (type, infoHash) {
Tomahawk.log("currentInfoPlugin.getInfo");
var getInfoMethod = 'get' + this.infoTypeString(type); var getInfoMethod = 'get' + this.infoTypeString(type);
return Promise.resolve(this[getInfoMethod](infoHash)); return Promise.resolve(this[getInfoMethod](infoHash));

View File

@ -1020,7 +1020,8 @@ JSResolver::callOnResolver( const QString& scriptSource )
} }
QString JSResolver::escape( const QString& source ) QString
JSResolver::escape( const QString& source )
{ {
QString copy = source; QString copy = source;
return copy.replace( "\\", "\\\\" ).replace( "'", "\\'" ); return copy.replace( "\\", "\\\\" ).replace( "'", "\\'" );