ensure prefixes end with '/'

This commit is contained in:
Aaron Seigo 2012-10-31 12:13:43 +01:00
parent a934d8f867
commit 9b7b6054ee

View File

@ -521,6 +521,17 @@ void Package::setContentsPrefixPaths(const QStringList &prefixPaths)
d->contentsPrefixPaths = prefixPaths;
if (d->contentsPrefixPaths.isEmpty()) {
d->contentsPrefixPaths << QString();
} else {
// the code assumes that the prefixes have a trailing slash
// so let's make that true here
QMutableStringListIterator it(d->contentsPrefixPaths);
while (it.hasNext()) {
it.next();
if (!it.value().endsWith('/')) {
it.setValue(it.value() % '/');
}
}
}
}