[Webkit-unassigned] [Bug 212322] [GTK4] Implement file chooser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 1 03:49:28 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=212322

--- Comment #5 from Santosh Mahto <santosh.mahto at collabora.com> ---
(In reply to Adrian Perez from comment #4)
> Comment on attachment 400723 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400723&action=review
> 
> > Source/WebCore/ChangeLog:7
> > +        to port FileChooser seemlessly.
> 
> Typo: seemlessly → seamlessly
> 

 thanks, will update.

> > Source/WebCore/platform/gtk/GtkVersioning.h:166
> > +        return gtk_file_chooser_select_file(chooser, g_file_new_for_path(filename), NULL);
> 
> This leaks the GFile returned by g_file_new_for_path(), please store its
> return
> value in a GRefPtr<GFile> before passing it to
> gtk_file_chooser_select_file() to
> ensure that it will be unref'd properly.
> 

Thanks for pointing this.

> > Source/WebCore/platform/gtk/GtkVersioning.h:178
> > +        gchar* uri = g_file_get_path(static_cast<GFile*>(node->data));
> 
> The documentation for gtk_file_chooser_get_filenames() says:
> 
>    “If files in the current folder cannot be represented as
>     local filenames they will be ignored.“
> 
> Therefore we need to check here whether the GFile is local or
> not, and skip adding the non-local ones to the result list. I
> think that using g_file_is_native() would fit well.

As per doc g_file_get_path seems to only return localname
"Gets the local pathname for GFile, if one exists. If non-NULL, this is guaranteed to be an absolute, canonical path. It might contain symlinks.".

Even gtk3 implementation of gtk_file_chooser_get_filenames seems to be doing the same (filtering  local filename by call to g_file_get_path) :
https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.20/gtk/gtkfilechooser.c#L867

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200601/c6deb131/attachment.htm>


More information about the webkit-unassigned mailing list