[Digikam-devel] [Bug 160840] Wrong filtering on Album-Subtree-View

Arnd Baecker arnd.baecker at web.de
Tue Apr 15 11:07:03 BST 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=160840         




------- Additional Comments From arnd.baecker web de  2008-04-15 12:07 -------
Hi Andi,

thanks a lot for the detailed and clear description of the problem!

The problem was in   kioslave/digikamalbums.cpp :

        if (recurseAlbums)
        {
            // Search for albums and sub-albums:
            // For this, get the path with a trailing "/".
            // Otherwise albums on the same level like "Paris", "Paris 2006",
            // would be found in addition to "Paris/*".
            urlWithTrailingSlash = kurl.path(1);

            m_sqlDB.execSql(QString("SELECT DISTINCT id, url FROM Albums WHERE
url='%1' OR url LIKE '\%%2\%';")
                            .arg(escapeString(url)).arg(escapeString(urlWithTrai
lingSlash)), &albumvalues);
        }

So in your particular example, a search for "/one2one"
is performed. The "OR  url LIKE '...'" will also return those files
with "/2007/one2one".

The solution is to omit the first \% in the query.
(see e.g. http://www.techonthenet.com/sql/like.php )

It works fine for me now, but if possible, it would be nice
if you could compile current svn to make sure that it works fine for you.

Gilles, Marcel: I don't know if the code is the same in KDE4, so
please check and backport if necessary.

Best, Arnd



More information about the Digikam-devel mailing list