Bug 395590 - Cannot open files with name containing #
Summary: Cannot open files with name containing #
Status: RESOLVED FIXED
Alias: None
Product: kio-gdrive
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 1.2.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-19 03:21 UTC by whitemoon
Modified: 2022-09-15 22:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.2.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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