Do not rename or change paths outside of XnViewMP to any cataloged folder!
Your work (ratings / colors etc.) will be 'hidden'!
Perhaps most of you know this, but (perhaps) what you do not realize is that even if you change the capitalization (change the case) of a directory, XnView will be 'confused'.
How to reproduce:
Having the following directories (or similar):
Code: Select all
\
Folder 1
Subfolder 1
Subfolder 2
SubSubFolder 21
SubSubFolder 22
2. Close XnViewMP
3. Rename SubSubFolder 21 to subsubFolder 21 (or change the case in any way). Also, perhaps more spectacular, is to change the case of Subfolder 2 to subfolder 2. It will hide both subfolders. And if you want to be really geek, change the case of the Folder1 to eg. fOldEr1. It will blow away the entire tree underneath.
4. Reopen to XnViewMP. Perhaps if will show (correctly) the last opened folder. To force a refresh, go to another folder and return back.
Expected: Ratings, colors etc. to remain in place.
Actual: All the ratings, colors and such disappeared!
How to fix:
Yes, I cheated. I knew when I looked at the DB structure. The folder paths are stored inside case-sensitively, which smells to me that the engine threats in this way the paths. I checked using the procedure above and indeed the XnViewMP threats c:\foo\bar\baz and c:\Foo\Bar\Baz differently!
The fix for changing case is simple: Store and process the paths in/from DB in case INsensitive way (call lower for example).
Also this fix leads to a whole area of searching opportunities:
- Instant pattern search for directories and files in database. (Btw, 'Use database' checkbox doesn't work)
- Ultra fast finding of duplicates by using the DB info. Way faster than a regular Duplicate Finder like eg. in Tools menu.
- Flexible scope limiting for different DB searches and processing engines (cleanup etc.).
- Relocation. Oh, the big problem of relocation.
But this a little latter on...

Btw, I think that's better to use c++'s Lower and store them in this normalized way rather than do the conversion at each fetch from DB. This will help us a little when we'll optimize the...
Code: Select all
SELECT foo FROM Images WHERE FolderID=? AND FILENAME=?;

A problem here how the program shows the paths in the Folders Tree. Istm that it looks on the disk, hence no problem having in the catalog in small letters.
PS: Do not forget to do a simple upgrade procedure for the database. It is a simple query. If you want, I'll write it for you.
