Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

gio: manually implement Display for File #503

Closed
wants to merge 1 commit into from
Closed

Conversation

pbor
Copy link
Contributor

@pbor pbor commented May 4, 2021

No description provided.

Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

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

This is unfortunately incoherent. If you'd Display a gio::File as a glib::Object or gio::File or a gio::LocalFile the results would be different.

Not sure if that's a good idea here.

@pbor
Copy link
Contributor Author

pbor commented May 4, 2021

I am not sure I follow... what is the benefit of printing an object and just see "File"?

If I print a file I surely would like to see the path/uri and parse name is exactly this: "This is generally used to show the GFile as a nice full-pathname kind of string in a user interface"

@sdroege
Copy link
Member

sdroege commented May 4, 2021

I am not sure I follow... what is the benefit of printing an object and just see "File"?

Nothing, I don't think any of these things should have a Display impl but others disagreed with that.

If I print a file I surely would like to see the path/uri and parse name is exactly this: "This is generally used to show the GFile as a nice full-pathname kind of string in a user interface"

Yes, but you'd just get Object if you did the same on file.upcast_ref::<glib::Object>() for example. That's why it's incoherent.

@pbor pbor closed this May 8, 2021
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.

None yet

2 participants