This commit is contained in:
bleakgrey 2018-05-19 00:24:22 +03:00
parent 7323bc6836
commit 72cddb0541
2 changed files with 9 additions and 12 deletions

View File

@ -135,9 +135,15 @@ public class Tootle.NetManager : GLib.Object {
public void load_image (string url, Gtk.Image image) { public void load_image (string url, Gtk.Image image) {
var msg = new Soup.Message("GET", url); var msg = new Soup.Message("GET", url);
msg.finished.connect(() => { msg.finished.connect(() => {
var data = msg.response_body.flatten ().data; // var data = msg.response_body.flatten ().data;
var stream = new MemoryInputStream.from_data (data); // var stream = new MemoryInputStream.from_data (data);
var pixbuf = new Gdk.Pixbuf.from_stream (stream); // var pixbuf = new Gdk.Pixbuf.from_stream (stream);
// image.set_from_pixbuf (pixbuf);
var loader = new PixbufLoader ();
loader.write (msg.response_body.data);
loader.close ();
var pixbuf = loader.get_pixbuf ();
image.set_from_pixbuf (pixbuf); image.set_from_pixbuf (pixbuf);
}); });
Tootle.network.queue (msg); Tootle.network.queue (msg);

View File

@ -16,15 +16,6 @@ public class Tootle.HomeView : Tootle.AbstractView {
request (); request ();
} }
public override void clear (){
max_id = -1;
view.forall (widget => {
widget.destroy ();
});
pre_construct ();
}
public override string get_icon () { public override string get_icon () {
return "user-home-symbolic"; return "user-home-symbolic";
} }