bool Package::hasValidStructure() const
needed to differentiate between packages with structures and without before path is set
This commit is contained in:
parent
3e61b26178
commit
928d5e63a5
@ -72,6 +72,11 @@ Package &Package::operator=(const Package &rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Package::hasValidStructure() const
|
||||
{
|
||||
return d->structure;
|
||||
}
|
||||
|
||||
bool Package::isValid() const
|
||||
{
|
||||
if (!d->structure) {
|
||||
|
@ -101,6 +101,14 @@ public:
|
||||
*/
|
||||
Package &operator=(const Package &rhs);
|
||||
|
||||
/**
|
||||
* @return true if this package has a valid PackageStructure associatedw it with it.
|
||||
* A package may not be valid, but have a valid structure. Useful when dealing with
|
||||
* Package objects in a semi-initialized state (e.g. before calling setPath())
|
||||
* @since 5.1
|
||||
*/
|
||||
bool hasValidStructure() const;
|
||||
|
||||
/**
|
||||
* @return true if all the required components exist
|
||||
**/
|
||||
|
@ -399,7 +399,7 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s
|
||||
{
|
||||
if (!d->isDefaultLoader) {
|
||||
Package p = internalLoadPackage(packageFormat, specialization);
|
||||
if (p.isValid() || !p.files().isEmpty()) {
|
||||
if (p.hasValidStructure()) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user