fix method of getting data from list model object
This commit is contained in:
parent
c876b46f44
commit
8737c39a70
2 changed files with 44 additions and 35 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use gtk4::glib;
|
||||
|
||||
use crate::utils::BoxedSearchResult;
|
||||
use gtk4::glib;
|
||||
use gtk4::prelude::*;
|
||||
use gtk4::subclass::prelude::*;
|
||||
|
||||
mod imp;
|
||||
|
||||
|
|
@ -12,4 +13,13 @@ impl SearchResultObject {
|
|||
pub fn new(search_result: &BoxedSearchResult) -> Self {
|
||||
glib::Object::new(&[("data", search_result)]).expect("Failed to create Application Object")
|
||||
}
|
||||
|
||||
pub fn data(&self) -> Option<pop_launcher::SearchResult> {
|
||||
if let Ok(data) = self.property("data") {
|
||||
if let Ok(search_result) = data.get::<BoxedSearchResult>() {
|
||||
return search_result.0;
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue