create a Package if we have a scripted plasmoid on hand.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=690104
This commit is contained in:
parent
1b6070d807
commit
44fe05f668
33
applet.cpp
33
applet.cpp
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include "plasma/corona.h"
|
#include "plasma/corona.h"
|
||||||
#include "plasma/dataenginemanager.h"
|
#include "plasma/dataenginemanager.h"
|
||||||
|
#include "plasma/package.h"
|
||||||
|
#include "plasma/packages_p.h"
|
||||||
#include "plasma/plasma.h"
|
#include "plasma/plasma.h"
|
||||||
#include "plasma/svg.h"
|
#include "plasma/svg.h"
|
||||||
|
|
||||||
@ -45,12 +47,13 @@ namespace Plasma
|
|||||||
|
|
||||||
class Applet::Private
|
class Applet::Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private( KService::Ptr appletDescription, int uniqueID )
|
Private(KService::Ptr service, int uniqueID)
|
||||||
: appletId( uniqueID ),
|
: appletId(uniqueID),
|
||||||
globalConfig( 0 ),
|
globalConfig(0),
|
||||||
appletConfig( 0 ),
|
appletConfig(0),
|
||||||
appletDescription(appletDescription ? new KPluginInfo(appletDescription) : 0),
|
appletDescription(service ? new KPluginInfo(service) : 0),
|
||||||
|
package(0),
|
||||||
background(0),
|
background(0),
|
||||||
failureText(0),
|
failureText(0),
|
||||||
immutable(false),
|
immutable(false),
|
||||||
@ -64,6 +67,22 @@ class Applet::Private
|
|||||||
if (appletId > s_maxAppletId) {
|
if (appletId > s_maxAppletId) {
|
||||||
s_maxAppletId = appletId;
|
s_maxAppletId = appletId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appletDescription &&
|
||||||
|
!appletDescription->property("X-Plasma-Language").toString().isEmpty()) {
|
||||||
|
QString path = KStandardDirs::locate("appdata",
|
||||||
|
"plasmoids/" +
|
||||||
|
appletDescription->pluginName());
|
||||||
|
if (!path.isEmpty()) {
|
||||||
|
package = new Package(path,
|
||||||
|
appletDescription->pluginName(),
|
||||||
|
PlasmoidStructure());
|
||||||
|
if (!package->isValid()) {
|
||||||
|
delete package;
|
||||||
|
package = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~Private()
|
~Private()
|
||||||
@ -73,6 +92,7 @@ class Applet::Private
|
|||||||
}
|
}
|
||||||
delete appletDescription;
|
delete appletDescription;
|
||||||
delete background;
|
delete background;
|
||||||
|
delete package;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint nextId()
|
static uint nextId()
|
||||||
@ -87,6 +107,7 @@ class Applet::Private
|
|||||||
KSharedConfig::Ptr globalConfig;
|
KSharedConfig::Ptr globalConfig;
|
||||||
KSharedConfig::Ptr appletConfig;
|
KSharedConfig::Ptr appletConfig;
|
||||||
KPluginInfo* appletDescription;
|
KPluginInfo* appletDescription;
|
||||||
|
Package* package;
|
||||||
QList<QObject*> watchedForFocus;
|
QList<QObject*> watchedForFocus;
|
||||||
QStringList loadedEngines;
|
QStringList loadedEngines;
|
||||||
static uint s_maxAppletId;
|
static uint s_maxAppletId;
|
||||||
|
41
packages.h
41
packages.h
@ -1,41 +0,0 @@
|
|||||||
/******************************************************************************
|
|
||||||
* Copyright (C) 2007 by Aaron Seigo <aseigo@kde.org> *
|
|
||||||
* *
|
|
||||||
* This library is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU Library General Public *
|
|
||||||
* License as published by the Free Software Foundation; either *
|
|
||||||
* version 2 of the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This library is distributed in the hope that it will be useful, *
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
||||||
* Library General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU Library General Public License *
|
|
||||||
* along with this library; see the file COPYING.LIB. If not, write to *
|
|
||||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
|
|
||||||
* Boston, MA 02110-1301, USA. *
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef PLASMA_PACKAGES
|
|
||||||
#define PLASMA_PACKAGES
|
|
||||||
|
|
||||||
#include <plasma/packagestructure.h>
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
class PlasmoidStructure : public PackageStructure
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PlasmoidStructure();
|
|
||||||
};
|
|
||||||
|
|
||||||
class ThemePackageStructure : public PackageStructure
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ThemePackageStructure();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user