From f0542071d40531e67c068829fb4bbdbf4a94d7f9 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 28 Dec 2021 11:19:55 -0500 Subject: [PATCH] rename search result object and row --- examples/launcher/main.rs | 8 ++++---- .../imp.rs | 10 +++++----- .../mod.rs | 4 ++-- .../application_row.ui | 2 +- .../imp.rs | 14 +++++++------- .../mod.rs | 16 ++++++++-------- examples/launcher/window/mod.rs | 16 ++++++++-------- 7 files changed, 35 insertions(+), 35 deletions(-) rename examples/launcher/{application_object => search_result_object}/imp.rs (87%) rename examples/launcher/{application_object => search_result_object}/mod.rs (71%) rename examples/launcher/{application_row => search_result_row}/application_row.ui (97%) rename examples/launcher/{application_row => search_result_row}/imp.rs (74%) rename examples/launcher/{application_row => search_result_row}/mod.rs (69%) diff --git a/examples/launcher/main.rs b/examples/launcher/main.rs index bb2ab99f..166078d0 100644 --- a/examples/launcher/main.rs +++ b/examples/launcher/main.rs @@ -1,9 +1,9 @@ -mod application_object; -mod application_row; +mod search_result_object; +mod search_result_row; mod utils; mod window; -use self::application_object::ApplicationObject; +use self::search_result_object::SearchResultObject; use self::window::Window; use crate::utils::BoxedSearchResult; use gdk4::Display; @@ -126,7 +126,7 @@ fn main() { let new_results: Vec = results // [0..std::cmp::min(results.len(), NUM_LAUNCHER_ITEMS.into())] .into_iter() - .map(|result| ApplicationObject::new(&BoxedSearchResult(Some(result))).upcast()) + .map(|result| SearchResultObject::new(&BoxedSearchResult(Some(result))).upcast()) .collect(); model.splice(0, model_len, &new_results[..]); } else if let pop_launcher::Response::DesktopEntry { diff --git a/examples/launcher/application_object/imp.rs b/examples/launcher/search_result_object/imp.rs similarity index 87% rename from examples/launcher/application_object/imp.rs rename to examples/launcher/search_result_object/imp.rs index aec04548..da29af01 100644 --- a/examples/launcher/application_object/imp.rs +++ b/examples/launcher/search_result_object/imp.rs @@ -10,20 +10,20 @@ use std::rc::Rc; // Object holding the state #[derive(Default)] -pub struct ApplicationObject { +pub struct SearchResultObject { data: Rc>, } // The central trait for subclassing a GObject #[glib::object_subclass] -impl ObjectSubclass for ApplicationObject { - const NAME: &'static str = "ApplicationObject"; - type Type = super::ApplicationObject; +impl ObjectSubclass for SearchResultObject { + const NAME: &'static str = "SearchResultObject"; + type Type = super::SearchResultObject; type ParentType = glib::Object; } // Trait shared by all GObjects -impl ObjectImpl for ApplicationObject { +impl ObjectImpl for SearchResultObject { fn properties() -> &'static [ParamSpec] { static PROPERTIES: Lazy> = Lazy::new(|| { vec![ParamSpec::new_boxed( diff --git a/examples/launcher/application_object/mod.rs b/examples/launcher/search_result_object/mod.rs similarity index 71% rename from examples/launcher/application_object/mod.rs rename to examples/launcher/search_result_object/mod.rs index 6d659a73..53d470cf 100644 --- a/examples/launcher/application_object/mod.rs +++ b/examples/launcher/search_result_object/mod.rs @@ -3,10 +3,10 @@ use crate::utils::BoxedSearchResult; use gdk4::glib::Object; glib::wrapper! { - pub struct ApplicationObject(ObjectSubclass); + pub struct SearchResultObject(ObjectSubclass); } -impl ApplicationObject { +impl SearchResultObject { pub fn new(search_result: &BoxedSearchResult) -> Self { Object::new(&[("data", search_result)]).expect("Failed to create Application Object") } diff --git a/examples/launcher/application_row/application_row.ui b/examples/launcher/search_result_row/application_row.ui similarity index 97% rename from examples/launcher/application_row/application_row.ui rename to examples/launcher/search_result_row/application_row.ui index 0a6390ae..0bee2349 100644 --- a/examples/launcher/application_row/application_row.ui +++ b/examples/launcher/search_result_row/application_row.ui @@ -1,6 +1,6 @@ -