minor, property name
This commit is contained in:
parent
11b90ecc0a
commit
408929848d
15
files.js
15
files.js
|
|
@ -49,8 +49,8 @@ var Image = new Lang.Class({
|
||||||
return {
|
return {
|
||||||
displayName: this.displayName,
|
displayName: this.displayName,
|
||||||
contentType: this.contentType,
|
contentType: this.contentType,
|
||||||
_base64: this.base64,
|
base64: this.base64,
|
||||||
_hash: this.hash
|
hash: this.hash
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ var Image = new Lang.Class({
|
||||||
if (this.file)
|
if (this.file)
|
||||||
this._bytes = this.file.load_bytes(null)[0];
|
this._bytes = this.file.load_bytes(null)[0];
|
||||||
else
|
else
|
||||||
this._bytes = new GLib.Bytes(GLib.base64_decode(this._base64));
|
this._bytes = new GLib.Bytes(GLib.base64_decode(this.base64));
|
||||||
}
|
}
|
||||||
return this._bytes;
|
return this._bytes;
|
||||||
},
|
},
|
||||||
|
|
@ -77,12 +77,21 @@ var Image = new Lang.Class({
|
||||||
return this._base64;
|
return this._base64;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set base64(base64) {
|
||||||
|
this._base64 = base64;
|
||||||
|
},
|
||||||
|
|
||||||
|
// hash is not used
|
||||||
get hash() {
|
get hash() {
|
||||||
if (!this._hash)
|
if (!this._hash)
|
||||||
this._hash = this.bytes.hash();
|
this._hash = this.bytes.hash();
|
||||||
return this._hash;
|
return this._hash;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set hash(hash) {
|
||||||
|
this._hash = hash;
|
||||||
|
},
|
||||||
|
|
||||||
get pixbuf() {
|
get pixbuf() {
|
||||||
if (!this._pixbuf) {
|
if (!this._pixbuf) {
|
||||||
let stream = Gio.MemoryInputStream.new_from_bytes(this.bytes);
|
let stream = Gio.MemoryInputStream.new_from_bytes(this.bytes);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue