[KPhotoAlbum] Breaking changes in file layout

Tobias Leupold tobias.leupold at gmx.de
Mon Apr 6 13:04:26 BST 2020


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".

Am Montag, 6. April 2020, 12:24:38 CEST schrieb Tobias Leupold:
> > Just an idea: what about an encoding like many news-sites or
> > stackoverflow.com use, a mix of hash + title. The hash-part makes the
> > entry unique, the title part makes it readable for humans.
> >
> > For the example above, the result would be something like
> >
> > /home/johannes/.cache/kphotoalbum/<hashCode>-home_johannes_Pictures
> >
> > Or maybe just the last part of the complete path (the filename), to
> > reduce length?
> >
> > /home/johannes/.cache/kphotoalbum/<hashCode>-Pictures
>
> This is a solution I personally could live with. Preferrably with some short
> hash if such an algorithm exits and is usable via Qt directly.
>
> _______________________________________________
> KPhotoAlbum mailing list
> KPhotoAlbum at mail.kdab.com
> https://mail.kdab.com/mailman/listinfo/kphotoalbum






More information about the Kphotoalbum mailing list