diff --git a/dataengine.cpp b/dataengine.cpp index b2e0d447e..65b9d1392 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -425,6 +425,11 @@ bool DataEngine::isValid() const return d->valid; } +bool DataEngine::isEmpty() const +{ + return d->sources.count() > 0; +} + void DataEngine::setValid(bool valid) { d->valid = valid; diff --git a/dataengine.h b/dataengine.h index 394ef9ee5..6a1d9e0f1 100644 --- a/dataengine.h +++ b/dataengine.h @@ -181,6 +181,12 @@ class PLASMA_EXPORT DataEngine : public QObject **/ bool isValid() const; + /** + * Returns true if the data engine is empty, which is to say that it has no + * data sources currently. + */ + bool isEmpty() const; + /** * Sets the icon for this data engine **/