Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for subclassing gio::Application #209

Merged
merged 1 commit into from May 11, 2019

Conversation

Projects
None yet
3 participants
@sdroege
Copy link
Member

commented May 11, 2019

Based on code by Dirk Van Haerenborgh @vhdirk from https://github.com/gtk-rs/gobject-subclass

// Copyright 2019, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use gio_sys;

This comment has been minimized.

Copy link
@GuillaumeGomez

GuillaumeGomez May 11, 2019

Member

You have the right to add an empty line before this one. :)

This comment has been minimized.

Copy link
@sdroege

sdroege May 11, 2019

Author Member

done

@sdroege sdroege force-pushed the sdroege:subclass-application branch from 5c555a9 to fdb7498 May 11, 2019

use std::ops::Deref;
use std::ptr;

pub struct ArgumentList {

This comment has been minimized.

Copy link
@EPashkin

EPashkin May 11, 2019

Member

Why not move ArgumentList to separate file?

This comment has been minimized.

Copy link
@sdroege

sdroege May 11, 2019

Author Member

Because it will only ever be used inside this file


impl convert::Into<Vec<OsString>> for ArgumentList {
fn into(self) -> Vec<OsString> {
self.items.clone()

This comment has been minimized.

Copy link
@EPashkin

EPashkin May 11, 2019

Member

Clone really needed? Why not replace it with empty vector?

This comment has been minimized.

Copy link
@sdroege

sdroege May 11, 2019

Author Member

Indeed it should be possible to just move it out

This comment has been minimized.

Copy link
@sdroege

sdroege May 11, 2019

Author Member

Fixed. Thanks :)

@EPashkin

This comment has been minimized.

Copy link
Member

commented May 11, 2019

@sdroege Thanks

@sdroege sdroege force-pushed the sdroege:subclass-application branch from fdb7498 to cf668f5 May 11, 2019

@EPashkin

This comment has been minimized.

Copy link
Member

commented May 11, 2019

@sdroege 👍

@sdroege sdroege merged commit 745ba9d into gtk-rs:master May 11, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

alatiera added a commit to alatiera/gtk that referenced this pull request May 12, 2019

Allow for GtkApplication to be subclasses
This expands further upon the gio MR that does the same
for GApplictiona.

gtk-rs/gio#209

alatiera added a commit to alatiera/gtk that referenced this pull request May 12, 2019

Allow for GtkApplication to be subclasses
This expands further upon the gio MR that does the same
for GApplictiona.

gtk-rs/gio#209

alatiera added a commit to alatiera/gtk that referenced this pull request May 12, 2019

Allow for GtkApplication to be subclassed
This expands further upon the gio MR that does the same
for GAppliction.

gtk-rs/gio#209

alatiera added a commit to alatiera/gtk that referenced this pull request May 12, 2019

Allow for GtkApplication to be subclassed
This expands further upon the gio MR that does the same
for GAppliction.

gtk-rs/gio#209

sfanxiang added a commit to sfanxiang/gtk-rs-gtk4 that referenced this pull request Jun 21, 2019

Allow for GtkApplication to be subclassed
This expands further upon the gio MR that does the same
for GAppliction.

gtk-rs/gio#209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.