Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Implement open signal and open function #34

Merged
merged 2 commits into from
Jun 7, 2017
Merged

Implement open signal and open function #34

merged 2 commits into from
Jun 7, 2017

Conversation

daa84
Copy link

@daa84 daa84 commented Jun 7, 2017

Implement open signal and open function for #31


pub trait ApplicationExtManual {
fn connect_open<F: Fn(&Self, &[File], &str) + 'static>(&self, f: F) -> u64;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remote this empty line.

}

impl<O: IsA<Application> + IsA<glib::object::Object>> ApplicationExtManual for O {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remote this empty line.

transmute(open_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remote this empty line.

@EPashkin
Copy link
Member

EPashkin commented Jun 7, 2017

Thanks, @daa84
If both functions works, 👍

@daa84
Copy link
Author

daa84 commented Jun 7, 2017

Patch updated,
i checked "open" signal in my application and for me it works 😄

@EPashkin
Copy link
Member

EPashkin commented Jun 7, 2017

My most worry is open functions. Maybe it need [&File] instead

@daa84
Copy link
Author

daa84 commented Jun 7, 2017

hm, yes, your right, this looks like error, i'll check

@EPashkin
Copy link
Member

EPashkin commented Jun 7, 2017

Not necessarily an error. Just preparing an array of references IMHO can be easier.
However, the automatic to_glib_none() may work wrongly for this case.

@daa84
Copy link
Author

daa84 commented Jun 7, 2017

Ok, i check open method in application and it works without problem, also i check code for to_glib_none() in case of array it creates new temp array with call to_glib_none for every member so it looks like it must work 😄
I think use [File] instead of [&File] is better because this method mirrors of "open" signal. It will be strange in case they are different.

@EPashkin
Copy link
Member

EPashkin commented Jun 7, 2017

👍
Thanks, @daa84.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants