Bug 397627 - %aCurrent% symbol in user action transformed to wrong file name
Summary: %aCurrent% symbol in user action transformed to wrong file name
Status: RESOLVED NOT A BUG
Alias: None
Product: krusader
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-19 14:49 UTC by appdevsw
Modified: 2018-08-24 06:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Using Ubuntu 18.04 (35.38 KB, image/png)
2018-08-23 17:06 UTC, Toni Asensi Esteve
Details
Using Kubuntu 18.04 (12.50 KB, image/png)
2018-08-23 17:07 UTC, Toni Asensi Esteve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description appdevsw 2018-08-19 14:49:00 UTC
I want to add a custom action and add it to a toolbar as a button.
In this action I want to do something with a file e.g. `touch a file`
As a substitute for a file name I use %aCurrent% symbol.
It works for simple file names with american ASCII characters, but other names are transformed to non existent file names (using \).
Please provide a way to get a real file name without transformation.
Comment 1 Toni Asensi Esteve 2018-08-22 17:47:34 UTC
In my tests: a useraction that only does
    touch %aCurrent%
works using the git version of Krusader (under Kubuntu 18.04 and under Ubuntu 18.04) and even if the name of the file has non us-ascii characters.

If it can be useful, under Kubuntu 18.04 the execution of
    locale
here shows:
    LANG=en_US.UTF-8
    LANGUAGE=
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC=es_ES.UTF-8
    LC_TIME=es_ES.UTF-8
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY=es_ES.UTF-8
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER=es_ES.UTF-8
    LC_NAME=es_ES.UTF-8
    LC_ADDRESS=es_ES.UTF-8
    LC_TELEPHONE=es_ES.UTF-8
    LC_MEASUREMENT=es_ES.UTF-8
    LC_IDENTIFICATION=es_ES.UTF-8
    LC_ALL=

> Platform:     unspecified Linux

Can you give more information about your system, just in case?
Comment 2 appdevsw 2018-08-23 10:58:08 UTC
Hi,
Thank you for looking at the problem.
I use Fedora 28, x64 , with Openbox.

Locale:
LANG=pl_PL.UTF-8 
LC_CTYPE="pl_PL.UTF-8" 
LC_NUMERIC="pl_PL.UTF-8" 
LC_TIME="pl_PL.UTF-8" 
LC_COLLATE="pl_PL.UTF-8" 
LC_MONETARY="pl_PL.UTF-8" 
LC_MESSAGES="pl_PL.UTF-8" 
LC_PAPER="pl_PL.UTF-8" 
LC_NAME="pl_PL.UTF-8" 
LC_ADDRESS="pl_PL.UTF-8" 
LC_TELEPHONE="pl_PL.UTF-8" 
LC_MEASUREMENT="pl_PL.UTF-8" 
LC_IDENTIFICATION="pl_PL.UTF-8" 
LC_ALL=

Sorry, but I should be more precise.
It’s about characters like: []()

Example:
real file name: 

test []()&^%$~`=+{};,.txt

%aCurrent% :

test\ \[\]\(\)\&^%$~`=+\{\}\;,.txt
Comment 3 Toni Asensi Esteve 2018-08-23 17:05:58 UTC
Hi, appdevsw, I've just tried it and it works even if the file is named
    test []()&^%$~`=+{};,.txt
Comment 4 Toni Asensi Esteve 2018-08-23 17:06:54 UTC
Created attachment 114560 [details]
Using Ubuntu 18.04
Comment 5 Toni Asensi Esteve 2018-08-23 17:07:16 UTC
Created attachment 114561 [details]
Using Kubuntu 18.04
Comment 6 Nikita Melnichenko 2018-08-24 04:36:37 UTC
please export your action and attach here
Comment 7 appdevsw 2018-08-24 06:09:31 UTC
Here is the action:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE KrusaderUserActions>
<KrusaderUserActions>
 <action name="touch">
  <title>touch</title>
  <tooltip>touch</tooltip>
  <category>Przykłady</category>
  <description>touch</description>
  <command>touch "%aCurrent%"</command>
 </action>
</KrusaderUserActions>


I started to test it.
Without "" it works properly.
So I made a mistake when I used %aCurrent% in quotation marks.
Sorry.
Please close the bug.