[KPhotoAlbum] Patch for loading only one version of a file into the DB.

Jan Kundrát jkt at gentoo.org
Sun Dec 19 23:56:54 GMT 2010

On 12/12/10 21:38, Andreas Neustifter wrote:
> I completely revised my patch and approached this in a whole different
> manner. The discussion on Aleksi's topics with file version regexes
> helped a lot with this.

Hi Andreas, I got too angry fighting with git-am when trying to merge
these patches (looks like [1] is not integrated in my version of Git).
Could you please push them somewhere, so that I can simply pull? I thing
there *must* be an easier way than saving patches from Thunderbird,
applying them one-by-one and writing the commit message once again :(.

> 0005-Cache-invariant-settings-so-they-are-only-loaded-onc.patch:
> There are some strings and regexes that are constant throughout the
> NewImageFinder::loadExtraFiles() loop, this patch pulls them out and
> creates them only once. As with 0004 useful on its own.

Obligatory question -- what's the overhead of a QRegExp() constructor?
I'm asking because QSettings() is documented to have very low overhead,
and it's really good to have optimizations backed up by measurements.

> 0006-Support-multiple-replacement-regexes-for-file-versio.patch:
> This patch creates support for several regexes for the original file
> version detection. Those regexes are separated with semicolons and
> processes from left to right. The first regex that matches an existing
> file is used as original file.

If you allow entering multiple strings, please also make the GUI look
intuitive. Separating regular expression by semicolon isn't intuitive. I
can't think of anything better that a QTextEdit; I don't believe you'd
like me to suggest using a QListWidget with some delegate for editing
the regular expressions, although I'm sure Jesper would be glad to see
it integrated with the KRegExpEditor :). If you find something
reasonable, please go ahead and use that.

> This does not prevent the loading of multiple files but merely stacks
> them on top of each other.

What happens with other possible stacks? What about replacing the
previous file with the new one if the regexp matches? I don't really
like creating stacks in this situation.



cd /local/pub && more beer > /dev/mouth

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20101220/ee34f9b7/attachment.sig>

More information about the Kphotoalbum mailing list