remove the args Applet injects to hide that impl detail from subclasses

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=812568
This commit is contained in:
Aaron J. Seigo 2008-05-25 18:38:07 +00:00
parent f478ae1ca4
commit 05d6ec6401
7 changed files with 67 additions and 59 deletions

View File

@ -177,65 +177,61 @@ install(FILES
install(FILES install(FILES
includes/AbstractRunner includes/AbstractRunner
includes/AnimationDriver includes/AnimationDriver
includes/Animator includes/Animator
includes/Applet includes/Applet
includes/AppletBrowser includes/AppletBrowser
includes/ConfigXml includes/AppletScript
includes/Corona includes/CheckBox
includes/Containment includes/ComboBox
includes/Dialog includes/ConfigXml
includes/Plasma includes/Containment
includes/Package includes/Corona
includes/PackageStructure includes/DataContainer
includes/Theme includes/DataEngine
includes/DataContainer includes/DataEngineManager
includes/DataEngine includes/DataEngineScript
includes/DataEngineManager includes/Delegate
includes/RunnerContext includes/Dialog
includes/RunnerManager includes/GroupBox
includes/QueryMatch includes/Label
includes/Service includes/LineEdit
includes/ServiceJob includes/Package
includes/Svg includes/PackageMetadata
includes/PanelSvg includes/PackageStructure
includes/UiLoader includes/PanelSvg
includes/PackageMetadata includes/Plasma
includes/View includes/PushButton
includes/Delegate includes/QueryMatch
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma) includes/RadioButton
includes/RunnerContext
install(FILES includes/RunnerManager
includes/Label includes/RunnerScript
includes/LineEdit includes/ScriptEngine
includes/PushButton includes/Service
includes/RadioButton includes/ServiceJob
includes/WebContent includes/Svg
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma) includes/TextEdit
includes/Theme
includes/UiLoader
includes/View
includes/WebContent
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma)
if(QT_QTOPENGL_FOUND AND OPENGL_FOUND) if(QT_QTOPENGL_FOUND AND OPENGL_FOUND)
install(FILES install(FILES
includes/GLApplet includes/GLApplet
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma) DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma)
endif(QT_QTOPENGL_FOUND AND OPENGL_FOUND) endif(QT_QTOPENGL_FOUND AND OPENGL_FOUND)
install(FILES install(FILES
includes/ScriptEngine servicetypes/plasma-animator.desktop
includes/DataEngineScript servicetypes/plasma-applet.desktop
includes/RunnerScript servicetypes/plasma-containment.desktop
includes/AppletScript servicetypes/plasma-dataengine.desktop
DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma/Scripting) servicetypes/plasma-packagestructure.desktop
servicetypes/plasma-runner.desktop
install(FILES
servicetypes/plasma-animator.desktop
servicetypes/plasma-applet.desktop
servicetypes/plasma-containment.desktop
servicetypes/plasma-dataengine.desktop
servicetypes/plasma-packagestructure.desktop
servicetypes/plasma-runner.desktop
servicetypes/plasma-scriptengine.desktop servicetypes/plasma-scriptengine.desktop
DESTINATION ${SERVICETYPES_INSTALL_DIR}) DESTINATION ${SERVICETYPES_INSTALL_DIR})

View File

@ -94,6 +94,18 @@ Applet::Applet(QObject* parentObject, const QVariantList& args)
d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString()), d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0].toString() : QString()),
args.count() > 1 ? args[1].toInt() : 0, this)) args.count() > 1 ? args[1].toInt() : 0, this))
{ {
// now remove those first two items since those are managed by Applet and subclasses shouldn't
// need to worry about them. yes, it violates the constness of this var, but it lets us add
// or remove items later while applets can just pretend that their args always start at 0
QVariantList &mutableArgs = const_cast<QVariantList&>(args);
if (!mutableArgs.isEmpty()) {
mutableArgs.removeFirst();
if (!mutableArgs.isEmpty()) {
mutableArgs.removeFirst();
}
}
setParent(parentObject); setParent(parentObject);
// WARNING: do not access config() OR globalConfig() in this method! // WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point // that requires a scene, which is not available at this point

View File

@ -1 +1 @@
#include "../../../plasma/scripting/appletscript.h" #include "../../plasma/scripting/appletscript.h"

View File

@ -1 +1 @@
#include "../../../plasma/scripting/dataenginescript.h" #include "../../plasma/scripting/dataenginescript.h"

View File

@ -1 +1 @@
#include "../../../plasma/widgets/pushbutton.h" #include "../../plasma/widgets/pushbutton.h"

View File

@ -1 +1 @@
#include "../../../plasma/scripting/runnerscript.h" #include "../../plasma/scripting/runnerscript.h"

View File

@ -1 +1 @@
#include "../../../plasma/scripting/scriptengine.h" #include "../../plasma/scripting/scriptengine.h"