Skip to content

Commit

Permalink
gtk: Remove type param in AccessibleRange subclassing code
Browse files Browse the repository at this point in the history
I don't know how this stayed here for this long...
  • Loading branch information
bilelmoussaoui committed May 17, 2024
1 parent a8370ba commit 30ba2b3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions gtk4/src/subclass/accessible_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use glib::translate::*;
use crate::{prelude::*, subclass::prelude::*, AccessibleRange};

pub trait AccessibleRangeImpl: WidgetImpl {
fn set_current_value(&self, accessible_range: &Self::Type, value: f64) -> bool {
self.parent_set_current_value(accessible_range, value)
fn set_current_value(&self, value: f64) -> bool {
self.parent_set_current_value(value)
}
}

Expand All @@ -21,7 +21,7 @@ mod sealed {

pub trait AccessibleRangeImplExt: sealed::Sealed + ObjectSubclass {
// Returns true if the operation was performed, false otherwise
fn parent_set_current_value(&self, accessible_range: &Self::Type, value: f64) -> bool {
fn parent_set_current_value(&self, value: f64) -> bool {
unsafe {
let type_data = Self::type_data();
let parent_iface = type_data.as_ref().parent_interface::<AccessibleRange>()
Expand All @@ -32,7 +32,7 @@ pub trait AccessibleRangeImplExt: sealed::Sealed + ObjectSubclass {
.expect("no parent \"set_current_value\" implementation");

from_glib(func(
accessible_range
self.obj()
.unsafe_cast_ref::<AccessibleRange>()
.to_glib_none()
.0,
Expand All @@ -59,9 +59,5 @@ unsafe extern "C" fn accessible_range_set_current_value<T: AccessibleRangeImpl>(
let instance = &*(accessible_range as *mut T::Instance);
let imp = instance.imp();

imp.set_current_value(
from_glib_borrow::<_, AccessibleRange>(accessible_range).unsafe_cast_ref(),
value,
)
.into_glib()
imp.set_current_value(value).into_glib()
}

0 comments on commit 30ba2b3

Please sign in to comment.