| Summary: | Sending images from digikam fails if directory name contains parentheses | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Brian <brian> |
| Component: | Plugin-Generic-SendByMail | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | imaging-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 5.6.0 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 7.6.0 | |
| Sentry Crash Report: | |||
|
Description
Brian
2006-07-25 12:11:29 UTC
Ok, i'll look at it. SVN commit 566299 by toma:
Thunderbird's commandline does not like ( and ). Filter them out in the temp file name.
BUG:131343
M +5 -1 sendimages.cpp
--- trunk/extragear/libs/kipi-plugins/sendimages/sendimages.cpp #566298:566299
@@ -150,8 +150,12 @@
// Prepare resizing images.
QString imageFileName = ItemName;
+ QString f = (*it).directory().section('/', -1);
- QString imageNameFormat = (*it).directory().section('/', -1) + "-" +
+ // Thunderbird does not like (). Replace them, BUG:131343
+ f.replace(QChar('('), "_").replace(QChar(')'), "_");
+
+ QString imageNameFormat = f + "-" +
imageFileName.replace(QChar('.'), "_") +
extension(m_imageFormat);
On Tuesday 25 July 2006 20:28, Tom Albers wrote:
[...]
> Thunderbird's commandline does not like ( and ). Filter them out in the temp file name.
> BUG:131343
Well, not quite right. For a filename 'one ( test ) case', this works perfectly
mozilla-thunderbird -remote xfeDoCommand\(composeMessage,attachment=file://$PWD/one%20%28%20test%20%29%20case\)
As attachment= is a URL, it should be url encoded.
Achim
[...]
I do believe we should find a common way to solve this problem in libkipi to avoid code duplication. Angelo so you want to use 'one%20%28%20test%20%29%20case' as a filename everywhere? must get some new glasses -> reopen Toma have a look at Aurelien's webifyFileName function in generator.cpp (html export) I added it in cd archive. I'd like to have it once, and for all, though :) On Thursday 03 August 2006 16:22, Tom Albers wrote:
[...]
> ------- Additional Comments From tomalbers kde nl 2006-08-03 16:22 -------
> so you want to use 'one%20%28%20test%20%29%20case' as a filename everywhere?
No. The filename on disk is readable: 'one ( test ) case'.
The urlencoded string 'one%20%28%20test%20%29%20case' in only used for
URL passed to firefox. Firefox decodes it and opens the 'readable'
version on disk.
Achim
P.S. OT: for digikam one can argue if encoding '/' as %2f so it's
hidden to the user that an album is a directory.
[...]
For now, there is no alternative call to any library which encodes the ( and ), so I'll stick with the conversion to _ for now. When there is a central spot for encoding, the code has to change anyhow. Just for the record, what was discussed on IRC URL encoding is described in http://www.ietf.org/rfc/rfc1738.txt Search for 'Unsafe:' to find that chars that have to be escaped. '(' and ')' are not in this list. KURL::setPath() 'only' encodes "/@<>#\"&%?={}|^~[]\'`\\:+ Unless the xfeDoCommand uses '(' and ')' for it own purposes, thunderbird should accept them unescaped (->bug) Achim It probably has to do with their syntax that () are not parsed correctly: mozilla-thunderbird -remote xfeDoCommand(composeMessage,attachment=$filename) In any case, invokeMailer should be used from kde4 on, so kdelibs should tackle this. |