Bug 395590

Summary: Cannot open files with name containing #
Product: [Frameworks and Libraries] kio-gdrive Reporter: whitemoon <muktabh>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal CC: kariantine
Priority: NOR    
Version: 1.2.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 1.2.4

Description whitemoon 2018-06-19 03:21:19 UTC
I have set up Gdrive integration in Dolphin using kio-gdrive. I am successfully able to login and see all the stored files. I am also able to open most of the files, except the ones that have name containing the character "#" e.g. "C# - Learning C# 3.0.pdf"
Comment 1 Elvis Angelaccio 2018-06-29 08:49:03 UTC
Git commit 98eac3003a07a7b785c916950076d7b0d56d6d61 by Elvis Angelaccio.
Committed on 29/06/2018 at 08:44.
Pushed by elvisangelaccio into branch '1.2'.

Use percent encoding when creating urls for UDS entries

Summary:
Otherwise it won't be possible to open gdrive files that contain special
characters (such as `#`) in their path.

This is not handled by libkgapi, which just copies whatever is in the
JSON from Google, and Google does not seem to encode the filenames
either. So we encode the filenames at the kio-gdrive level, where we
actually play with QUrls.

We do so by actually creating a QUrl (which takes care of
percent-encoding in `setPath()`) and then we convert it to a string.

While at it, use faster concatenation rather than arg parsing.
FIXED-IN: 1.2.4

Test Plan:
Try to open a file with `#` in the name.
Check whether files with normal names still work.

Reviewers: dvratil, dfaure

Differential Revision: https://phabricator.kde.org/D13691

M  +23   -6    autotests/urltest.cpp
M  +15   -1    src/kio_gdrive.cpp
M  +1    -0    src/kio_gdrive.h

https://commits.kde.org/kio-gdrive/98eac3003a07a7b785c916950076d7b0d56d6d61
Comment 2 Twanoo51 2018-08-08 20:38:33 UTC
Hi,

It is not possible in v1.2.4 to open folders with specials caracters like '+' in their name.
Comment 3 Elvis Angelaccio 2022-09-15 22:34:36 UTC
(In reply to Twanoo51 from comment #2)
> Hi,
> 
> It is not possible in v1.2.4 to open folders with specials caracters like
> '+' in their name.

Let's track this is https://bugs.kde.org/show_bug.cgi?id=414697