[KPhotoAlbum] Can't load a file named something other than index.xml?

Johannes Zarl-Zierl johannes at zarl-zierl.at
Sun Mar 8 21:36:01 GMT 2020


Hi Robert,

Am Sonntag, 8. März 2020, 16:22:55 CET schrieb Robert Krawitz:
> I'm trying to load an image file named idx2.xml via
> 
> kphotoalbum --db ./idx2.xml
> 
> and it won't load (it loads the index.xml file from the same
> directory).  Is this intended?

I don't know if it is intended, but it has been like that forever (even back 
when the argument was named "-c").

Reading the source, the current behaviour seems to be a conscious design 
choice, and KPhotoAlbum asks the user whether to create an index.xml file when 
one doesn't exist. The exaxt current behaviour is:

1. If the directory containing $dbFile doesn't exist, bail out
2. If and index.xml file exists in the directory containing $dbFile, open it
3. Otherwise, prompt the user whether they want to create an index.xml file

I guess a less confusing way to do it, while still conserving most of the 
behaviour would be to:
1. If $dbFile exists and it looks like an index.xml file, open it
2. If $dbFile exists and is a directory, prompt the user whether they want to 
create an index.xml file.
3. otherwise bail out.

One important thing to note: I did not check whether any other places assume 
that the database is called index.xml. A simple grep tells me that this is 
*very* likely the case...

Cheers,
  Johannes







More information about the Kphotoalbum mailing list