Re: Off-By-One bug in Folder View?



Hi,

I think I found the problem. Due to lack of C# knowledge I am unable to
fix it, though.

For a file /foo/bar.jpg the database contains a row with base_uri
file:///foo and a file name of bar.jpg. When now clicking on an item in
the folders view, a query for files matching a base_uri of file:///foo/%
is done. Note that there is an added "/" at the end, which seems to come
from Uri.ToString().

My suggestions:
 - only store rows with base_uri having a trailing "/" in the database
 - cut the "/" when constructing the query

I manually added "/" to my current data base which solves the problem
for existing photos:

$ sqlite3 ~/.config/f-spot/photos.db

In there:
update photos set base_uri = base_uri || '/' where not base_uri like '%/';

Bye,
-- 
Carsten Otto           otto informatik rwth-aachen de
LuFG Informatik 2      http://verify.rwth-aachen.de/otto/
RWTH Aachen            phone: +49 241 80-21211

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]