Fix sharing files with spaces or quotes in names via Telegram

Authored by mikhailru on Feb 21 2019, 7:57 PM.

Description

Fix sharing files with spaces or quotes in names via Telegram

Summary:
At present, when one tries to share files with
certain names via Telegram using Dolphin's share menu,
Dolphin crashes (names contain unbalanced quotes) or a wrong
name is passed to Telegram (names with spaces). The root cause
is KShell::splitArgs returning empty QStringList or doing
wrong splits for the above classes of names. This patch
postpones the substitution of "%u" with the actual filename
until splitting is done, thus avoiding undesired behavior.

Test Plan:

  1. Create test files:

$ echo test | tee test\ .txt | tee test\'.txt > test\".txt

  1. Start Dolphin and share the files via Telegram.
  1. No errors and crashes should occur in the process.

Reviewers: apol

Reviewed By: apol

Subscribers: kde-frameworks-devel

Tags: Frameworks

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