Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #776 from sdroege/object-new-panic
Browse files Browse the repository at this point in the history
Update for glib::Object::new() API changes
  • Loading branch information
sdroege authored Oct 7, 2022
2 parents 84d21a3 + 3ddda89 commit 6bba580
Show file tree
Hide file tree
Showing 159 changed files with 47 additions and 215 deletions.
2 changes: 1 addition & 1 deletion atk/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
2 changes: 1 addition & 1 deletion atk/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
1 change: 0 additions & 1 deletion examples/basic_subclass/simple_application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ impl SimpleApplication {
("application-id", &"org.gtk-rs.SimpleApplication"),
("flags", &ApplicationFlags::empty()),
])
.expect("Failed to create SimpleApp")
}
}
2 changes: 1 addition & 1 deletion examples/basic_subclass/simple_window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ glib::wrapper! {

impl SimpleWindow {
pub fn new(app: &SimpleApplication) -> Self {
glib::Object::new(&[("application", app)]).expect("Failed to create SimpleWindow")
glib::Object::new(&[("application", app)])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ glib::wrapper! {
impl ExampleApplicationWindow {
pub fn new<P: glib::IsA<gtk::Application>>(app: &P) -> Self {
glib::Object::new(&[("application", app)])
.expect("Failed to create ExampleApplicationWindow")
}

fn init_label(&self) {
Expand Down
2 changes: 1 addition & 1 deletion examples/list_box_model/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ glib::wrapper! {
impl Model {
#[allow(clippy::new_without_default)]
pub fn new() -> Model {
glib::Object::new(&[]).expect("Failed to create Model")
glib::Object::new(&[])
}

pub fn append(&self, obj: &RowData) {
Expand Down
2 changes: 1 addition & 1 deletion examples/list_box_model/row_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ glib::wrapper! {
// initial values for our two properties and then returns the new instance
impl RowData {
pub fn new(name: &str, count: u32) -> RowData {
glib::Object::new(&[("name", &name), ("count", &count)]).expect("Failed to create row data")
glib::Object::new(&[("name", &name), ("count", &count)])
}
}
2 changes: 1 addition & 1 deletion gdk/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
2 changes: 1 addition & 1 deletion gdk/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
2 changes: 1 addition & 1 deletion gdkx11/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
1 change: 0 additions & 1 deletion gdkx11/src/auto/x11_device_manager_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ impl X11DeviceManagerXI2Builder {
properties.push(("display", display));
}
glib::Object::new::<X11DeviceManagerXI2>(&properties)
.expect("Failed to create an instance of X11DeviceManagerXI2")
}

pub fn major(mut self, major: i32) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gdkx11/src/auto/x11_device_xi2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ impl X11DeviceXI2Builder {
properties.push(("vendor-id", vendor_id));
}
glib::Object::new::<X11DeviceXI2>(&properties)
.expect("Failed to create an instance of X11DeviceXI2")
}

pub fn device_id(mut self, device_id: i32) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion gdkx11/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 54e116a11822)
Generated by gir (https://github.com/gtk-rs/gir @ b5068ede6c51)
from gir-files (https://github.com/gtk-rs/gir-files @ 7ebd4478b4a5)
1 change: 0 additions & 1 deletion gtk/src/auto/about_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ impl AboutDialogBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<AboutDialog>(&properties)
.expect("Failed to create an instance of AboutDialog")
}

pub fn artists(mut self, artists: Vec<String>) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/accel_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl AccelLabel {
impl Default for AccelLabel {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct AccelLabel object with default parameters")
}
}

Expand Down Expand Up @@ -291,7 +290,6 @@ impl AccelLabelBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<AccelLabel>(&properties)
.expect("Failed to create an instance of AccelLabel")
}

pub fn accel_closure(mut self, accel_closure: &glib::Closure) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/action_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ impl ActionBarBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<ActionBar>(&properties)
.expect("Failed to create an instance of ActionBar")
}

pub fn border_width(mut self, border_width: u32) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/adjustment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ impl Adjustment {
impl Default for Adjustment {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct Adjustment object with default parameters")
}
}

Expand Down Expand Up @@ -109,7 +108,6 @@ impl AdjustmentBuilder {
properties.push(("value", value));
}
glib::Object::new::<Adjustment>(&properties)
.expect("Failed to create an instance of Adjustment")
}

pub fn lower(mut self, lower: f64) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/app_chooser_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ impl AppChooserButton {
impl Default for AppChooserButton {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct AppChooserButton object with default parameters")
}
}

Expand Down Expand Up @@ -299,7 +298,6 @@ impl AppChooserButtonBuilder {
properties.push(("content-type", content_type));
}
glib::Object::new::<AppChooserButton>(&properties)
.expect("Failed to create an instance of AppChooserButton")
}

pub fn heading(mut self, heading: &str) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/app_chooser_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ impl AppChooserDialog {
impl Default for AppChooserDialog {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct AppChooserDialog object with default parameters")
}
}

Expand Down Expand Up @@ -379,7 +378,6 @@ impl AppChooserDialogBuilder {
properties.push(("content-type", content_type));
}
glib::Object::new::<AppChooserDialog>(&properties)
.expect("Failed to create an instance of AppChooserDialog")
}

pub fn gfile(mut self, gfile: &impl IsA<gio::File>) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/app_chooser_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ impl AppChooserWidget {
impl Default for AppChooserWidget {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct AppChooserWidget object with default parameters")
}
}

Expand Down Expand Up @@ -269,7 +268,6 @@ impl AppChooserWidgetBuilder {
properties.push(("content-type", content_type));
}
glib::Object::new::<AppChooserWidget>(&properties)
.expect("Failed to create an instance of AppChooserWidget")
}

pub fn default_text(mut self, default_text: &str) -> Self {
Expand Down
3 changes: 1 addition & 2 deletions gtk/src/auto/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ impl ApplicationBuilder {
if let Some(ref resource_base_path) = self.resource_base_path {
properties.push(("resource-base-path", resource_base_path));
}
let ret = glib::Object::new::<Application>(&properties)
.expect("Failed to create an instance of Application");
let ret = glib::Object::new::<Application>(&properties);
{
Application::register_startup_hook(&ret);
}
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/application_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ impl ApplicationWindowBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<ApplicationWindow>(&properties)
.expect("Failed to create an instance of ApplicationWindow")
}

pub fn show_menubar(mut self, show_menubar: bool) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/aspect_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ impl AspectFrame {
impl Default for AspectFrame {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct AspectFrame object with default parameters")
}
}

Expand Down Expand Up @@ -268,7 +267,6 @@ impl AspectFrameBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<AspectFrame>(&properties)
.expect("Failed to create an instance of AspectFrame")
}

pub fn obey_child(mut self, obey_child: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ impl AssistantBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<Assistant>(&properties)
.expect("Failed to create an instance of Assistant")
}

pub fn use_header_bar(mut self, use_header_bar: i32) -> Self {
Expand Down
3 changes: 1 addition & 2 deletions gtk/src/auto/box_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ impl Box {
impl Default for Box {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct Box object with default parameters")
}
}

Expand Down Expand Up @@ -236,7 +235,7 @@ impl BoxBuilder {
if let Some(ref orientation) = self.orientation {
properties.push(("orientation", orientation));
}
glib::Object::new::<Box>(&properties).expect("Failed to create an instance of Box")
glib::Object::new::<Box>(&properties)
}

pub fn baseline_position(mut self, baseline_position: BaselinePosition) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion gtk/src/auto/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl ButtonBuilder {
if let Some(ref action_target) = self.action_target {
properties.push(("action-target", action_target));
}
glib::Object::new::<Button>(&properties).expect("Failed to create an instance of Button")
glib::Object::new::<Button>(&properties)
}

pub fn always_show_image(mut self, always_show_image: bool) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/button_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ impl ButtonBox {
impl Default for ButtonBox {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct ButtonBox object with default parameters")
}
}

Expand Down Expand Up @@ -241,7 +240,6 @@ impl ButtonBoxBuilder {
properties.push(("orientation", orientation));
}
glib::Object::new::<ButtonBox>(&properties)
.expect("Failed to create an instance of ButtonBox")
}

pub fn layout_style(mut self, layout_style: ButtonBoxStyle) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ impl CalendarBuilder {
properties.push(("width-request", width_request));
}
glib::Object::new::<Calendar>(&properties)
.expect("Failed to create an instance of Calendar")
}

pub fn day(mut self, day: i32) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_area_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ impl CellAreaBoxBuilder {
properties.push(("orientation", orientation));
}
glib::Object::new::<CellAreaBox>(&properties)
.expect("Failed to create an instance of CellAreaBox")
}

pub fn spacing(mut self, spacing: i32) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_accel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ impl CellRendererAccelBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererAccel>(&properties)
.expect("Failed to create an instance of CellRendererAccel")
}

pub fn accel_key(mut self, accel_key: u32) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_combo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ impl CellRendererComboBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererCombo>(&properties)
.expect("Failed to create an instance of CellRendererCombo")
}

pub fn has_entry(mut self, has_entry: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_pixbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ impl CellRendererPixbufBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererPixbuf>(&properties)
.expect("Failed to create an instance of CellRendererPixbuf")
}

pub fn gicon(mut self, gicon: &impl IsA<gio::Icon>) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ impl CellRendererProgressBuilder {
properties.push(("orientation", orientation));
}
glib::Object::new::<CellRendererProgress>(&properties)
.expect("Failed to create an instance of CellRendererProgress")
}

pub fn inverted(mut self, inverted: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_spin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ impl CellRendererSpinBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererSpin>(&properties)
.expect("Failed to create an instance of CellRendererSpin")
}

pub fn adjustment(mut self, adjustment: &impl IsA<Adjustment>) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_spinner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ impl CellRendererSpinnerBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererSpinner>(&properties)
.expect("Failed to create an instance of CellRendererSpinner")
}

pub fn active(mut self, active: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ impl CellRendererTextBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererText>(&properties)
.expect("Failed to create an instance of CellRendererText")
}

pub fn align_set(mut self, align_set: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_renderer_toggle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ impl CellRendererToggleBuilder {
properties.push(("ypad", ypad));
}
glib::Object::new::<CellRendererToggle>(&properties)
.expect("Failed to create an instance of CellRendererToggle")
}

pub fn activatable(mut self, activatable: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/cell_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ impl CellViewBuilder {
properties.push(("orientation", orientation));
}
glib::Object::new::<CellView>(&properties)
.expect("Failed to create an instance of CellView")
}

pub fn background(mut self, background: &str) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/check_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ impl CheckButtonBuilder {
properties.push(("action-target", action_target));
}
glib::Object::new::<CheckButton>(&properties)
.expect("Failed to create an instance of CheckButton")
}

pub fn active(mut self, active: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/check_menu_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ impl CheckMenuItemBuilder {
properties.push(("action-target", action_target));
}
glib::Object::new::<CheckMenuItem>(&properties)
.expect("Failed to create an instance of CheckMenuItem")
}

pub fn active(mut self, active: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/color_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ impl ColorButtonBuilder {
properties.push(("action-target", action_target));
}
glib::Object::new::<ColorButton>(&properties)
.expect("Failed to create an instance of ColorButton")
}

pub fn alpha(mut self, alpha: u32) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions gtk/src/auto/color_chooser_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ impl ColorChooserDialog {
impl Default for ColorChooserDialog {
fn default() -> Self {
glib::object::Object::new::<Self>(&[])
.expect("Can't construct ColorChooserDialog object with default parameters")
}
}

Expand Down Expand Up @@ -355,7 +354,6 @@ impl ColorChooserDialogBuilder {
properties.push(("use-alpha", use_alpha));
}
glib::Object::new::<ColorChooserDialog>(&properties)
.expect("Failed to create an instance of ColorChooserDialog")
}

pub fn show_editor(mut self, show_editor: bool) -> Self {
Expand Down
1 change: 0 additions & 1 deletion gtk/src/auto/color_chooser_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ impl ColorChooserWidgetBuilder {
properties.push(("use-alpha", use_alpha));
}
glib::Object::new::<ColorChooserWidget>(&properties)
.expect("Failed to create an instance of ColorChooserWidget")
}

pub fn show_editor(mut self, show_editor: bool) -> Self {
Expand Down
Loading

0 comments on commit 6bba580

Please sign in to comment.