[KPhotoAlbum] Breaking changes in file layout

Martin Höller martin at xss.co.at
Mon Apr 6 14:41:56 BST 2020


Am 06. Apr. 2020 schrieb Tobias Leupold:

> What about this one:
> 
>     QString Whatever::dbIdentifier(const QString &indexXml) const
>     {
>         const QFileInfo fileInfo(indexXml);
>         const QByteArray bytes(fileInfo.canonicalPath().toUtf8());
>         return QStringLiteral("%1-%2").arg(
>             QString::number(qChecksum(bytes.data(), bytes.size(),
>                             Qt::ChecksumIso3309)),
>             fileInfo.dir().dirName());
>     }
> 
> Gives me e. g. "60243-Fotoalbum" for my "/home/tobias/Fotoalbum/index.xml".

That's what I was thinking about.

I don't know ISO-3309 but this would also be possible with MD5/SHA/etc.:
https://stackoverflow.com/questions/16383392/how-to-get-the-sha-1-md5-checksum-of-a-file-with-qt

BTW, this link also uses an ID and a title like suggested.

- martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20200406/c170869d/attachment.sig>


More information about the Kphotoalbum mailing list