use the previously undocument (and not working) in-memory-only KConfig mode

svn path=/trunk/KDE/kdelibs/; revision=1134604
This commit is contained in:
Aaron J. Seigo 2010-06-04 17:28:07 +00:00
parent 89efdef96c
commit d6e1845d3e
2 changed files with 2 additions and 22 deletions

View File

@ -29,8 +29,6 @@
#include <QWidget>
#include <QSet>
#include <ktemporaryfile.h>
#include <dnssd/publicservice.h>
#include <dnssd/servicebrowser.h>
@ -81,7 +79,6 @@ public:
: q(service),
config(0),
dummyConfig(0),
tempFile(0),
publicService(0),
serviceProvider(0)
{
@ -91,7 +88,6 @@ public:
{
delete config;
delete dummyConfig;
delete tempFile;
}
void jobFinished(KJob *job);
@ -115,7 +111,6 @@ public:
QString resourcename;
ConfigLoader *config;
KConfig *dummyConfig;
KTemporaryFile *tempFile;
DNSSD::PublicService *publicService;
ServiceProvider *serviceProvider;
QMultiHash<QWidget *, QString> associatedWidgets;

View File

@ -32,7 +32,6 @@
#include <kservicetypetrader.h>
#include <ksharedconfig.h>
#include <kstandarddirs.h>
#include <ktemporaryfile.h>
#include <dnssd/publicservice.h>
#include <dnssd/servicebrowser.h>
@ -184,12 +183,7 @@ bool ServicePrivate::isPublished() const
KConfigGroup ServicePrivate::dummyGroup()
{
if (!dummyConfig) {
if (!tempFile) {
tempFile = new KTemporaryFile;
tempFile->open();
}
dummyConfig = new KConfig(tempFile->fileName());
dummyConfig = new KConfig(QString(), KConfig::SimpleConfig);
}
return KConfigGroup(dummyConfig, "DummyGroup");
@ -334,9 +328,6 @@ void Service::setName(const QString &name)
delete d->config;
d->config = 0;
delete d->tempFile;
d->tempFile = 0;
delete d->dummyConfig;
d->dummyConfig = 0;
@ -386,17 +377,11 @@ bool Service::isOperationEnabled(const QString &operation) const
void Service::setOperationsScheme(QIODevice *xml)
{
delete d->config;
delete d->tempFile;
delete d->dummyConfig;
d->dummyConfig = 0;
//FIXME: make KSharedConfig and KConfigSkeleton not braindamaged in 4.2 and then get rid of the
// temp file object here
d->tempFile = new KTemporaryFile;
d->tempFile->open();
KSharedConfigPtr c = KSharedConfig::openConfig(d->tempFile->fileName(), KConfig::NoGlobals);
KSharedConfigPtr c = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
d->config = new ConfigLoader(c, xml, this);
d->config->d->setWriteDefaults(true);