{"action":"created","comment":{"url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/comments/187274917","pull_request_review_id":119019692,"id":187274917,"diff_hunk":"@@ -46,80 +43,75 @@ impl<S: ApplicationImpl<T>, T: ObjectType + glib::IsA<gio::Application>> Applica\n \n any_impl!(ApplicationBase, ApplicationImpl);\n \n-pub unsafe trait ApplicationBase: IsA<gio::Application> + ObjectType\n-{\n+pub unsafe trait ApplicationBase: IsA<gio::Application> + ObjectType {\n     fn parent_startup(&self) {\n         unsafe {\n             let klass = self.get_class();\n             let parent_klass = (*klass).get_parent_class() as *const gio_ffi::GApplicationClass;\n-            (*parent_klass).startup\n-                           .map(|f| {\n-                                f(self.to_glib_none().0)\n-                            })\n-                            .unwrap_or(())\n+            (*parent_klass)\n+                .startup\n+                .map(|f| f(self.to_glib_none().0))\n+                .unwrap_or(())\n         }\n     }\n \n     fn parent_activate(&self) {\n         unsafe {\n             let klass = self.get_class();\n             let parent_klass = (*klass).get_parent_class() as *const gio_ffi::GApplicationClass;\n-            (*parent_klass).activate\n-                           .map(|f| {\n-                                f(self.to_glib_none().0)\n-                            })\n-                            .unwrap_or(())\n+            (*parent_klass)\n+                .activate\n+                .map(|f| f(self.to_glib_none().0))\n+                .unwrap_or(())\n         }\n     }\n \n     fn parent_open(&self, files: &Vec<gio::File>, hint: &String) {\n         unsafe {\n             let klass = self.get_class();\n             let parent_klass = (*klass).get_parent_class() as *const gio_ffi::GApplicationClass;\n-            (*parent_klass).open\n-                           .map(|f| {\n-                               let n_files = files.len() as i32;\n-                                f(self.to_glib_none().0,\n-                                  files.to_glib_none().0,\n-                                  n_files,\n-                                  hint.to_glib_none().0)\n-                            })\n-                            .unwrap_or(())\n+            (*parent_klass)\n+                .open\n+                .map(|f| {\n+                    let n_files = files.len() as i32;\n+                    f(\n+                        self.to_glib_none().0,\n+                        files.to_glib_none().0,\n+                        n_files,\n+                        hint.to_glib_none().0,\n+                    )\n+                })\n+                .unwrap_or(())\n         }\n     }\n \n-    fn parent_command_line(&self, cmd_line: &gio::ApplicationCommandLine) -> i32{\n+    fn parent_command_line(&self, cmd_line: &gio::ApplicationCommandLine) -> i32 {\n         unsafe {\n             let klass = self.get_class();\n             let parent_klass = (*klass).get_parent_class() as *const gio_ffi::GApplicationClass;\n-            (*parent_klass).command_line\n-                           .map(|f| {\n-                               f(self.to_glib_none().0,\n-                                cmd_line.to_glib_none().0)\n-                            })\n-                            .unwrap_or(0)\n+            (*parent_klass)\n+                .command_line\n+                .map(|f| f(self.to_glib_none().0, cmd_line.to_glib_none().0))\n+                .unwrap_or(0)\n         }\n     }\n \n-    fn parent_local_command_line(&self, arguments: &Vec<String>) -> Result<i32, ()>{\n+    fn parent_local_command_line(&self, arguments: &Vec<String>) -> Option<i32> {\n         unsafe {\n             let klass = self.get_class();\n             let parent_klass = (*klass).get_parent_class() as *const gio_ffi::GApplicationClass;\n             let mut exit_status = 0;\n-            let success = (*parent_klass).local_command_line\n-                           .map(|f| {\n-                               f(self.to_glib_none().0,\n-                                 arguments.to_glib_none().0, //TODO: conversion\n-                                 &mut exit_status)\n-                            })\n-                            .unwrap_or(0);\n-            if success > 0{\n-                return Ok(exit_status);\n-            }\n-            Err(())\n+            (*parent_klass)\n+                .local_command_line\n+                .map(|f| {\n+                    f(\n+                        self.to_glib_none().0,\n+                        arguments.to_glib_none().0, //TODO: conversion","path":"gio-subclass/src/application.rs","position":null,"original_position":158,"commit_id":"06e2feec2c2526c46e9a276da04e3e23e5715233","original_commit_id":"569074f2ad48c6033d7f0eaf91448cab9f3f6ddb","user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars3.githubusercontent.com/u/301846?v=4","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"body":"Oh that's because it's not just a `char **` but a `char ***`. It allows changing the array. You need to dereference it at least, and make sure to update the pointer after calling parent class/subclass implementations of this function","created_at":"2018-05-10T08:52:10Z","updated_at":"2018-05-10T08:52:10Z","html_url":"https://github.com/sdroege/gtk-subclass/pull/5#discussion_r187274917","pull_request_url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/comments/187274917"},"html":{"href":"https://github.com/sdroege/gtk-subclass/pull/5#discussion_r187274917"},"pull_request":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5"}},"in_reply_to_id":187255985},"pull_request":{"url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5","id":186485449,"html_url":"https://github.com/sdroege/gtk-subclass/pull/5","diff_url":"https://github.com/sdroege/gtk-subclass/pull/5.diff","patch_url":"https://github.com/sdroege/gtk-subclass/pull/5.patch","issue_url":"https://api.github.com/repos/sdroege/gtk-subclass/issues/5","number":5,"state":"open","locked":false,"title":"WIP: Add base class for gtk::Application","user":{"login":"vhdirk","id":1424486,"avatar_url":"https://avatars3.githubusercontent.com/u/1424486?v=4","gravatar_id":"","url":"https://api.github.com/users/vhdirk","html_url":"https://github.com/vhdirk","followers_url":"https://api.github.com/users/vhdirk/followers","following_url":"https://api.github.com/users/vhdirk/following{/other_user}","gists_url":"https://api.github.com/users/vhdirk/gists{/gist_id}","starred_url":"https://api.github.com/users/vhdirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhdirk/subscriptions","organizations_url":"https://api.github.com/users/vhdirk/orgs","repos_url":"https://api.github.com/users/vhdirk/repos","events_url":"https://api.github.com/users/vhdirk/events{/privacy}","received_events_url":"https://api.github.com/users/vhdirk/received_events","type":"User","site_admin":false},"body":"These are my current efforts at making gtk::Application subclass-able. Currently, it does not implement any of the virtual functions of gtk::Application. Nor does it build. gtk::ApplicationWindow::new really expects a gtk::Application instance, not a derived type.\r\nI would subclass gtk::ApplicationWindow, but I feel the 'regular' API should work as well.\r\n\r\nI'd really like to reduce the amount of boilerplate, especially with regard to ```::new```. At least Deref and glib_wrapper could be combined in a new macro. A default implementation for ```ImplTypeStatic``` would also be nice, since often the only change would be the name?","created_at":"2018-05-07T22:51:29Z","updated_at":"2018-05-10T08:52:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4508569ee60c90cb9bf1fb64ea190d9e06a09bd6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5/commits","review_comments_url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5/comments","review_comment_url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sdroege/gtk-subclass/issues/5/comments","statuses_url":"https://api.github.com/repos/sdroege/gtk-subclass/statuses/06e2feec2c2526c46e9a276da04e3e23e5715233","head":{"label":"vhdirk:application","ref":"application","sha":"06e2feec2c2526c46e9a276da04e3e23e5715233","user":{"login":"vhdirk","id":1424486,"avatar_url":"https://avatars3.githubusercontent.com/u/1424486?v=4","gravatar_id":"","url":"https://api.github.com/users/vhdirk","html_url":"https://github.com/vhdirk","followers_url":"https://api.github.com/users/vhdirk/followers","following_url":"https://api.github.com/users/vhdirk/following{/other_user}","gists_url":"https://api.github.com/users/vhdirk/gists{/gist_id}","starred_url":"https://api.github.com/users/vhdirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhdirk/subscriptions","organizations_url":"https://api.github.com/users/vhdirk/orgs","repos_url":"https://api.github.com/users/vhdirk/repos","events_url":"https://api.github.com/users/vhdirk/events{/privacy}","received_events_url":"https://api.github.com/users/vhdirk/received_events","type":"User","site_admin":false},"repo":{"id":132369451,"name":"gtk-subclass","full_name":"vhdirk/gtk-subclass","owner":{"login":"vhdirk","id":1424486,"avatar_url":"https://avatars3.githubusercontent.com/u/1424486?v=4","gravatar_id":"","url":"https://api.github.com/users/vhdirk","html_url":"https://github.com/vhdirk","followers_url":"https://api.github.com/users/vhdirk/followers","following_url":"https://api.github.com/users/vhdirk/following{/other_user}","gists_url":"https://api.github.com/users/vhdirk/gists{/gist_id}","starred_url":"https://api.github.com/users/vhdirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhdirk/subscriptions","organizations_url":"https://api.github.com/users/vhdirk/orgs","repos_url":"https://api.github.com/users/vhdirk/repos","events_url":"https://api.github.com/users/vhdirk/events{/privacy}","received_events_url":"https://api.github.com/users/vhdirk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vhdirk/gtk-subclass","description":"Rust GTK subclassing crate","fork":true,"url":"https://api.github.com/repos/vhdirk/gtk-subclass","forks_url":"https://api.github.com/repos/vhdirk/gtk-subclass/forks","keys_url":"https://api.github.com/repos/vhdirk/gtk-subclass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vhdirk/gtk-subclass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vhdirk/gtk-subclass/teams","hooks_url":"https://api.github.com/repos/vhdirk/gtk-subclass/hooks","issue_events_url":"https://api.github.com/repos/vhdirk/gtk-subclass/issues/events{/number}","events_url":"https://api.github.com/repos/vhdirk/gtk-subclass/events","assignees_url":"https://api.github.com/repos/vhdirk/gtk-subclass/assignees{/user}","branches_url":"https://api.github.com/repos/vhdirk/gtk-subclass/branches{/branch}","tags_url":"https://api.github.com/repos/vhdirk/gtk-subclass/tags","blobs_url":"https://api.github.com/repos/vhdirk/gtk-subclass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vhdirk/gtk-subclass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vhdirk/gtk-subclass/git/refs{/sha}","trees_url":"https://api.github.com/repos/vhdirk/gtk-subclass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vhdirk/gtk-subclass/statuses/{sha}","languages_url":"https://api.github.com/repos/vhdirk/gtk-subclass/languages","stargazers_url":"https://api.github.com/repos/vhdirk/gtk-subclass/stargazers","contributors_url":"https://api.github.com/repos/vhdirk/gtk-subclass/contributors","subscribers_url":"https://api.github.com/repos/vhdirk/gtk-subclass/subscribers","subscription_url":"https://api.github.com/repos/vhdirk/gtk-subclass/subscription","commits_url":"https://api.github.com/repos/vhdirk/gtk-subclass/commits{/sha}","git_commits_url":"https://api.github.com/repos/vhdirk/gtk-subclass/git/commits{/sha}","comments_url":"https://api.github.com/repos/vhdirk/gtk-subclass/comments{/number}","issue_comment_url":"https://api.github.com/repos/vhdirk/gtk-subclass/issues/comments{/number}","contents_url":"https://api.github.com/repos/vhdirk/gtk-subclass/contents/{+path}","compare_url":"https://api.github.com/repos/vhdirk/gtk-subclass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vhdirk/gtk-subclass/merges","archive_url":"https://api.github.com/repos/vhdirk/gtk-subclass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vhdirk/gtk-subclass/downloads","issues_url":"https://api.github.com/repos/vhdirk/gtk-subclass/issues{/number}","pulls_url":"https://api.github.com/repos/vhdirk/gtk-subclass/pulls{/number}","milestones_url":"https://api.github.com/repos/vhdirk/gtk-subclass/milestones{/number}","notifications_url":"https://api.github.com/repos/vhdirk/gtk-subclass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vhdirk/gtk-subclass/labels{/name}","releases_url":"https://api.github.com/repos/vhdirk/gtk-subclass/releases{/id}","deployments_url":"https://api.github.com/repos/vhdirk/gtk-subclass/deployments","created_at":"2018-05-06T19:28:39Z","updated_at":"2018-05-08T07:23:44Z","pushed_at":"2018-05-10T06:50:28Z","git_url":"git://github.com/vhdirk/gtk-subclass.git","ssh_url":"git@github.com:vhdirk/gtk-subclass.git","clone_url":"https://github.com/vhdirk/gtk-subclass.git","svn_url":"https://github.com/vhdirk/gtk-subclass","homepage":null,"size":32,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sdroege:master","ref":"master","sha":"90819b71f9184f3dd377d2973118d00bc03250cb","user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars3.githubusercontent.com/u/301846?v=4","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"repo":{"id":131719699,"name":"gtk-subclass","full_name":"sdroege/gtk-subclass","owner":{"login":"sdroege","id":301846,"avatar_url":"https://avatars3.githubusercontent.com/u/301846?v=4","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdroege/gtk-subclass","description":"Rust GTK subclassing crate","fork":false,"url":"https://api.github.com/repos/sdroege/gtk-subclass","forks_url":"https://api.github.com/repos/sdroege/gtk-subclass/forks","keys_url":"https://api.github.com/repos/sdroege/gtk-subclass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdroege/gtk-subclass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdroege/gtk-subclass/teams","hooks_url":"https://api.github.com/repos/sdroege/gtk-subclass/hooks","issue_events_url":"https://api.github.com/repos/sdroege/gtk-subclass/issues/events{/number}","events_url":"https://api.github.com/repos/sdroege/gtk-subclass/events","assignees_url":"https://api.github.com/repos/sdroege/gtk-subclass/assignees{/user}","branches_url":"https://api.github.com/repos/sdroege/gtk-subclass/branches{/branch}","tags_url":"https://api.github.com/repos/sdroege/gtk-subclass/tags","blobs_url":"https://api.github.com/repos/sdroege/gtk-subclass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdroege/gtk-subclass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdroege/gtk-subclass/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdroege/gtk-subclass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdroege/gtk-subclass/statuses/{sha}","languages_url":"https://api.github.com/repos/sdroege/gtk-subclass/languages","stargazers_url":"https://api.github.com/repos/sdroege/gtk-subclass/stargazers","contributors_url":"https://api.github.com/repos/sdroege/gtk-subclass/contributors","subscribers_url":"https://api.github.com/repos/sdroege/gtk-subclass/subscribers","subscription_url":"https://api.github.com/repos/sdroege/gtk-subclass/subscription","commits_url":"https://api.github.com/repos/sdroege/gtk-subclass/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdroege/gtk-subclass/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdroege/gtk-subclass/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdroege/gtk-subclass/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdroege/gtk-subclass/contents/{+path}","compare_url":"https://api.github.com/repos/sdroege/gtk-subclass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdroege/gtk-subclass/merges","archive_url":"https://api.github.com/repos/sdroege/gtk-subclass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdroege/gtk-subclass/downloads","issues_url":"https://api.github.com/repos/sdroege/gtk-subclass/issues{/number}","pulls_url":"https://api.github.com/repos/sdroege/gtk-subclass/pulls{/number}","milestones_url":"https://api.github.com/repos/sdroege/gtk-subclass/milestones{/number}","notifications_url":"https://api.github.com/repos/sdroege/gtk-subclass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdroege/gtk-subclass/labels{/name}","releases_url":"https://api.github.com/repos/sdroege/gtk-subclass/releases{/id}","deployments_url":"https://api.github.com/repos/sdroege/gtk-subclass/deployments","created_at":"2018-05-01T14:01:53Z","updated_at":"2018-05-07T21:50:13Z","pushed_at":"2018-05-10T06:50:29Z","git_url":"git://github.com/sdroege/gtk-subclass.git","ssh_url":"git@github.com:sdroege/gtk-subclass.git","clone_url":"https://github.com/sdroege/gtk-subclass.git","svn_url":"https://github.com/sdroege/gtk-subclass","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5"},"html":{"href":"https://github.com/sdroege/gtk-subclass/pull/5"},"issue":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/issues/5"},"comments":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/sdroege/gtk-subclass/statuses/06e2feec2c2526c46e9a276da04e3e23e5715233"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sdroege"}}