Comments (10)
By https://gitlab.gnome.org/GNOME/glib/blob/master/gio/gfile.c#L6835 get_uri_scheme
can return NULL in some cases.
At minimum get_uri
implementation return NULL for nonabsolute paths
https://gitlab.gnome.org/GNOME/glib/blob/master/gio/glocalfile.c#L277
https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gconvert.c#L1774
from gio.
I think GFile
has no concept/representation of relative paths. Relative arguments to g_file_new_for_path()
lead to an absolute representation in g_file_get_uri()
. Also, NULL is not documented as return value.
from gio.
You right, for relative paths GLocalFile doing canonicalize.
I found only one call in gio, that checks it result for NULL: https://gitlab.gnome.org/GNOME/glib/blob/master/gio/win32/gwinhttpfile.c#L243,
so maybe you right about get_uri
from gio.
So anything that has to be done here?
from gio.
@sdroege it's probably more the question where to start? There is a lot of functions that don't need to return an Option. I don't know if it is really efficient if I am opening an issue for every singe function (#158, gtk-rs/gtk#709).
from gio.
Well, it needs someone to systematically go over all these functions and check what would be correct, and then make a PR with the changes :) If you don't plan to do that, just doing an issue for every (group of) functions you find that look wrong is fine too.
The functions mentioned here seem to be correct though? Unlikely that they return None
but unfortunately that can
from gio.
Let's close this then. Please open new issues for everything you notice that shouldn't return an Option
:)
from gio.
The functions mentioned here seem to be correct though? Unlikely that they return
None
but unfortunately that can
I don't think so.
from gio.
Checked again and you're right that these functions shouldn't return an Option
. The discussion above confused me! Will fix :)
from gio.
See #221
from gio.
Related Issues (20)
- Idea for "magical" strings HOT 6
- Add GPropertyAction HOT 3
- Unable to write bytes to IOStream using futures HOT 4
- How to convert Vec<GString> into Vec<String> HOT 6
- Missing Permission::new() HOT 5
- Manual bindings for functions with Cancellable args are inconsistent HOT 4
- Implement AppInfo::launch_uris_async
- Wrong mutability in UnixMountPoint HOT 1
- Don't require all users of `GioFuture` to depend on `fragile` HOT 1
- GIO is trying to list g_desktop_app_info* on macos and causing link failure HOT 1
- DataInputStream::read_until_async asserts when empty HOT 6
- Add check to ensure that no manual_trait is forgotten HOT 5
- ApplicationExt::connect_handle_local_options() is missing HOT 7
- Implement an AsyncBufRead adapter for InputStream HOT 9
- ThreadedSocketService panics while accepting connection HOT 4
- Bind GIOChannel HOT 3
- How to use async reqwest HTTP client from gio event loop? HOT 3
- InetAddress <-> standard library IpAddr* types conversion
- `TimeVal` usage is wrong and maybe shouldn't be there at all HOT 1
- No TlsBackend? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gio.