/me done another round of simple stuff renaming :)

(corresponding wiki items <s>-ed out)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797824
This commit is contained in:
Dmitry Suzdalev 2008-04-16 21:15:38 +00:00
parent f522c38eeb
commit c2b28413dd
8 changed files with 34 additions and 34 deletions

View File

@ -742,7 +742,7 @@ void Applet::setDrawStandardBackground(bool drawBackground)
} }
} }
bool Applet::failedToLaunch() const bool Applet::hasFailedToLaunch() const
{ {
return d->failed; return d->failed;
} }
@ -1164,7 +1164,7 @@ void Applet::needsFocus(bool focus)
emit requestFocus(focus); emit requestFocus(focus);
} }
bool Applet::hasConfigurationInterface() bool Applet::hasConfigurationInterface() const
{ {
return d->hasConfigurationInterface; return d->hasConfigurationInterface;
} }
@ -1307,7 +1307,7 @@ void Applet::createConfigurationInterface(KConfigDialog *parent)
// do not put anything here ... // do not put anything here ...
} }
KPluginInfo::List Applet::knownApplets(const QString &category, KPluginInfo::List Applet::listAppletInfo(const QString &category,
const QString &parentApp) const QString &parentApp)
{ {
QString constraint; QString constraint;
@ -1330,19 +1330,19 @@ KPluginInfo::List Applet::knownApplets(const QString &category,
} }
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); 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); 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); 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); KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
return KPluginInfo::fromServices(offers); 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]"; QString constraint = "exist [X-KDE-PluginInfo-Category]";

View File

@ -62,12 +62,12 @@ class Package;
class PLASMA_EXPORT Applet : public QGraphicsWidget class PLASMA_EXPORT Applet : public QGraphicsWidget
{ {
Q_OBJECT 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 name READ name)
Q_PROPERTY(QString category READ category) Q_PROPERTY(QString category READ category)
Q_PROPERTY(bool immutable READ isImmutable WRITE setImmutable) Q_PROPERTY(bool immutable READ isImmutable WRITE setImmutable)
Q_PROPERTY(bool drawStandardBackground READ drawStandardBackground WRITE setDrawStandardBackground) 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(bool needsConfiguring READ needsConfiguring WRITE setNeedsConfiguring)
Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry)
Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources) Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources)
@ -294,7 +294,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* registered to an application. * registered to an application.
* @return list of applets * @return list of applets
**/ **/
static KPluginInfo::List knownApplets(const QString &category = QString(), static KPluginInfo::List listAppletInfo(const QString &category = QString(),
const QString &parentApp = QString()); const QString &parentApp = QString());
/** /**
@ -302,7 +302,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* *
* @return list of applets * @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 * Returns a list of all the categories used by
@ -316,7 +316,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* @return list of categories * @return list of categories
* @param visibleOnly true if it should only return applets that are marked as visible * @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 * 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, * library couldn't be loaded, necessary hardware support wasn't found,
* etc..) this method returns true * etc..) this method returns true
**/ **/
bool failedToLaunch() const; bool hasFailedToLaunch() const;
/** /**
* Call this method when the applet fails to launch properly. An * 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 * @return true if this plasmoid provides a GUI configuration
**/ **/
bool hasConfigurationInterface(); bool hasConfigurationInterface() 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 a list of context-related QAction instances. * Returns a list of context-related QAction instances.
@ -654,6 +643,17 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
**/ **/
virtual void saveState(KConfigGroup* config) const; 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. * Returns the name of the applet.
* *

View File

@ -111,7 +111,7 @@ void AppletBrowserWidget::Private::initFilters()
filterModel.addSeparator(i18n("Categories:")); filterModel.addSeparator(i18n("Categories:"));
foreach (const QString& category, Plasma::Applet::knownCategories(application)) { foreach (const QString& category, Plasma::Applet::listCategories(application)) {
filterModel.addFilter(category, filterModel.addFilter(category,
KCategorizedItemsViewModels::Filter("category", category)); KCategorizedItemsViewModels::Filter("category", category));
} }

View File

@ -110,9 +110,9 @@ void PlasmaAppletItemModel::populateModel()
} }
} }
//TODO: get recommended, favorite, used, etc out of knownApplets() //TODO: get recommended, favorite, used, etc out of listAppletInfo()
//kDebug() << "number of applets is" << Plasma::Applet::knownApplets(QString(), m_application).count(); //kDebug() << "number of applets is" << Plasma::Applet::listAppletInfo(QString(), m_application).count();
foreach (const KPluginInfo& info, Plasma::Applet::knownApplets(QString(), m_application)) { foreach (const KPluginInfo& info, Plasma::Applet::listAppletInfo(QString(), m_application)) {
//kDebug() << info.pluginName() << "NoDisplay" << info.property("NoDisplay").toBool(); //kDebug() << info.pluginName() << "NoDisplay" << info.property("NoDisplay").toBool();
if (info.property("NoDisplay").toBool()) { if (info.property("NoDisplay").toBool()) {
// we don't want to show the hidden category // we don't want to show the hidden category

View File

@ -1152,7 +1152,7 @@ void Containment::dropEvent(QGraphicsSceneDragDropEvent *event)
QVariantList args; QVariantList args;
args << url.url(); args << url.url();
// kDebug() << mimeName; // kDebug() << mimeName;
KPluginInfo::List appletList = Applet::knownAppletsForMimetype(mimeName); KPluginInfo::List appletList = Applet::listAppletInfoForMimetype(mimeName);
if (appletList.isEmpty()) { if (appletList.isEmpty()) {
// no special applet associated with this mimetype, let's // no special applet associated with this mimetype, let's

View File

@ -204,7 +204,7 @@ bool appletConfigLessThan(const KConfigGroup &c1, const KConfigGroup &c2)
void Corona::loadApplets(const QString& configName) void Corona::loadApplets(const QString& configName)
{ {
clearApplets(); clearContainments();
KSharedConfigPtr c; KSharedConfigPtr c;
if (configName.isEmpty() || configName == d->configName) { if (configName.isEmpty() || configName == d->configName) {
@ -309,7 +309,7 @@ QList<Containment*> Corona::containments() const
return d->containments; return d->containments;
} }
void Corona::clearApplets() void Corona::clearContainments()
{ {
foreach (Containment* containment, d->containments) { foreach (Containment* containment, d->containments) {
containment->clearApplets(); containment->clearApplets();

View File

@ -82,7 +82,7 @@ public:
/** /**
* Clear the Corona from all applets. * Clear the Corona from all applets.
*/ */
void clearApplets(); void clearContainments();
/** /**
* Returns the the config file used to store the configuration for this Corona * Returns the the config file used to store the configuration for this Corona

View File

@ -173,7 +173,7 @@ void GLApplet::paintInterface(QPainter *painter,
Q_ASSERT(d->pbuf); Q_ASSERT(d->pbuf);
if ((!d->dummy->isValid() || if ((!d->dummy->isValid() ||
!d->pbuf->isValid())) { !d->pbuf->isValid())) {
if (!failedToLaunch()) { if (!hasFailedToLaunch()) {
setFailedToLaunch(true, i18n("Your machine does not support OpenGL applets.")); setFailedToLaunch(true, i18n("Your machine does not support OpenGL applets."));
} }