Re: Can't load a file named something other than index.xml?
Robert Krawitz <rlk-FrUbXkNCsVf2fBVCVOL8/[email protected]> Sun, 8 Mar 2020 18:15:16 -0400 (EDT)
| Newsgroups | gmane.comp.kde.kimdaba |
|---|---|
| Message-ID | <20200308221516.D884F424A53@localhost> |
On Sun, 08 Mar 2020 22:36:01 +0100, Johannes Zarl-Zierl wrote: > 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"). It was very, very confusing. In this case I was trying to use an _existing_ file (named idx2.xml) because I wanted to compare behavior. I was at my wit's end trying to figure out what was going on; finally when I chmod 0'd index.xml it became clear. > 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... That does appear to be the case. I've filed bug 418647 against this so we're aware of it. Coincidentally, koffice had something similar (56834). -- Robert Krawitz <[email protected]> *** MIT Engineers A Proud Tradition http://mitathletics.com *** Member of the League for Programming Freedom -- http://ProgFree.org Project lead for Gutenprint -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton _______________________________________________ KPhotoAlbum mailing list [email protected] https://mail.kdab.com/mailman/listinfo/kphotoalbum