<commit_before>Webos.Icon = function WIcon(name, size, theme) {
	if (typeof name == 'undefined') {
		name = 'apps/default';
	}
	
	var nameArray = name.split('/');
	var type = Webos.Icon.types[0];
	if ($.inArray(nameArray[0], Webos.Icon.types) != -1) {
		type = nameArray[0];
		nameArray.shift();
		name = nameArray.join('/');
	}
	
	this.name = name;
	this.type = type;
	
	if (typeof Webos.Icon.sizes[size] != 'undefined') {
		size = Webos.Icon.sizes[size];
	}
	
	this.size = (typeof size == 'undefined' || isNaN(parseInt(size))) ? 48 : parseInt(size);
	this.theme = theme;
	
	this.id = function(size, theme) {
		if (/^[\/(~\/)]/.test(this.name)) {
			return undefined;
		}
		
		size = (typeof size == 'undefined') ? this.size : size;
		
		if (typeof Webos.Icon.cache[this.name] != 'undefined' && Webos.Icon.cache[this.name].size >= size) {
			return Webos.Icon.cache[this.name].id(size, theme);
		}
		
		if (this.type == 'themes') {
			var theme = (typeof theme == 'undefined') ? ((typeof this.theme == 'undefined') ? Webos.Theme.current.get('icons') : this.theme) : size;
			return this.type+'/'+theme+'/'+size+'/'+this.name;
		} else {
			return this.type+'/'+size+'/'+this.name;
		}
	};
	
	this.path = function(size, theme) {
		var id = this.id();
		if (typeof id == 'undefined') {
			return this.name;
		} else {
			return Webos.Icon.path+'/'+id+'.png';
		}
	};
	
	this.realpath = function(size, theme) {
		var id = this.id(size, theme);
		if (typeof id == 'undefined') {
			return 'sbin/filecall.php?file='+this.name;
		} else {
			return 'sbin/filecall.php?file='+id+'&type=icon';
		}
	};
	
	this.toString = function() {
		return this.realpath();
	};
	
	this.is = function(icon) {
		icon = Webos.Icon.toIcon(icon);
		
		if (this.type == icon.type && this.name == icon.name) {
			return true;
		}
		
		return false;
	};
	
	if (!/^[\/(~\/)]/.test(this.name)) {
		Webos.Icon.cache[this.id()] = this;
	}
};

Webos.Icon.types = ['themes', 'applications'];
Webos.Icon.path = '/usr/share/icons';
Webos.Icon.sizes = {
	button: 32
};
Webos.Icon.setTheme = function(theme) {
	Webos.Icon.theme = theme;
};
Webos.Icon.cache = {};
Webos.Icon.toIcon = function(arg) {
	if (arg instanceof Webos.Icon) {
		return arg;<commit_msg>Suppression de la methode Webos.Theme.setTheme() devenue inutile.<commit_after>Webos.Icon = function WIcon(name, size, theme) {
	if (typeof name == 'undefined') {
		name = 'apps/default';
	}
	
	var nameArray = name.split('/');
	var type = Webos.Icon.types[0];
	if ($.inArray(nameArray[0], Webos.Icon.types) != -1) {
		type = nameArray[0];
		nameArray.shift();
		name = nameArray.join('/');
	}
	
	this.name = name;
	this.type = type;
	
	if (typeof Webos.Icon.sizes[size] != 'undefined') {
		size = Webos.Icon.sizes[size];
	}
	
	this.size = (typeof size == 'undefined' || isNaN(parseInt(size))) ? 48 : parseInt(size);
	this.theme = theme;
	
	this.id = function(size, theme) {
		if (/^[\/(~\/)]/.test(this.name)) {
			return undefined;
		}
		
		size = (typeof size == 'undefined') ? this.size : size;
		
		if (typeof Webos.Icon._cache[this.name] != 'undefined' && Webos.Icon._cache[this.name].size >= size) {
			return Webos.Icon._cache[this.name].id(size, theme);
		}
		
		if (this.type == 'themes') {
			var theme = (typeof theme == 'undefined') ? ((typeof this.theme == 'undefined') ? Webos.Theme.current.get('icons') : this.theme) : size;
			return this.type+'/'+theme+'/'+size+'/'+this.name;
		} else {
			return this.type+'/'+size+'/'+this.name;
		}
	};
	
	this.path = function(size, theme) {
		var id = this.id();
		if (typeof id == 'undefined') {
			return this.name;
		} else {
			return Webos.Icon.path+'/'+id+'.png';
		}
	};
	
	this.realpath = function(size, theme) {
		var id = this.id(size, theme);
		if (typeof id == 'undefined') {
			return 'sbin/filecall.php?file='+this.name;
		} else {
			return 'sbin/filecall.php?file='+id+'&type=icon';
		}
	};
	
	this.toString = function() {
		return this.realpath();
	};
	
	this.is = function(icon) {
		icon = Webos.Icon.toIcon(icon);
		
		if (this.type == icon.type && this.name == icon.name) {
			return true;
		}
		
		return false;
	};
	
	if (!/^[\/(~\/)]/.test(this.name)) {
		Webos.Icon._cache[this.id()] = this;
	}
};

Webos.Icon.types = ['themes', 'applications'];
Webos.Icon.path = '/usr/share/icons';
Webos.Icon.sizes = {
	button: 32
};
Webos.Icon._cache = {};
Webos.Icon.toIcon = function(arg) {
	if (arg instanceof Webos.Icon) {
		return arg;
{'fraction_non_alphanumeric': 0.21084745762711865, 'fraction_numerical': 0.003615819209039548, 'mean_word_length': 3.3096397273612466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3270770', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1658, 'n_words': 319}