coding style fixes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=870212
This commit is contained in:
parent
eae853582b
commit
e2c26f0a90
@ -28,7 +28,7 @@ namespace Plasma
|
||||
class AppletScriptPrivate
|
||||
{
|
||||
public:
|
||||
Applet* applet;
|
||||
Applet *applet;
|
||||
};
|
||||
|
||||
AppletScript::AppletScript(QObject *parent)
|
||||
@ -48,17 +48,19 @@ void AppletScript::setApplet(Plasma::Applet *applet)
|
||||
d->applet = applet;
|
||||
}
|
||||
|
||||
Applet* AppletScript::applet() const
|
||||
Applet *AppletScript::applet() const
|
||||
{
|
||||
Q_ASSERT(d->applet);
|
||||
return d->applet;
|
||||
}
|
||||
|
||||
void AppletScript::paintInterface(QPainter* painter, const QStyleOptionGraphicsItem* option, const QRect &contentsRect)
|
||||
void AppletScript::paintInterface(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
const QRect &contentsRect)
|
||||
{
|
||||
Q_UNUSED(painter)
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(contentsRect)
|
||||
Q_UNUSED(painter);
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(contentsRect);
|
||||
}
|
||||
|
||||
QSizeF AppletScript::size() const
|
||||
@ -107,7 +109,7 @@ void AppletScript::configChanged()
|
||||
{
|
||||
}
|
||||
|
||||
DataEngine* AppletScript::dataEngine(const QString &engine) const
|
||||
DataEngine *AppletScript::dataEngine(const QString &engine) const
|
||||
{
|
||||
Q_ASSERT(d->applet);
|
||||
return d->applet->dataEngine(engine);
|
||||
@ -119,7 +121,7 @@ QString AppletScript::mainScript() const
|
||||
return d->applet->package()->filePath("mainscript");
|
||||
}
|
||||
|
||||
const Package* AppletScript::package() const
|
||||
const Package *AppletScript::package() const
|
||||
{
|
||||
Q_ASSERT(d->applet);
|
||||
return d->applet->package();
|
||||
|
@ -20,7 +20,6 @@
|
||||
#ifndef PLASMA_APPLETSCRIPT_H
|
||||
#define PLASMA_APPLETSCRIPT_H
|
||||
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QRect>
|
||||
#include <QtCore/QSizeF>
|
||||
@ -68,7 +67,7 @@ public:
|
||||
/**
|
||||
* Returns the Plasma::Applet associated with this script component
|
||||
*/
|
||||
Plasma::Applet* applet() const;
|
||||
Plasma::Applet *applet() const;
|
||||
|
||||
/**
|
||||
* Called when the script should paint the applet
|
||||
@ -76,8 +75,8 @@ public:
|
||||
* @param painter the QPainter to use
|
||||
* @param option the style option containing such flags as selection, level of detail, etc
|
||||
*/
|
||||
virtual void paintInterface(QPainter* painter,
|
||||
const QStyleOptionGraphicsItem* option,
|
||||
virtual void paintInterface(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
const QRect &contentsRect);
|
||||
|
||||
/**
|
||||
@ -135,7 +134,7 @@ protected:
|
||||
* @arg engine name of the engine
|
||||
* @return a data engine associated with this plasmoid
|
||||
*/
|
||||
Q_INVOKABLE DataEngine* dataEngine(const QString &engine) const;
|
||||
Q_INVOKABLE DataEngine *dataEngine(const QString &engine) const;
|
||||
|
||||
/**
|
||||
* @return absolute path to the main script file for this plasmoid
|
||||
@ -147,10 +146,10 @@ protected:
|
||||
* be used to request resources, such as images and
|
||||
* interface files.
|
||||
*/
|
||||
const Package* package() const;
|
||||
const Package *package() const;
|
||||
|
||||
private:
|
||||
AppletScriptPrivate * const d;
|
||||
AppletScriptPrivate *const d;
|
||||
};
|
||||
|
||||
#define K_EXPORT_PLASMA_APPLETSCRIPTENGINE(libname, classname) \
|
||||
|
@ -27,7 +27,7 @@ namespace Plasma
|
||||
class DataEngineScriptPrivate
|
||||
{
|
||||
public:
|
||||
DataEngine* dataEngine;
|
||||
DataEngine *dataEngine;
|
||||
};
|
||||
|
||||
DataEngineScript::DataEngineScript(QObject *parent)
|
||||
@ -46,25 +46,25 @@ void DataEngineScript::setDataEngine(DataEngine *dataEngine)
|
||||
d->dataEngine = dataEngine;
|
||||
}
|
||||
|
||||
DataEngine* DataEngineScript::dataEngine() const
|
||||
DataEngine *DataEngineScript::dataEngine() const
|
||||
{
|
||||
return d->dataEngine;
|
||||
}
|
||||
|
||||
bool DataEngineScript::sourceRequestEvent(const QString &name)
|
||||
{
|
||||
Q_UNUSED(name)
|
||||
Q_UNUSED(name);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataEngineScript::updateSourceEvent(const QString& source)
|
||||
bool DataEngineScript::updateSourceEvent(const QString &source)
|
||||
{
|
||||
Q_UNUSED(source)
|
||||
Q_UNUSED(source);
|
||||
return false;
|
||||
}
|
||||
|
||||
void DataEngineScript::setData(const QString& source, const QString& key,
|
||||
const QVariant& value)
|
||||
void DataEngineScript::setData(const QString &source, const QString &key,
|
||||
const QVariant &value)
|
||||
{
|
||||
if (d->dataEngine) {
|
||||
d->dataEngine->setData(source, key, value);
|
||||
@ -78,14 +78,14 @@ void DataEngineScript::setData(const QString &source, const QVariant &value)
|
||||
}
|
||||
}
|
||||
|
||||
void DataEngineScript::removeAllData(const QString& source)
|
||||
void DataEngineScript::removeAllData(const QString &source)
|
||||
{
|
||||
if (d->dataEngine) {
|
||||
d->dataEngine->removeAllData(source);
|
||||
}
|
||||
}
|
||||
|
||||
void DataEngineScript::removeData(const QString& source, const QString& key)
|
||||
void DataEngineScript::removeData(const QString &source, const QString &key)
|
||||
{
|
||||
if (d->dataEngine) {
|
||||
d->dataEngine->removeData(source, key);
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
/**
|
||||
* Returns the Plasma::DataEngine associated with this script component
|
||||
*/
|
||||
DataEngine* dataEngine() const;
|
||||
DataEngine *dataEngine() const;
|
||||
|
||||
/**
|
||||
* Called when the script should create a source that does not currently
|
||||
@ -78,14 +78,14 @@ public:
|
||||
* @return true if the data was changed, or false if there was no
|
||||
* change or if the change will occur later
|
||||
**/
|
||||
virtual bool updateSourceEvent(const QString& source);
|
||||
virtual bool updateSourceEvent(const QString &source);
|
||||
|
||||
protected:
|
||||
void setData(const QString& source, const QString& key,
|
||||
const QVariant& value);
|
||||
void setData(const QString &source, const QString &key,
|
||||
const QVariant &value);
|
||||
void setData(const QString &source, const QVariant &value);
|
||||
void removeAllData(const QString& source);
|
||||
void removeData(const QString& source, const QString& key);
|
||||
void removeAllData(const QString &source);
|
||||
void removeData(const QString &source, const QString &key);
|
||||
void setMaxSourceCount(uint limit);
|
||||
void setMinimumPollingInterval(int minimumMs);
|
||||
int minimumPollingInterval() const;
|
||||
@ -93,7 +93,7 @@ protected:
|
||||
void removeAllSources();
|
||||
|
||||
private:
|
||||
DataEngineScriptPrivate * const d;
|
||||
DataEngineScriptPrivate *const d;
|
||||
};
|
||||
|
||||
#define K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE(libname, classname) \
|
||||
|
@ -28,7 +28,7 @@ namespace Plasma
|
||||
class RunnerScriptPrivate
|
||||
{
|
||||
public:
|
||||
AbstractRunner* runner;
|
||||
AbstractRunner *runner;
|
||||
};
|
||||
|
||||
RunnerScript::RunnerScript(QObject *parent)
|
||||
@ -47,23 +47,23 @@ void RunnerScript::setRunner(AbstractRunner *runner)
|
||||
d->runner = runner;
|
||||
}
|
||||
|
||||
AbstractRunner* RunnerScript::runner() const
|
||||
AbstractRunner *RunnerScript::runner() const
|
||||
{
|
||||
return d->runner;
|
||||
}
|
||||
|
||||
void RunnerScript::match(Plasma::RunnerContext &search)
|
||||
{
|
||||
Q_UNUSED(search)
|
||||
Q_UNUSED(search);
|
||||
}
|
||||
|
||||
void RunnerScript::run(const Plasma::RunnerContext &search, const Plasma::QueryMatch &action)
|
||||
{
|
||||
Q_UNUSED(search)
|
||||
Q_UNUSED(action)
|
||||
Q_UNUSED(search);
|
||||
Q_UNUSED(action);
|
||||
}
|
||||
|
||||
const Package* RunnerScript::package() const
|
||||
const Package *RunnerScript::package() const
|
||||
{
|
||||
return d->runner ? d->runner->package() : 0;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
/**
|
||||
* Returns the Plasma::AbstractRunner associated with this script component
|
||||
*/
|
||||
AbstractRunner* runner() const;
|
||||
AbstractRunner *runner() const;
|
||||
|
||||
/**
|
||||
* Called when the script should create QueryMatch instances through
|
||||
@ -87,10 +87,10 @@ protected:
|
||||
* be used to request resources, such as images and
|
||||
* interface files.
|
||||
*/
|
||||
const Package* package() const;
|
||||
const Package *package() const;
|
||||
|
||||
private:
|
||||
RunnerScriptPrivate * const d;
|
||||
RunnerScriptPrivate *const d;
|
||||
};
|
||||
|
||||
#define K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(libname, classname) \
|
||||
|
@ -52,7 +52,7 @@ bool ScriptEngine::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
const Package* ScriptEngine::package() const
|
||||
const Package *ScriptEngine::package() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -95,7 +95,8 @@ QStringList knownLanguages(ComponentTypes types)
|
||||
}
|
||||
|
||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/ScriptEngine", constraint);
|
||||
//kDebug() << "Applet::knownApplets constraint was '" << constraint << "' which got us " << offers.count() << " matches";
|
||||
//kDebug() << "Applet::knownApplets constraint was '" << constraint
|
||||
// << "' which got us " << offers.count() << " matches";
|
||||
|
||||
QStringList languages;
|
||||
foreach (const KService::Ptr &service, offers) {
|
||||
@ -148,7 +149,7 @@ KService::List engineOffers(const QString &language, ComponentType type)
|
||||
return offers;
|
||||
}
|
||||
|
||||
ScriptEngine* loadEngine(const QString &language, ComponentType type, QObject *parent)
|
||||
ScriptEngine *loadEngine(const QString &language, ComponentType type, QObject *parent)
|
||||
{
|
||||
KService::List offers = engineOffers(language, type);
|
||||
|
||||
@ -176,15 +177,17 @@ ScriptEngine* loadEngine(const QString &language, ComponentType type, QObject *p
|
||||
return engine;
|
||||
}
|
||||
|
||||
kDebug() << "Couldn't load script engine for language " << language << "! error reported: " << error;
|
||||
kDebug() << "Couldn't load script engine for language " << language
|
||||
<< "! error reported: " << error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AppletScript* loadScriptEngine(const QString &language, Applet *applet)
|
||||
AppletScript *loadScriptEngine(const QString &language, Applet *applet)
|
||||
{
|
||||
AppletScript *engine = static_cast<AppletScript*>(loadEngine(language, AppletComponent, applet));
|
||||
AppletScript *engine =
|
||||
static_cast<AppletScript*>(loadEngine(language, AppletComponent, applet));
|
||||
|
||||
if (engine) {
|
||||
engine->setApplet(applet);
|
||||
@ -193,9 +196,10 @@ AppletScript* loadScriptEngine(const QString &language, Applet *applet)
|
||||
return engine;
|
||||
}
|
||||
|
||||
DataEngineScript* loadScriptEngine(const QString &language, DataEngine *dataEngine)
|
||||
DataEngineScript *loadScriptEngine(const QString &language, DataEngine *dataEngine)
|
||||
{
|
||||
DataEngineScript *engine = static_cast<DataEngineScript*>(loadEngine(language, DataEngineComponent, dataEngine));
|
||||
DataEngineScript *engine =
|
||||
static_cast<DataEngineScript*>(loadEngine(language, DataEngineComponent, dataEngine));
|
||||
|
||||
if (engine) {
|
||||
engine->setDataEngine(dataEngine);
|
||||
@ -204,9 +208,10 @@ DataEngineScript* loadScriptEngine(const QString &language, DataEngine *dataEngi
|
||||
return engine;
|
||||
}
|
||||
|
||||
RunnerScript* loadScriptEngine(const QString &language, AbstractRunner *runner)
|
||||
RunnerScript *loadScriptEngine(const QString &language, AbstractRunner *runner)
|
||||
{
|
||||
RunnerScript* engine = static_cast<RunnerScript*>(loadEngine(language, RunnerComponent, runner));
|
||||
RunnerScript *engine =
|
||||
static_cast<RunnerScript*>(loadEngine(language, RunnerComponent, runner));
|
||||
|
||||
if (engine) {
|
||||
engine->setRunner(runner);
|
||||
@ -218,21 +223,21 @@ RunnerScript* loadScriptEngine(const QString &language, AbstractRunner *runner)
|
||||
PackageStructure::Ptr defaultPackageStructure(ComponentType type)
|
||||
{
|
||||
switch (type) {
|
||||
case AppletComponent:
|
||||
return PackageStructure::Ptr(new PlasmoidPackage());
|
||||
break;
|
||||
case RunnerComponent:
|
||||
case DataEngineComponent:
|
||||
{
|
||||
PackageStructure::Ptr structure(new PackageStructure());
|
||||
structure->addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
||||
structure->setRequired("mainscript", true);
|
||||
return structure;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// TODO: we don't have any special structures for other components yet
|
||||
break;
|
||||
case AppletComponent:
|
||||
return PackageStructure::Ptr(new PlasmoidPackage());
|
||||
break;
|
||||
case RunnerComponent:
|
||||
case DataEngineComponent:
|
||||
{
|
||||
PackageStructure::Ptr structure(new PackageStructure());
|
||||
structure->addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
||||
structure->setRequired("mainscript", true);
|
||||
return structure;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// TODO: we don't have any special structures for other components yet
|
||||
break;
|
||||
}
|
||||
|
||||
return PackageStructure::Ptr(new PackageStructure());
|
||||
|
@ -85,10 +85,10 @@ protected:
|
||||
* be used to request resources, such as images and
|
||||
* interface files.
|
||||
*/
|
||||
virtual const Package* package() const;
|
||||
virtual const Package *package() const;
|
||||
|
||||
private:
|
||||
ScriptEnginePrivate * const d;
|
||||
ScriptEnginePrivate *const d;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -106,7 +106,7 @@ PLASMA_EXPORT QStringList knownLanguages(ComponentTypes types);
|
||||
* @return pointer to the AppletScript or 0 on failure; the caller is responsible
|
||||
* for the return object which will be parented to the Applet
|
||||
**/
|
||||
PLASMA_EXPORT AppletScript* loadScriptEngine(const QString &language, Applet *applet);
|
||||
PLASMA_EXPORT AppletScript *loadScriptEngine(const QString &language, Applet *applet);
|
||||
|
||||
/**
|
||||
* Loads an DataEngine script engine for the given language.
|
||||
@ -116,7 +116,7 @@ PLASMA_EXPORT AppletScript* loadScriptEngine(const QString &language, Applet *ap
|
||||
* @return pointer to the DataEngineScript or 0 on failure; the caller is responsible
|
||||
* for the return object which will be parented to the DataEngine
|
||||
**/
|
||||
PLASMA_EXPORT DataEngineScript* loadScriptEngine(const QString &language, DataEngine *dataEngine);
|
||||
PLASMA_EXPORT DataEngineScript *loadScriptEngine(const QString &language, DataEngine *dataEngine);
|
||||
|
||||
/**
|
||||
* Loads an Applet script engine for the given language.
|
||||
@ -126,7 +126,7 @@ PLASMA_EXPORT DataEngineScript* loadScriptEngine(const QString &language, DataEn
|
||||
* @return pointer to the RunnerScript or 0 on failure; the caller is responsible
|
||||
* for the return object which will be parented to the AbstractRunner
|
||||
**/
|
||||
PLASMA_EXPORT RunnerScript* loadScriptEngine(const QString &language, AbstractRunner *runner);
|
||||
PLASMA_EXPORT RunnerScript *loadScriptEngine(const QString &language, AbstractRunner *runner);
|
||||
|
||||
/**
|
||||
* Loads an appropriate PackageStructure for the given language and type
|
||||
|
Loading…
Reference in New Issue
Block a user