move workspace/plasma/lib to workspace/lib/plasma so that we can do:

#include <plasma/foo.h>

in headers in libplasma. this is important so that they can be used post-install by third party plugins, apps, etc.

also, changed Applet::loadDataEngine to just Applet::dataEngine and make it actually return the data engine; move the applets to using it. safer and fewer LoC

svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=670850
This commit is contained in:
Aaron J. Seigo 2007-06-02 17:29:39 +00:00
parent 3471f8e078
commit bbaebc6b1b
21 changed files with 47 additions and 43 deletions

View File

@ -48,6 +48,9 @@ install( FILES
plasma_export.h
svg.h
theme.h
DESTINATION ${INCLUDE_INSTALL_DIR}/plasma )
install( FILES
widgets/icon.h
widgets/layout.h
widgets/layoutitem.h
@ -57,7 +60,7 @@ install( FILES
widgets/radiobutton.h
widgets/vboxlayout.h
widgets/widget.h
DESTINATION ${INCLUDE_INSTALL_DIR}/plasma )
DESTINATION ${INCLUDE_INSTALL_DIR}/plasma/widgets )
install( FILES
includes/Applet

View File

@ -22,7 +22,7 @@
#include <QtCore/QObject>
#include <QtCore/QList>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
class KActionCollection;
class QAction;

View File

@ -121,18 +121,20 @@ KConfigGroup Applet::globalAppletConfig() const
return KConfigGroup(d->globalConfig, "General");
}
bool Applet::loadDataEngine( const QString& name )
DataEngine* Applet::dataEngine(const QString& name)
{
if ( d->loadedEngines.indexOf( name ) != -1 ) {
return true;
int index = d->loadedEngines.indexOf(name);
if (index != -1) {
return DataEngineManager::self()->dataEngine(name);
}
if ( DataEngineManager::self()->loadDataEngine( name ) ) {
d->loadedEngines.append( name );
return true;
DataEngine* engine = DataEngineManager::self()->loadDataEngine(name);
if (engine) {
d->loadedEngines.append(name);
return engine;
}
return false;
return 0;
}
void Applet::constraintsUpdated()

View File

@ -26,11 +26,13 @@
#include <KSharedConfig>
#include <KGenericFactory>
#include <plasma.h>
#include <dataengine.h>
#include <plasma/plasma.h>
namespace Plasma
{
class DataEngine;
/**
* @short The base Applet (Plasmoid) class
*
@ -92,7 +94,7 @@ class PLASMA_EXPORT Applet : public QObject, public QGraphicsItemGroup
*
* @return returns true on success, false on failure
*/
bool loadDataEngine( const QString& name );
DataEngine* dataEngine(const QString& name);
/**
* called when any of the geometry constraints have been updated

View File

@ -4,7 +4,7 @@
#include <QLayout>
#include <QSize>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
class QLayoutItem;
class QRect;

View File

@ -23,7 +23,7 @@
#include "applet.h"
#include "plasma.h"
#include "plasma_export.h"
#include "plasma/plasma_export.h"
namespace Plasma
{

View File

@ -26,7 +26,7 @@
#include <KGenericFactory>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
namespace Plasma
{

View File

@ -20,7 +20,7 @@
#define PLASMA_ENGINE_MANAGER_H
#include <QtCore/QHash>
#include "dataengine.h"
#include "plasma/dataengine.h"
namespace Plasma
{

View File

@ -22,8 +22,8 @@
#include <QtCore/QHash>
#include <QtCore/QObject>
#include <plasma_export.h>
#include <dataengine.h>
#include <plasma/plasma_export.h>
#include <plasma/dataengine.h>
namespace Plasma
{

View File

@ -19,7 +19,7 @@
#ifndef PLASMA_DEFS_H
#define PLASMA_DEFS_H
#include <plasma_export.h>
#include <plasma/plasma_export.h>
/**
* Namespace for everything in libplasma

2
svg.h
View File

@ -21,7 +21,7 @@
#include <QtCore/QObject>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
class QPainter;
class QPoint;

View File

@ -21,7 +21,7 @@
#include <QtCore/QObject>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
namespace Plasma
{

View File

@ -22,9 +22,9 @@
#include <QtCore/QObject>
#include <QtGui/QGraphicsItem>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
#include <dataengine.h>
#include <plasma/dataengine.h>
//TODO
//Please Document this class

View File

@ -22,9 +22,9 @@
#include <QtCore/QObject>
#include <QtGui/QGraphicsTextItem>
#include <widgets/layoutitem.h>
#include <dataengine.h>
#include <plasma_export.h>
#include <plasma/dataengine.h>
#include <plasma/plasma_export.h>
#include <plasma/widgets/layoutitem.h>
//TODO
//Please Document this class

View File

@ -22,9 +22,8 @@
#include <QtCore/QRectF>
#include <QtCore/QSizeF>
#include <plasma_export.h>
#include "layoutitem.h"
#include <plasma/widgets/layoutitem.h>
#include <plasma/plasma_export.h>
namespace Plasma
{

View File

@ -22,7 +22,7 @@
#include <QtCore/QRectF>
#include <QtCore/QSizeF>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
namespace Plasma
{

View File

@ -22,10 +22,10 @@
#include <QtCore/QObject>
#include <QtGui/QGraphicsTextItem>
#include <plasma_export.h>
#include <plasma/plasma_export.h>
#include <dataengine.h>
#include <widgets/layoutitem.h>
#include <plasma/dataengine.h>
#include <plasma/widgets/layoutitem.h>
namespace Plasma
{

View File

@ -23,8 +23,8 @@
#include <QtGui/QGraphicsTextItem>
#include <QtGui/QLayoutItem>
#include <dataengine.h>
#include <plasma_export.h>
#include <plasma/dataengine.h>
#include <plasma/plasma_export.h>
//TODO
//Please Document this class

View File

@ -24,9 +24,9 @@
#include <QtGui/QGraphicsItem>
// KDE includes
#include <plasma_export.h>
#include <plasma/plasma_export.h>
#include <dataengine.h>
#include <plasma/dataengine.h>
namespace Plasma
{

View File

@ -22,9 +22,8 @@
#include <QtCore/QRectF>
#include <QtCore/QSizeF>
#include <plasma_export.h>
#include "layout.h"
#include <plasma/plasma_export.h>
#include <plasma/widgets/layout.h>
namespace Plasma
{

View File

@ -25,9 +25,8 @@
#include <QtCore/QRectF>
#include <QtCore/QSizeF>
#include <plasma_export.h>
#include "layoutitem.h"
#include <plasma/widgets/layoutitem.h>
#include <plasma/plasma_export.h>
namespace Plasma
{