turn another protected slot into a private slot

Brian: please be sure not to introduce any methods into the public API of libplasma that are only used for internals. :)

CCMAIL:batenkaitos@gmail.com

svn path=/trunk/KDE/kdelibs/; revision=1159725
This commit is contained in:
Aaron J. Seigo 2010-08-06 02:28:50 +00:00
parent 11c5c88c68
commit 9fff3dfc06
3 changed files with 20 additions and 15 deletions

View File

@ -29,7 +29,7 @@ namespace Plasma
DataContainer::DataContainer(QObject *parent)
: QObject(parent),
d(new DataContainerPrivate)
d(new DataContainerPrivate(this))
{
}
@ -251,11 +251,12 @@ void DataContainer::retrieve()
SLOT(populateFromStoredData(KJob*)));
}
void DataContainer::populateFromStoredData(KJob *job)
void DataContainerPrivate::populateFromStoredData(KJob *job)
{
if (job->error()) {
return;
}
DataEngine::Data dataToInsert;
ServiceJob* ret = dynamic_cast<ServiceJob*>(job);
QHash<QString, QVariant> h = ret->result().toHash();
@ -270,15 +271,17 @@ void DataContainer::populateFromStoredData(KJob *job)
dataToInsert.insert(key, h[key]);
}
}
if (!(d->data.isEmpty()))
if (!(data.isEmpty()))
{
//Do not fill the source with old stored
//data if it is already populated with new data.
return;
}
d->data = dataToInsert;
d->dirty = true;
checkForUpdate();
data = dataToInsert;
dirty = true;
q->checkForUpdate();
}
void DataContainer::disconnectVisualization(QObject *visualization)

View File

@ -253,17 +253,13 @@ class PLASMA_EXPORT DataContainer : public QObject
**/
void checkUsage();
/**
* Does the work of putting the data from disk into the DataContainer
* after retrieve() sets it up.
*/
void populateFromStoredData(KJob *job);
private:
friend class SignalRelay;
friend class DataContainerPrivate;
DataContainerPrivate *const d;
Q_PRIVATE_SLOT(d, void storeJobFinished(KJob *job))
Q_PRIVATE_SLOT(d, void populateFromStoredData(KJob *job))
};
} // Plasma namespace

View File

@ -33,8 +33,9 @@ class SignalRelay;
class DataContainerPrivate
{
public:
DataContainerPrivate()
: store(NULL),
DataContainerPrivate(DataContainer *container)
: q(container),
store(NULL),
dirty(false),
cached(false),
enableStorage(false),
@ -47,7 +48,6 @@ public:
bool immediateUpdate);
bool hasUpdates();
void populateFromStoredData(KJob *job);
/**
* Deletes the store member of DataContainerPrivate if
@ -55,7 +55,13 @@ public:
*/
void storeJobFinished(KJob *job);
/**
* Does the work of putting the data from disk into the DataContainer
* after retrieve() sets it up.
*/
void populateFromStoredData(KJob *job);
DataContainer *q;
DataEngine::Data data;
QMap<QObject *, SignalRelay *> relayObjects;
QMap<uint, SignalRelay *> relays;