<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div>
<div id="appendonsend" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Matthias et al.,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for all the prompt responses.  I understand what's going on now and it's working the way i want. :)</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks again, you guys are awesome!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Winnie<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Matthias Clasen <mclasen@redhat.com><br>
<b>Sent:</b> November 21, 2019 6:18 PM<br>
<b>To:</b> Winnie Poon <winniepoon_home@hotmail.com><br>
<b>Cc:</b> Jorge García <jgarciao@gmail.com>; Jan Grulich <jgrulich@redhat.com>; Flatpak List <flatpak@lists.freedesktop.org><br>
<b>Subject:</b> Re: flatpak portal example on github</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Nov 21, 2019 at 8:48 PM Winnie Poon <<a href="mailto:winniepoon_home@hotmail.com">winniepoon_home@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'm trying to access a file in say /home/user/hello.txt, which is normally not accessible from sandbox without doing (--file-system=/home/user), so i want to access this file via the portal (without the --file-system permission), get the content.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I thought for the portal test example, the file chooser open together with the "Save as ..." button will do that but apparently the "Save as..." only create a new file with a hardcoded "test" content.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
e.g. there's a file /home/user/hello.txt</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
if I open up the --filesystem=/home/user, then i can do g_file_get_contents("/home/user/hello.txt, ...." to see the file, but without the ---filesystem=/home/user, hello.txt cannot be seen.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
My understanding is the gtk_file_chooser API will communicate iwth the dbus API to open up permission to hello.txt? but i'm having trouble getting the code to do that.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Sorry i'm a bit confused <span id="x_gmail-m_7643477925574976124🙁">🙁</span><br>
</div>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>This all seems perfectly correct. Except for "Save As" - if you want to read an existing file, you should use  a file chooser with GTK_FILE_CHOOSER_ACTION_OPEN, not GTK_FILE_CHOOSER_ACTION_SAVE_AS.
</div>
</div>
</div>
</div>
</div>
</body>
</html>