Bug 125926 - digikam: directories with a '#' in their name are not properly detected when created outside digikam or ...
Summary: digikam: directories with a '#' in their name are not properly detected when ...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Albums (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-20 01:50 UTC by Achim Bohnet
Modified: 2017-07-25 19:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2006-04-20 01:50:32 UTC
Version:           0.8.2-beta1 (using KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu6 dapper)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-20-686

when created with digikam and digikam is restarted.

This bug is triggered by the debian bug report:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348887

To reproduce

o mkdir ~/Pictures/'bla # bla'  # or use konquoror
o start digikam

==> digikam display 'bla ' instead of 'bla # bla' and

o copy a image via drag and drop fails silently (does nothing)
o Trying to download (from USB disk camera) gives an error
  downloading for every image

If one creates a new dir contain a '#' in it via digikam's
create new album. Then the dir name is properly shown and
works as expected.   But when one exits digikam and starts
it again, the part after the '#' is now cut of too and
above problem/bugs are the consequence.

Achim
Comment 1 Achim Bohnet 2006-04-20 02:28:18 UTC
I've looked in digikam3.db and the complete directory
name is in the 'Albums' table. Independendly if the
directory with a '#' in it was created via digikam
or other tools.  So the '#whatever' part of the dirname
get's lots during retrieve or display of the dirname.
I bet it's the retrieve ;)

Achim
Comment 2 Marcel Wiesweg 2006-04-30 19:08:23 UTC
SVN commit 535877 by mwiesweg:

digikam from trunk:
Properly convert filenames to URL
When creating a KURL from a QString filename,
always use setPath and not the default constructor.
setPath will escape characters (such as '#', which
means, if you think of HTML, an anchor link).

CCBUG: 125926


 M  +6 -3      albummanager.cpp  


--- trunk/extragear/graphics/digikam/digikam/albummanager.cpp #535876:535877
@@ -406,11 +406,14 @@
         if (info.url.isEmpty() || info.url == "/")
             continue;
 
+        // Despite its name info.url is a QString.
+        // setPath takes care for escaping characters that are valid for files but not for URLs ('#')
+        KURL u;
+        u.setPath(info.url);
+        QString name = u.fileName();
         // Get its parent
-        KURL u = info.url;
-        QString name = u.fileName();
         QString purl = u.upURL().path(-1);
-        
+
         PAlbum* parent = d->pAlbumDict.find(purl);
         if (!parent)
         {
Comment 3 Marcel Wiesweg 2006-04-30 19:10:35 UTC
SVN commit 535879 by mwiesweg:

digikam stable branch:
Properly create URL from filename.
Backport commit 535877.

BUG: 125926


 M  +6 -3      albummanager.cpp  


--- branches/stable/extragear/graphics/digikam/digikam/albummanager.cpp #535878:535879
@@ -395,11 +395,14 @@
         if (info.url.isEmpty() || info.url == "/")
             continue;
 
+        // Despite its name info.url is a QString.
+        // setPath takes care for escaping characters that are valid for files but not for URLs ('#')
+        KURL u;
+        u.setPath(info.url);
+        QString name = u.fileName();
         // Get its parent
-        KURL u = info.url;
-        QString name = u.fileName();
         QString purl = u.upURL().path(-1);
-        
+
         PAlbum* parent = d->pAlbumDict.find(purl);
         if (!parent)
         {