This commit is contained in:
Ashley Wulber 2021-12-28 13:06:04 -05:00
parent 6c46fb03a6
commit 5a4a802751

View file

@ -1,19 +0,0 @@
use gio::DesktopAppInfo;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, glib::GBoxed)]
#[gboxed(type_name = "MyBoxed")]
struct MyBoxed(DesktopAppInfo);
pub fn main() {
let appinfo = DesktopAppInfo::new("firefox.desktop").expect("failed to get app info");
assert!(MyBoxed::static_type().is_valid());
let b = MyBoxed(appinfo);
let v = b.to_value();
let b2 = v.get::<&MyBoxed>().unwrap();
assert_eq!(&b, b2);
dbg!(&b2.0.filename());
}