From 1c49c16687a485bb6f2465e8a747e33e4467d1cb Mon Sep 17 00:00:00 2001 From: Sanpi Date: Fri, 7 Feb 2020 22:07:42 +0100 Subject: [PATCH] Updates relm to 0.19 --- Cargo.toml | 18 +++++++----------- src/add.rs | 2 +- src/agenda.rs | 2 +- src/application/widget.rs | 2 +- src/done.rs | 2 +- src/edit.rs | 2 +- src/flag.rs | 2 +- src/inbox.rs | 2 +- src/logger.rs | 2 +- src/main.rs | 2 -- src/search.rs | 2 +- src/widgets/calendar.rs | 2 +- src/widgets/circle.rs | 2 +- src/widgets/filter.rs | 14 +++++++------- src/widgets/keywords.rs | 10 +++++----- src/widgets/priority.rs | 2 +- src/widgets/repeat.rs | 2 +- src/widgets/tags.rs | 2 +- src/widgets/task.rs | 2 +- src/widgets/tasks.rs | 2 +- 20 files changed, 35 insertions(+), 41 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7061460..03f9db6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,24 +6,23 @@ homepage = "https://github.com/sanpii/effitask" edition = "2018" [dependencies] -cairo-rs = "^0.7" +cairo-rs = "^0.8" chrono = "^0.4" -gdk = "^0.11" +dirs-sys = "^0.3" +gdk = "^0.12" gdk-sys = "^0.9" -glib = "^0.8" +glib = "^0.9" human-panic = "^1.0" lazy_static = "^1.4" notify = "^4.0" pulldown-cmark = "^0.6" rand = "^0.7" regex = "^1.0" -relm = "^0.18" -relm-attributes = "^0.16" -relm-derive = "^0.18" -xdg = "^2.1" +relm = "^0.19" +relm-derive = "^0.19" [dependencies.gtk] -version = "0.7" +version = "0.8" features = ["v3_22"] [dependencies.log] @@ -34,8 +33,5 @@ features = ["std"] version = "^1.2" features = ["extended"] -[features] -default = ["relm-attributes/unstable"] - [badges] gitlab = { repository = "sanpi/effitask", branch = "master" } diff --git a/src/add.rs b/src/add.rs index afd5d0d..836a6a0 100644 --- a/src/add.rs +++ b/src/add.rs @@ -5,7 +5,7 @@ pub enum Msg { Add(Option), } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model(_: ()) {} diff --git a/src/agenda.rs b/src/agenda.rs index 5b2c906..f39f775 100644 --- a/src/agenda.rs +++ b/src/agenda.rs @@ -130,7 +130,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model(_: ()) {} diff --git a/src/application/widget.rs b/src/application/widget.rs index 28e735c..1350b0f 100644 --- a/src/application/widget.rs +++ b/src/application/widget.rs @@ -398,7 +398,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn init_view(&mut self) { self.edit.widget().hide(); diff --git a/src/done.rs b/src/done.rs index 52c8ebb..c580cbf 100644 --- a/src/done.rs +++ b/src/done.rs @@ -17,7 +17,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model(_: ()) {} diff --git a/src/edit.rs b/src/edit.rs index 714d53c..8b641f0 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -126,7 +126,7 @@ impl Widget { } #[allow(clippy::cognitive_complexity)] -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn init_view(&mut self) { self.note.set_property_height_request(150); diff --git a/src/flag.rs b/src/flag.rs index d7439fb..91ab3cf 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -31,7 +31,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model(_: ()) {} diff --git a/src/inbox.rs b/src/inbox.rs index 6d8289b..cfc09e7 100644 --- a/src/inbox.rs +++ b/src/inbox.rs @@ -31,7 +31,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model() {} diff --git a/src/logger.rs b/src/logger.rs index c2170e0..6268aa2 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -119,7 +119,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn init_view(&mut self) { self.init(); diff --git a/src/main.rs b/src/main.rs index dc6e6d5..2e974f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#[macro_use] -extern crate relm; use relm::Widget; diff --git a/src/search.rs b/src/search.rs index 68149ce..d42a396 100644 --- a/src/search.rs +++ b/src/search.rs @@ -34,7 +34,7 @@ impl Widget { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Widget { fn model(_: ()) -> String { String::new() diff --git a/src/widgets/calendar.rs b/src/widgets/calendar.rs index d8157ca..c2b854e 100644 --- a/src/widgets/calendar.rs +++ b/src/widgets/calendar.rs @@ -92,7 +92,7 @@ impl Calendar { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Calendar { fn init_view(&mut self) { self.entry diff --git a/src/widgets/circle.rs b/src/widgets/circle.rs index da82578..97a87d6 100644 --- a/src/widgets/circle.rs +++ b/src/widgets/circle.rs @@ -87,7 +87,7 @@ impl Circle { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Circle { fn init_view(&mut self) { self.model.draw_handler.init(&self.drawing_area); diff --git a/src/widgets/filter.rs b/src/widgets/filter.rs index 5733206..c95e290 100644 --- a/src/widgets/filter.rs +++ b/src/widgets/filter.rs @@ -109,7 +109,7 @@ impl Filter { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Filter { fn init_view(&mut self) { self.filters.set_size_request(200, -1); @@ -134,10 +134,10 @@ impl relm::Widget for Filter { fn model(_: ()) -> gtk::TreeStore { let columns = vec![ - gtk::Type::String, - gtk::Type::String, - gtk::Type::U32, - gtk::Type::String, + glib::types::Type::String, + glib::types::Type::String, + glib::types::Type::U32, + glib::types::Type::String, ]; gtk::TreeStore::new(&columns) @@ -177,8 +177,8 @@ impl relm::Widget for Filter { }; match list_model.get_value(&iter, Column::Raw.into()).get() { - Some(value) => filters.push(value), - None => continue, + Ok(Some(value)) => filters.push(value), + Ok(None) | Err(_) => continue, }; } diff --git a/src/widgets/keywords.rs b/src/widgets/keywords.rs index 8bcbead..a9c1471 100644 --- a/src/widgets/keywords.rs +++ b/src/widgets/keywords.rs @@ -81,15 +81,15 @@ impl Keywords { None => return keywords, }; - while let Some(name) = self.model.store.get_value(&iter, Column::Name.into()).get() { + while let Ok(Some(name)) = self.model.store.get_value(&iter, Column::Name.into()).get() { let value = match self .model .store .get_value(&iter, Column::Value.into()) .get() { - Some(value) => value, - None => break, + Ok(Some(value)) => value, + Ok(None) | Err(_) => break, }; keywords.insert(name, value); @@ -117,7 +117,7 @@ impl Keywords { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Keywords { fn init_view(&mut self) { self.scroll @@ -160,7 +160,7 @@ impl relm::Widget for Keywords { } fn model(relm: &relm::Relm, _: ()) -> Model { - let columns = vec![::gtk::Type::String, gtk::Type::String]; + let columns = vec![glib::types::Type::String, glib::types::Type::String]; Model { store: gtk::ListStore::new(&columns), diff --git a/src/widgets/priority.rs b/src/widgets/priority.rs index 1c0b5c9..b631db7 100644 --- a/src/widgets/priority.rs +++ b/src/widgets/priority.rs @@ -43,7 +43,7 @@ impl Priority { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Priority { fn init_view(&mut self) { self.button diff --git a/src/widgets/repeat.rs b/src/widgets/repeat.rs index 4e0bd3d..2ab2c01 100644 --- a/src/widgets/repeat.rs +++ b/src/widgets/repeat.rs @@ -69,7 +69,7 @@ impl Repeat { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Repeat { fn init_view(&mut self) { self.num.set_adjustment(>k::Adjustment::new( diff --git a/src/widgets/tags.rs b/src/widgets/tags.rs index cf1e89c..2efbc63 100644 --- a/src/widgets/tags.rs +++ b/src/widgets/tags.rs @@ -97,7 +97,7 @@ impl Tags { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Tags { fn model(tag: Type) -> Type { tag diff --git a/src/widgets/task.rs b/src/widgets/task.rs index d3f6a2b..a2a4919 100644 --- a/src/widgets/task.rs +++ b/src/widgets/task.rs @@ -18,7 +18,7 @@ pub struct Model { } #[allow(clippy::cognitive_complexity)] -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Task { fn init_view(&mut self) { use gtk::StyleContextExt; diff --git a/src/widgets/tasks.rs b/src/widgets/tasks.rs index 06552e8..5ba8e47 100644 --- a/src/widgets/tasks.rs +++ b/src/widgets/tasks.rs @@ -55,7 +55,7 @@ impl Tasks { } } -#[relm_attributes::widget] +#[relm_derive::widget] impl relm::Widget for Tasks { fn model(relm: &relm::Relm, _: ()) -> Model { Model {