Skip to content

Commit

Permalink
book: update use of ListStore::new
Browse files Browse the repository at this point in the history
  • Loading branch information
jf2048 committed Mar 7, 2023
1 parent 0dcefa7 commit c42f81e
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion book/listings/list_widgets/2/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn build_ui(app: &Application) {
(0..=100_000).into_iter().map(IntegerObject::new).collect();

// Create new model
let model = gio::ListStore::new(IntegerObject::static_type());
let model = gio::ListStore::new::<IntegerObject>();

// Add the vector to the model
model.extend_from_slice(&vector);
Expand Down
2 changes: 1 addition & 1 deletion book/listings/list_widgets/3/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn build_ui(app: &Application) {
(0..=100_000).into_iter().map(IntegerObject::new).collect();

// Create new model
let model = gio::ListStore::new(IntegerObject::static_type());
let model = gio::ListStore::new::<IntegerObject>();

// Add the vector to the model
model.extend_from_slice(&vector);
Expand Down
2 changes: 1 addition & 1 deletion book/listings/list_widgets/4/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn build_ui(app: &Application) {
(0..=100_000).into_iter().map(IntegerObject::new).collect();

// Create new model
let model = gio::ListStore::new(IntegerObject::static_type());
let model = gio::ListStore::new::<IntegerObject>();

// Add the vector to the model
model.extend_from_slice(&vector);
Expand Down
2 changes: 1 addition & 1 deletion book/listings/list_widgets/5/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn build_ui(app: &Application) {
(0..=100_000).into_iter().map(IntegerObject::new).collect();

// Create new model
let model = gio::ListStore::new(IntegerObject::static_type());
let model = gio::ListStore::new::<IntegerObject>();

// Add the vector to the model
model.extend_from_slice(&vector);
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/1/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/2/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Window {
// ANCHOR: setup_tasks
fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/3/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/4/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/5/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/6/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/7/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Window {

fn setup_tasks(&self) {
// Create new model
let model = gio::ListStore::new(TaskObject::static_type());
let model = gio::ListStore::new::<TaskObject>();

// Get state and set model
self.imp().tasks.replace(Some(model));
Expand Down
2 changes: 1 addition & 1 deletion book/listings/todo/8/collection_object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl CollectionObject {
.map(TaskObject::from_task_data)
.collect();

let tasks = gio::ListStore::new(TaskObject::static_type());
let tasks = gio::ListStore::new::<TaskObject>();
tasks.extend_from_slice(&tasks_to_extend);

Self::new(&title, tasks)
Expand Down
4 changes: 2 additions & 2 deletions book/listings/todo/8/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Window {

// ANCHOR: setup_collections
fn setup_collections(&self) {
let collections = gio::ListStore::new(CollectionObject::static_type());
let collections = gio::ListStore::new::<CollectionObject>();
self.imp()
.collections
.set(collections.clone())
Expand Down Expand Up @@ -457,7 +457,7 @@ impl Window {
}

// Create a new list store
let tasks = gio::ListStore::new(TaskObject::static_type());
let tasks = gio::ListStore::new::<TaskObject>();

// Create a new collection object from the title the user provided
let title = entry.text().to_string();
Expand Down

0 comments on commit c42f81e

Please sign in to comment.