remove the static hash of packagestructure
unfortunately they are stateful with a state per-package, so sharing them leads to an incorrect state
This commit is contained in:
parent
423ce0c356
commit
21d9d07e0b
@ -92,8 +92,6 @@ public:
|
|||||||
void createPackageMetadata(const QString &path);
|
void createPackageMetadata(const QString &path);
|
||||||
QStringList entryList(const QString &prefix, const QString &requestedPath);
|
QStringList entryList(const QString &prefix, const QString &requestedPath);
|
||||||
|
|
||||||
static QHash<QString, PackageStructure::Ptr> structures;
|
|
||||||
|
|
||||||
QString type;
|
QString type;
|
||||||
QString path;
|
QString path;
|
||||||
QStringList contentsPrefixPaths;
|
QStringList contentsPrefixPaths;
|
||||||
@ -105,8 +103,6 @@ public:
|
|||||||
bool externalPaths;
|
bool externalPaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
QHash<QString, PackageStructure::Ptr> PackageStructurePrivate::structures;
|
|
||||||
|
|
||||||
PackageStructure::PackageStructure(QObject *parent, const QString &type)
|
PackageStructure::PackageStructure(QObject *parent, const QString &type)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
d(new PackageStructurePrivate(type))
|
d(new PackageStructurePrivate(type))
|
||||||
@ -124,11 +120,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
|||||||
return Ptr(new PackageStructure());
|
return Ptr(new PackageStructure());
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageStructure::Ptr structure = PackageStructurePrivate::structures[packageFormat];
|
PackageStructure::Ptr structure;
|
||||||
|
|
||||||
if (structure) {
|
|
||||||
return structure;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (packageFormat == "Plasma/Applet") {
|
if (packageFormat == "Plasma/Applet") {
|
||||||
structure = defaultPackageStructure(AppletComponent);
|
structure = defaultPackageStructure(AppletComponent);
|
||||||
@ -152,7 +144,6 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (structure) {
|
if (structure) {
|
||||||
PackageStructurePrivate::structures[packageFormat] = structure;
|
|
||||||
return structure;
|
return structure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +174,6 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
|||||||
if (!configPath.isEmpty()) {
|
if (!configPath.isEmpty()) {
|
||||||
KConfig config(configPath);
|
KConfig config(configPath);
|
||||||
structure->read(&config);
|
structure->read(&config);
|
||||||
PackageStructurePrivate::structures[packageFormat] = structure;
|
|
||||||
return structure;
|
return structure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +182,6 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
|||||||
if (url.isLocalFile()) {
|
if (url.isLocalFile()) {
|
||||||
KConfig config(url.toLocalFile(), KConfig::SimpleConfig);
|
KConfig config(url.toLocalFile(), KConfig::SimpleConfig);
|
||||||
structure->read(&config);
|
structure->read(&config);
|
||||||
PackageStructurePrivate::structures[structure->type()] = structure;
|
|
||||||
}
|
}
|
||||||
#ifndef PLASMA_NO_KIO
|
#ifndef PLASMA_NO_KIO
|
||||||
else {
|
else {
|
||||||
@ -203,7 +192,6 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
|||||||
if (job->exec()) {
|
if (job->exec()) {
|
||||||
KConfig config(tmp.fileName(), KConfig::SimpleConfig);
|
KConfig config(tmp.fileName(), KConfig::SimpleConfig);
|
||||||
structure->read(&config);
|
structure->read(&config);
|
||||||
PackageStructurePrivate::structures[structure->type()] = structure;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user