diff --git a/applet.cpp b/applet.cpp index 5f0ae9158..057cda0f4 100644 --- a/applet.cpp +++ b/applet.cpp @@ -742,7 +742,7 @@ void Applet::setDrawStandardBackground(bool drawBackground) } } -bool Applet::failedToLaunch() const +bool Applet::hasFailedToLaunch() const { return d->failed; } @@ -1164,7 +1164,7 @@ void Applet::needsFocus(bool focus) emit requestFocus(focus); } -bool Applet::hasConfigurationInterface() +bool Applet::hasConfigurationInterface() const { return d->hasConfigurationInterface; } @@ -1307,7 +1307,7 @@ void Applet::createConfigurationInterface(KConfigDialog *parent) // do not put anything here ... } -KPluginInfo::List Applet::knownApplets(const QString &category, +KPluginInfo::List Applet::listAppletInfo(const QString &category, const QString &parentApp) { QString constraint; @@ -1330,19 +1330,19 @@ KPluginInfo::List Applet::knownApplets(const QString &category, } KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); - //kDebug() << "Applet::knownApplets constraint was '" << constraint << "' which got us " << offers.count() << " matches"; + //kDebug() << "Applet::listAppletInfo constraint was '" << constraint << "' which got us " << offers.count() << " matches"; return KPluginInfo::fromServices(offers); } -KPluginInfo::List Applet::knownAppletsForMimetype(const QString &mimetype) +KPluginInfo::List Applet::listAppletInfoForMimetype(const QString &mimetype) { QString constraint = QString("'%1' in MimeTypes").arg(mimetype); - //kDebug() << "knownAppletsForMimetype with" << mimetype << constraint; + //kDebug() << "listAppletInfoForMimetype with" << mimetype << constraint; KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); return KPluginInfo::fromServices(offers); } -QStringList Applet::knownCategories(const QString &parentApp, bool visibleOnly) +QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly) { QString constraint = "exist [X-KDE-PluginInfo-Category]"; diff --git a/applet.h b/applet.h index eee4eb079..0da51b630 100644 --- a/applet.h +++ b/applet.h @@ -62,12 +62,12 @@ class Package; class PLASMA_EXPORT Applet : public QGraphicsWidget { Q_OBJECT - Q_PROPERTY(bool hasConfigurationInterface READ hasConfigurationInterface WRITE setHasConfigurationInterface) + Q_PROPERTY(bool hasConfigurationInterface READ hasConfigurationInterface) Q_PROPERTY(QString name READ name) Q_PROPERTY(QString category READ category) Q_PROPERTY(bool immutable READ isImmutable WRITE setImmutable) Q_PROPERTY(bool drawStandardBackground READ drawStandardBackground WRITE setDrawStandardBackground) - Q_PROPERTY(bool failedToLaunch READ failedToLaunch WRITE setFailedToLaunch) + Q_PROPERTY(bool hasFailedToLaunch READ hasFailedToLaunch WRITE setFailedToLaunch) Q_PROPERTY(bool needsConfiguring READ needsConfiguring WRITE setNeedsConfiguring) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources) @@ -294,7 +294,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget * registered to an application. * @return list of applets **/ - static KPluginInfo::List knownApplets(const QString &category = QString(), + static KPluginInfo::List listAppletInfo(const QString &category = QString(), const QString &parentApp = QString()); /** @@ -302,7 +302,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget * * @return list of applets **/ - static KPluginInfo::List knownAppletsForMimetype(const QString &mimetype); + static KPluginInfo::List listAppletInfoForMimetype(const QString &mimetype); /** * Returns a list of all the categories used by @@ -316,7 +316,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget * @return list of categories * @param visibleOnly true if it should only return applets that are marked as visible */ - static QStringList knownCategories(const QString &parentApp = QString(), bool visibleOnly = true); + static QStringList listCategories(const QString &parentApp = QString(), bool visibleOnly = true); /** * Attempts to load an applet @@ -449,7 +449,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget * library couldn't be loaded, necessary hardware support wasn't found, * etc..) this method returns true **/ - bool failedToLaunch() const; + bool hasFailedToLaunch() const; /** * Call this method when the applet fails to launch properly. An @@ -488,18 +488,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget /** * @return true if this plasmoid provides a GUI configuration **/ - bool hasConfigurationInterface(); - - /** - * Sets whether or not this applet provides a user interface for - * configuring the applet. - * - * It defaults to false, and if true is passed in you should - * also reimplement showConfigurationInterface() - * - * @param hasInterface whether or not there is a user interface available - **/ - void setHasConfigurationInterface(bool hasInterface); + bool hasConfigurationInterface() const; /** * Returns a list of context-related QAction instances. @@ -654,6 +643,17 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget **/ virtual void saveState(KConfigGroup* config) const; + /** + * Sets whether or not this applet provides a user interface for + * configuring the applet. + * + * It defaults to false, and if true is passed in you should + * also reimplement showConfigurationInterface() + * + * @param hasInterface whether or not there is a user interface available + **/ + void setHasConfigurationInterface(bool hasInterface); + /** * Returns the name of the applet. * diff --git a/appletbrowser.cpp b/appletbrowser.cpp index b8be0b995..ac1cd7669 100644 --- a/appletbrowser.cpp +++ b/appletbrowser.cpp @@ -111,7 +111,7 @@ void AppletBrowserWidget::Private::initFilters() filterModel.addSeparator(i18n("Categories:")); - foreach (const QString& category, Plasma::Applet::knownCategories(application)) { + foreach (const QString& category, Plasma::Applet::listCategories(application)) { filterModel.addFilter(category, KCategorizedItemsViewModels::Filter("category", category)); } diff --git a/appletbrowser/plasmaappletitemmodel.cpp b/appletbrowser/plasmaappletitemmodel.cpp index f44336cce..7e5778396 100644 --- a/appletbrowser/plasmaappletitemmodel.cpp +++ b/appletbrowser/plasmaappletitemmodel.cpp @@ -110,9 +110,9 @@ void PlasmaAppletItemModel::populateModel() } } - //TODO: get recommended, favorite, used, etc out of knownApplets() - //kDebug() << "number of applets is" << Plasma::Applet::knownApplets(QString(), m_application).count(); - foreach (const KPluginInfo& info, Plasma::Applet::knownApplets(QString(), m_application)) { + //TODO: get recommended, favorite, used, etc out of listAppletInfo() + //kDebug() << "number of applets is" << Plasma::Applet::listAppletInfo(QString(), m_application).count(); + foreach (const KPluginInfo& info, Plasma::Applet::listAppletInfo(QString(), m_application)) { //kDebug() << info.pluginName() << "NoDisplay" << info.property("NoDisplay").toBool(); if (info.property("NoDisplay").toBool()) { // we don't want to show the hidden category diff --git a/containment.cpp b/containment.cpp index 2cb1f6bea..73a4a7a88 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1152,7 +1152,7 @@ void Containment::dropEvent(QGraphicsSceneDragDropEvent *event) QVariantList args; args << url.url(); // kDebug() << mimeName; - KPluginInfo::List appletList = Applet::knownAppletsForMimetype(mimeName); + KPluginInfo::List appletList = Applet::listAppletInfoForMimetype(mimeName); if (appletList.isEmpty()) { // no special applet associated with this mimetype, let's diff --git a/corona.cpp b/corona.cpp index 136c99a9b..953ea7c59 100644 --- a/corona.cpp +++ b/corona.cpp @@ -204,7 +204,7 @@ bool appletConfigLessThan(const KConfigGroup &c1, const KConfigGroup &c2) void Corona::loadApplets(const QString& configName) { - clearApplets(); + clearContainments(); KSharedConfigPtr c; if (configName.isEmpty() || configName == d->configName) { @@ -309,7 +309,7 @@ QList Corona::containments() const return d->containments; } -void Corona::clearApplets() +void Corona::clearContainments() { foreach (Containment* containment, d->containments) { containment->clearApplets(); diff --git a/corona.h b/corona.h index 4c93b126b..9e0f29785 100644 --- a/corona.h +++ b/corona.h @@ -82,7 +82,7 @@ public: /** * Clear the Corona from all applets. */ - void clearApplets(); + void clearContainments(); /** * Returns the the config file used to store the configuration for this Corona diff --git a/glapplet.cpp b/glapplet.cpp index 4a0840d6f..ae8e71755 100644 --- a/glapplet.cpp +++ b/glapplet.cpp @@ -173,7 +173,7 @@ void GLApplet::paintInterface(QPainter *painter, Q_ASSERT(d->pbuf); if ((!d->dummy->isValid() || !d->pbuf->isValid())) { - if (!failedToLaunch()) { + if (!hasFailedToLaunch()) { setFailedToLaunch(true, i18n("Your machine does not support OpenGL applets.")); }