Commit 1cd2c6dd authored by Halla Rempt's avatar Halla Rempt
Browse files

Provide an md5sum for the bundle resource type

Now the bundle resource server can load bundles again.
parent e44336b1
......@@ -32,6 +32,8 @@
#include <QDir>
#include <QDebug>
#include <QBuffer>
#include <QCryptographicHash>
#include <QByteArray>
//TODO Voir s'il ne vaut pas mieux faire un constructeur avec un xmlmeta plutot qu'un setmeta (cf control createPack)
KoResourceBundle::KoResourceBundle(QString const& fileName)
......@@ -227,7 +229,14 @@ void KoResourceBundle::setThumbnail(QString filename)
QByteArray KoResourceBundle::generateMD5() const
{
Q_ASSERT("Implement this!");
QFile f(filename());
if (f.exists()) {
f.open(QFile::ReadOnly);
QByteArray ba = f.readAll();
QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData(ba);
return md5.result();
}
return QByteArray();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment