Skip to content

Rename GTasks Task list - #165

Merged
danirabbit merged 6 commits into
masterfrom
gtasks-rename-list
Dec 1, 2020
Merged

danirabbit merged 6 commits into
masterfrom
gtasks-rename-list

Conversation

@marbetschar

Copy link
Copy Markdown
Member

This PR fixes #163

@danirabbit danirabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This works as expected for renaming GTasks lists. I am encountering this error though:

(io.elementary.tasks:5319): GLib-GObject-WARNING **: 11:34:30.995: invalid cast from 'EGDataOAuth2Authorizer' to 'GDataOAuth2Authorizer'

@marbetschar

marbetschar commented Nov 24, 2020 •

Copy link
Copy Markdown
Member Author

@danrabbit that's probably due to the following line in the code:

var oauth2_authorizer = (GData.OAuth2Authorizer) new E.GDataOAuth2Authorizer (collection_source, typeof (GData.TasksService));

tbh I don't know if that's the way how the code is intended to be used. As there is no unified, high level API for task list managing in libedataserver I'm doing a lot of guess work here. But I don't see why libedataserver should provide a E.GDataOAuth2Authorizer other than allow for authorization to use a libgdata backend - therefore casting it to a GData.OAuth2Authorizer seemed like the way to go.

@marbetschar

Copy link
Copy Markdown
Member Author

maybe @tintou knows, if this the correct way to glue libgdata and libedataserver-1.2 together?

The below code produces a warning (invalid cast from 'EGDataOAuth2Authorizer' to 'GDataOAuth2Authorizer'), but other than that it works:

var oauth2_authorizer = (GData.OAuth2Authorizer) new E.GDataOAuth2Authorizer (collection_source, typeof (GData.TasksService));

@tintou

tintou commented Nov 25, 2020

Copy link
Copy Markdown
Member

@marbetschar I've now opened https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/57
Just FYI, after this PR, the .vapi contains this:

public class GDataOAuth2Authorizer : GLib.Object, GData.Authorizer {

So you might want to cast to GData.Authorizer instead.

Comment thread src/TaskModel.vala Outdated
Comment thread src/TaskModel.vala Outdated

@danirabbit danirabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works as expected. No more Terminal errors. Nice job :)

@danirabbit
danirabbit merged commit 18a791c into master Dec 1, 2020
@danirabbit
danirabbit deleted the gtasks-rename-list branch December 1, 2020 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Tasks: Rename a Task List

3 participants