Commit c7b77015 authored by Stefano Bonicatti's avatar Stefano Bonicatti Committed by Boudewijn Rempt

Fix bundle and preset loading

On Windows the code to parse the bundle name and the relative path to the
filename inside the bundle fails because columns are used as a reference
tp split the string and the partition labels contains columns.
Since we are interested in the last ones anyway, we use lastIndexOf
instead of indexOf.
parent acc76b4e
......@@ -150,8 +150,9 @@ bool KisPaintOpPreset::load()
if (filename().startsWith("bundle://")) {
qDebug() << "bundle";
QString bn = filename().mid(9);
QString fn = bn.mid(bn.indexOf(":") + 1);
bn = bn.left(bn.indexOf(":"));
int pos = bn.lastIndexOf(":");
QString fn = bn.right(bn.size() - pos - 1);
bn = bn.left(pos);
QScopedPointer<KoStore> resourceStore(KoStore::createStore(bn, KoStore::Read, "application/x-krita-resourcebundle", KoStore::Zip));
if (!resourceStore || resourceStore->bad()) {
......
......@@ -36,8 +36,9 @@ QByteArray KisMD5Generator::generateHash(QString filename)
QByteArray ba;
if(filename.startsWith("bundle://")) {
QString bn = filename.mid(9);
QString fn = bn.mid(bn.indexOf(":") + 1);
bn = bn.left(bn.indexOf(":"));
int pos = bn.lastIndexOf(":");
QString fn = bn.right(bn.size() - pos - 1);
bn = bn.left(pos);
QScopedPointer<KoStore> resourceStore(KoStore::createStore(bn, KoStore::Read, "application/x-krita-resourcebundle", KoStore::Zip));
if (!resourceStore || resourceStore->bad()) {
......
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