Fix build after bad merge, by restoring these files to their frameworks version.
Aseigo told me to use "git checkout --theirs applet.h" in order to "take the 4.10 version of the changes where there were conflicts", but it turns out that this was very bad advice: it loses ALL the changes ever made to the file in the frameworks branch. CCMAIL: aseigo@kde.org
This commit is contained in:
parent
bdb7251250
commit
d9b054b3bc
342
applet.h
342
applet.h
@ -22,26 +22,22 @@
|
|||||||
#ifndef PLASMA_APPLET_H
|
#ifndef PLASMA_APPLET_H
|
||||||
#define PLASMA_APPLET_H
|
#define PLASMA_APPLET_H
|
||||||
|
|
||||||
#include <QtGui/QGraphicsItem>
|
#include <QObject>
|
||||||
#include <QtGui/QGraphicsWidget>
|
#include <QIcon>
|
||||||
#include <QtGui/QIcon>
|
|
||||||
|
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
#include <kgenericfactory.h>
|
|
||||||
#include <kplugininfo.h>
|
#include <kplugininfo.h>
|
||||||
#include <kshortcut.h>
|
#include <kshortcut.h>
|
||||||
|
#include <kurl.h>
|
||||||
|
|
||||||
#include <plasma/configloader.h>
|
#include <plasma/configloader.h>
|
||||||
#include <plasma/packagestructure.h>
|
|
||||||
#include <plasma/plasma.h>
|
#include <plasma/plasma.h>
|
||||||
#include <plasma/animator.h>
|
|
||||||
#include <plasma/version.h>
|
#include <plasma/version.h>
|
||||||
#include <plasma/framesvg.h>
|
#include <plasma/framesvg.h>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
class KConfigDialog;
|
class KConfigDialog;
|
||||||
class QGraphicsView;
|
|
||||||
class KActionCollection;
|
class KActionCollection;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
@ -49,10 +45,7 @@ namespace Plasma
|
|||||||
|
|
||||||
class AppletPrivate;
|
class AppletPrivate;
|
||||||
class Containment;
|
class Containment;
|
||||||
class Context;
|
|
||||||
class DataEngine;
|
class DataEngine;
|
||||||
class Extender;
|
|
||||||
class ExtenderItem;
|
|
||||||
class Package;
|
class Package;
|
||||||
|
|
||||||
|
|
||||||
@ -74,50 +67,28 @@ class Package;
|
|||||||
*
|
*
|
||||||
* See techbase.kde.org for tutorials on writing Applets using this class.
|
* See techbase.kde.org for tutorials on writing Applets using this class.
|
||||||
*/
|
*/
|
||||||
class PLASMA_EXPORT Applet : public QGraphicsWidget
|
class PLASMA_EXPORT Applet : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool hasConfigurationInterface READ hasConfigurationInterface)
|
Q_PROPERTY(bool hasConfigurationInterface READ hasConfigurationInterface)
|
||||||
Q_PROPERTY(QString name READ name CONSTANT)
|
Q_PROPERTY(QString name READ name WRITE setName)
|
||||||
Q_PROPERTY(QString pluginName READ pluginName CONSTANT)
|
Q_PROPERTY(QString pluginName READ pluginName)
|
||||||
Q_PROPERTY(QString category READ category CONSTANT)
|
Q_PROPERTY(QString category READ category)
|
||||||
Q_PROPERTY(ImmutabilityType immutability READ immutability WRITE setImmutability)
|
Q_PROPERTY(ImmutabilityType immutability READ immutability WRITE setImmutability)
|
||||||
Q_PROPERTY(bool hasFailedToLaunch READ hasFailedToLaunch WRITE setFailedToLaunch)
|
Q_PROPERTY(bool hasFailedToLaunch READ hasFailedToLaunch WRITE setFailedToLaunch)
|
||||||
Q_PROPERTY(bool isBusy READ isBusy WRITE setBusy) //KDE5: remove
|
|
||||||
Q_PROPERTY(bool busy READ isBusy WRITE setBusy)
|
Q_PROPERTY(bool busy READ isBusy WRITE setBusy)
|
||||||
Q_PROPERTY(bool configurationRequired READ configurationRequired WRITE setConfigurationRequired)
|
Q_PROPERTY(bool configurationRequired READ configurationRequired WRITE setConfigurationRequired)
|
||||||
Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry)
|
|
||||||
Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources)
|
Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources)
|
||||||
Q_PROPERTY(uint id READ id CONSTANT)
|
Q_PROPERTY(uint id READ id)
|
||||||
Q_PROPERTY(bool userConfiguring READ isUserConfiguring)
|
|
||||||
Q_PROPERTY(BackgroundHints backgroundHints READ backgroundHints WRITE setBackgroundHints)
|
Q_PROPERTY(BackgroundHints backgroundHints READ backgroundHints WRITE setBackgroundHints)
|
||||||
Q_ENUMS(BackgroundHints)
|
Q_PROPERTY(bool userConfiguring READ isUserConfiguring)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef QList<Applet*> List;
|
typedef QList<Applet*> List;
|
||||||
typedef QHash<QString, Applet*> Dict;
|
typedef QHash<QString, Applet*> Dict;
|
||||||
|
|
||||||
/**
|
|
||||||
* Description on how draw a background for the applet
|
|
||||||
*/
|
|
||||||
enum BackgroundHint {
|
|
||||||
NoBackground = 0, /**< Not drawing a background under the
|
|
||||||
applet, the applet has its own implementation */
|
|
||||||
StandardBackground = 1, /**< The standard background from the theme is drawn */
|
|
||||||
TranslucentBackground = 2, /**< An alternate version of the background is drawn,
|
|
||||||
usually more translucent */
|
|
||||||
DefaultBackground = StandardBackground /**< Default settings:
|
|
||||||
both standard background */
|
|
||||||
};
|
|
||||||
Q_DECLARE_FLAGS(BackgroundHints, BackgroundHint)
|
|
||||||
|
|
||||||
~Applet();
|
~Applet();
|
||||||
|
|
||||||
/**
|
|
||||||
* @return a package structure representing an Applet
|
|
||||||
*/
|
|
||||||
static PackageStructure::Ptr packageStructure();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the id of this applet
|
* @return the id of this applet
|
||||||
*/
|
*/
|
||||||
@ -132,15 +103,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
**/
|
**/
|
||||||
KConfigGroup config() const;
|
KConfigGroup config() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a config group with the name provided. This ensures
|
|
||||||
* that the group name is properly namespaced to avoid collision
|
|
||||||
* with other applets that may be sharing this config file
|
|
||||||
*
|
|
||||||
* @param group the name of the group to access
|
|
||||||
**/
|
|
||||||
KConfigGroup config(const QString &group) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves state information about this applet that will
|
* Saves state information about this applet that will
|
||||||
* be accessed when next instantiated in the restore(KConfigGroup&) method.
|
* be accessed when next instantiated in the restore(KConfigGroup&) method.
|
||||||
@ -205,29 +167,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*
|
*
|
||||||
* @return the Package object, or 0 if none
|
* @return the Package object, or 0 if none
|
||||||
**/
|
**/
|
||||||
const Package *package() const;
|
Package package() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the view this widget is visible on, or 0 if none can be found.
|
|
||||||
* @warning do NOT assume this will always return a view!
|
|
||||||
* a null view probably means that either plasma isn't finished loading, or your applet is
|
|
||||||
* on an activity that's not being shown anywhere.
|
|
||||||
*/
|
|
||||||
QGraphicsView *view() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maps a QRect from a view's coordinates to local coordinates.
|
|
||||||
* @param view the view from which rect should be mapped
|
|
||||||
* @param rect the rect to be mapped
|
|
||||||
*/
|
|
||||||
QRectF mapFromView(const QGraphicsView *view, const QRect &rect) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maps a QRectF from local coordinates to a view's coordinates.
|
|
||||||
* @param view the view to which rect should be mapped
|
|
||||||
* @param rect the rect to be mapped
|
|
||||||
*/
|
|
||||||
QRect mapToView(const QGraphicsView *view, const QRectF &rect) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reccomended position for a popup window like a menu or a tooltip
|
* Reccomended position for a popup window like a menu or a tooltip
|
||||||
@ -270,11 +210,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
virtual Location location() const;
|
virtual Location location() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the workspace context which the applet is operating in
|
|
||||||
*/
|
|
||||||
Context *context() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the preferred aspect ratio mode for placement and resizing
|
* @return the preferred aspect ratio mode for placement and resizing
|
||||||
*/
|
*/
|
||||||
@ -310,7 +245,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*
|
*
|
||||||
* @return list of applets
|
* @return list of applets
|
||||||
**/
|
**/
|
||||||
static KPluginInfo::List listAppletInfoForMimetype(const QString &mimetype);
|
static KPluginInfo::List listAppletInfoForMimeType(const QString &mimetype);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of all known applets associated with a certain URL.
|
* Returns a list of all known applets associated with a certain URL.
|
||||||
@ -365,38 +300,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
static Applet *loadPlasmoid(const QString &path, uint appletId = 0,
|
static Applet *loadPlasmoid(const QString &path, uint appletId = 0,
|
||||||
const QVariantList &args = QVariantList());
|
const QVariantList &args = QVariantList());
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempts to load an applet
|
|
||||||
*
|
|
||||||
* Returns a pointer to the applet if successful.
|
|
||||||
* The caller takes responsibility for the applet, including
|
|
||||||
* deleting it when no longer needed.
|
|
||||||
*
|
|
||||||
* @param name the plugin name, as returned by KPluginInfo::pluginName()
|
|
||||||
* @param appletId unique ID to assign the applet, or zero to have one
|
|
||||||
* assigned automatically.
|
|
||||||
* @param args to send the applet extra arguments
|
|
||||||
* @return a pointer to the loaded applet, or 0 on load failure
|
|
||||||
**/
|
|
||||||
static Applet *load(const QString &name, uint appletId = 0,
|
|
||||||
const QVariantList &args = QVariantList());
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempts to load an applet
|
|
||||||
*
|
|
||||||
* Returns a pointer to the applet if successful.
|
|
||||||
* The caller takes responsibility for the applet, including
|
|
||||||
* deleting it when no longer needed.
|
|
||||||
*
|
|
||||||
* @param info KPluginInfo object for the desired applet
|
|
||||||
* @param appletId unique ID to assign the applet, or zero to have one
|
|
||||||
* assigned automatically.
|
|
||||||
* @param args to send the applet extra arguments
|
|
||||||
* @return a pointer to the loaded applet, or 0 on load failure
|
|
||||||
**/
|
|
||||||
static Applet *load(const KPluginInfo &info, uint appletId = 0,
|
|
||||||
const QVariantList &args = QVariantList());
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the category of the given applet
|
* Get the category of the given applet
|
||||||
*
|
*
|
||||||
@ -411,26 +314,20 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
static QString category(const QString &appletName);
|
static QString category(const QString &appletName);
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called when the interface should be painted.
|
|
||||||
*
|
|
||||||
* @param painter the QPainter to use to do the paintiner
|
|
||||||
* @param option the style options object
|
|
||||||
* @param contentsRect the rect to paint within; automatically adjusted for
|
|
||||||
* the background, if any
|
|
||||||
**/
|
|
||||||
virtual void paintInterface(QPainter *painter,
|
|
||||||
const QStyleOptionGraphicsItem *option,
|
|
||||||
const QRect &contentsRect);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the user-visible name for the applet, as specified in the
|
* Returns the user-visible name for the applet, as specified in the
|
||||||
* .desktop file.
|
* .desktop file. Can be changed with @see setName
|
||||||
*
|
*
|
||||||
* @return the user-visible name for the applet.
|
* @return the user-visible name for the applet.
|
||||||
**/
|
**/
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a custom name for this instance of the applet. E.g. a clock might
|
||||||
|
* use the timezone as its name rather than the .desktop file
|
||||||
|
*/
|
||||||
|
void setName(const QString &name) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the font currently set for this widget
|
* @return the font currently set for this widget
|
||||||
**/
|
**/
|
||||||
@ -465,9 +362,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
ImmutabilityType immutability() const;
|
ImmutabilityType immutability() const;
|
||||||
|
|
||||||
void paintWindowFrame(QPainter *painter,
|
|
||||||
const QStyleOptionGraphicsItem *option, QWidget *widget);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If for some reason, the applet fails to get up on its feet (the
|
* If for some reason, the applet fails to get up on its feet (the
|
||||||
* library couldn't be loaded, necessary hardware support wasn't found,
|
* library couldn't be loaded, necessary hardware support wasn't found,
|
||||||
@ -517,38 +411,19 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*
|
*
|
||||||
* @param hints the BackgroundHint combination for this applet
|
* @param hints the BackgroundHint combination for this applet
|
||||||
*/
|
*/
|
||||||
void setBackgroundHints(const BackgroundHints hints);
|
void setBackgroundHints(const Plasma::BackgroundHints hint);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return BackgroundHints flags combination telling if the standard background is shown
|
* @return BackgroundHints flags combination telling if the standard background is shown
|
||||||
* and if it has a drop shadow
|
* and if it has a drop shadow
|
||||||
*/
|
*/
|
||||||
BackgroundHints backgroundHints() const;
|
Plasma::BackgroundHints backgroundHints() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if this Applet is currently being used as a Containment, false otherwise
|
* @return true if this Applet is currently being used as a Containment, false otherwise
|
||||||
*/
|
*/
|
||||||
bool isContainment() const;
|
bool isContainment() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* This method returns screen coordinates for the widget; this method can be somewhat
|
|
||||||
* expensive and should ONLY be called when screen coordinates are required. For
|
|
||||||
* example when positioning top level widgets on top of the view to create the
|
|
||||||
* appearance of unit. This should NOT be used for popups (@see popupPosition) or
|
|
||||||
* for normal widget use (use Plasma:: widgets or QGraphicsProxyWidget instead).
|
|
||||||
*
|
|
||||||
* @return a rect of the applet in screen coordinates.
|
|
||||||
*/
|
|
||||||
QRect screenRect() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
**/
|
|
||||||
int type() const;
|
|
||||||
enum {
|
|
||||||
Type = Plasma::AppletType
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the Containment, if any, this applet belongs to
|
* @return the Containment, if any, this applet belongs to
|
||||||
**/
|
**/
|
||||||
@ -585,46 +460,25 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
virtual void removeAssociatedWidget(QWidget *widget);
|
virtual void removeAssociatedWidget(QWidget *widget);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets called when an extender item has to be initialized after a plasma restart. If you
|
* @param parent the QObject this applet is parented to
|
||||||
* create ExtenderItems in your applet, you should implement this function to again create
|
|
||||||
* the widget that should be shown in this extender item. This function might look something
|
|
||||||
* like this:
|
|
||||||
*
|
|
||||||
* @code
|
|
||||||
* SuperCoolWidget *widget = new SuperCoolWidget();
|
|
||||||
* dataEngine("engine")->connectSource(item->config("dataSourceName"), widget);
|
|
||||||
* item->setWidget(widget);
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* You can also add one or more custom qactions to this extender item in this function.
|
|
||||||
*
|
|
||||||
* Note that by default, not all ExtenderItems are persistent. Only items that are detached,
|
|
||||||
* will have their configuration stored when plasma exits.
|
|
||||||
*/
|
|
||||||
virtual void initExtenderItem(ExtenderItem *item);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param parent the QGraphicsItem this applet is parented to
|
|
||||||
* @param serviceId the name of the .desktop file containing the
|
* @param serviceId the name of the .desktop file containing the
|
||||||
* information about the widget
|
* information about the widget
|
||||||
* @param appletId a unique id used to differentiate between multiple
|
* @param appletId a unique id used to differentiate between multiple
|
||||||
* instances of the same Applet type
|
* instances of the same Applet type
|
||||||
*/
|
*/
|
||||||
explicit Applet(QGraphicsItem *parent = 0,
|
explicit Applet(QObject *parent = 0, const QString &serviceId = QString(), uint appletId = 0);
|
||||||
const QString &serviceId = QString(),
|
|
||||||
uint appletId = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent the QGraphicsItem this applet is parented to
|
* @param parent the QObject this applet is parented to
|
||||||
* @param info the plugin information object for this Applet
|
* @param info the plugin information object for this Applet
|
||||||
* @param appletId a unique id used to differentiate between multiple
|
* @param appletId a unique id used to differentiate between multiple
|
||||||
* instances of the same Applet type
|
* instances of the same Applet type
|
||||||
* @since 4.6
|
* @since 4.6
|
||||||
*/
|
*/
|
||||||
explicit Applet(const KPluginInfo &info, QGraphicsItem *parent = 0, uint appletId = 0);
|
explicit Applet(const KPluginInfo &info, QObject *parent = 0, uint appletId = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent the QGraphicsItem this applet is parented to
|
* @param parent the QObject this applet is parented to
|
||||||
* @param serviceId the name of the .desktop file containing the
|
* @param serviceId the name of the .desktop file containing the
|
||||||
* information about the widget
|
* information about the widget
|
||||||
* @param appletId a unique id used to differentiate between multiple
|
* @param appletId a unique id used to differentiate between multiple
|
||||||
@ -633,10 +487,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
* and the applet id
|
* and the applet id
|
||||||
* @since 4.3
|
* @since 4.3
|
||||||
*/
|
*/
|
||||||
explicit Applet(QGraphicsItem *parent,
|
explicit Applet(QObject *parent, const QString &serviceId, uint appletId, const QVariantList &args);
|
||||||
const QString &serviceId,
|
|
||||||
uint appletId,
|
|
||||||
const QVariantList &args);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -697,7 +548,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*
|
*
|
||||||
* @param urls
|
* @param urls
|
||||||
*/
|
*/
|
||||||
void setAssociatedApplicationUrls(const KUrl::List &urls);
|
void setAssociatedApplicationUrls(const QList<QUrl> &urls);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the application associated to this applet
|
* @return the application associated to this applet
|
||||||
@ -709,7 +560,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
* @return the urls associated to this applet
|
* @return the urls associated to this applet
|
||||||
* @since 4.4
|
* @since 4.4
|
||||||
*/
|
*/
|
||||||
KUrl::List associatedApplicationUrls() const;
|
QList<QUrl> associatedApplicationUrls() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the applet has a valid associated application or urls
|
* @return true if the applet has a valid associated application or urls
|
||||||
@ -726,18 +577,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
void releaseVisualFocus();
|
void releaseVisualFocus();
|
||||||
|
|
||||||
#if QT_VERSION >= 0x040700
|
|
||||||
protected:
|
|
||||||
void geometryChanged(); // in QGraphicsWidget now; preserve BC
|
|
||||||
#else
|
|
||||||
/**
|
|
||||||
* Emitted whenever the applet makes a geometry change, so that views
|
|
||||||
* can coordinate themselves with these changes if they desire.
|
|
||||||
*/
|
|
||||||
void geometryChanged();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the user completes a transformation of the applet.
|
* Emitted when the user completes a transformation of the applet.
|
||||||
*/
|
*/
|
||||||
@ -748,11 +587,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
void appletTransformedItself();
|
void appletTransformedItself();
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted by Applet subclasses when they change a sizeHint and wants to announce the change
|
|
||||||
*/
|
|
||||||
void sizeHintChanged(Qt::SizeHint which);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when an applet has changed values in its configuration
|
* Emitted when an applet has changed values in its configuration
|
||||||
* and wishes for them to be saved at the next save point. As this implies
|
* and wishes for them to be saved at the next save point. As this implies
|
||||||
@ -781,7 +615,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
/**
|
/**
|
||||||
* Emitted when the applet is deleted
|
* Emitted when the applet is deleted
|
||||||
*/
|
*/
|
||||||
void appletDestroyed(Plasma::Applet *applet);
|
void appletDeleted(Plasma::Applet *applet);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the applet status changes
|
* Emitted when the applet status changes
|
||||||
@ -789,11 +623,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
void newStatus(Plasma::ItemStatus status);
|
void newStatus(Plasma::ItemStatus status);
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted when an ExtenderItem in a scripting applet needs to be initialized
|
|
||||||
*/
|
|
||||||
void extenderItemRestored(Plasma::ExtenderItem *item);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the immutability changes
|
* Emitted when the immutability changes
|
||||||
* @since 4.4
|
* @since 4.4
|
||||||
@ -845,16 +674,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
bool isUserConfiguring() const;
|
bool isUserConfiguring() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Causes this applet to raise above all other applets.
|
|
||||||
*/
|
|
||||||
void raise();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Causes this applet to lower below all the other applets.
|
|
||||||
*/
|
|
||||||
void lower();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends all pending contraints updates to the applet. Will usually
|
* Sends all pending contraints updates to the applet. Will usually
|
||||||
* be called automatically, but can also be called manually if needed.
|
* be called automatically, but can also be called manually if needed.
|
||||||
@ -863,7 +682,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called once the applet is loaded and added to a Corona.
|
* This method is called once the applet is loaded and added to a Corona.
|
||||||
* If the applet requires a QGraphicsScene or has an particularly intensive
|
* If the applet requires a Scene or has an particularly intensive
|
||||||
* set of initialization routines to go through, consider implementing it
|
* set of initialization routines to go through, consider implementing it
|
||||||
* in this method instead of the constructor.
|
* in this method instead of the constructor.
|
||||||
*
|
*
|
||||||
@ -924,6 +743,9 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
void runAssociatedApplication();
|
void runAssociatedApplication();
|
||||||
|
|
||||||
|
bool hasFocus() const;
|
||||||
|
void setFocus(Qt::FocusReason);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* This constructor is to be used with the plugin loading systems
|
* This constructor is to be used with the plugin loading systems
|
||||||
@ -1022,84 +844,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
virtual void constraintsEvent(Plasma::Constraints constraints);
|
virtual void constraintsEvent(Plasma::Constraints constraints);
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the widgets that manage mouse clicks but you still want
|
|
||||||
* to be able to drag the applet around when holding the mouse pointer
|
|
||||||
* on that widget.
|
|
||||||
*
|
|
||||||
* Calling this results in an eventFilter being places on the widget.
|
|
||||||
*
|
|
||||||
* @param item the item to watch for mouse move
|
|
||||||
*/
|
|
||||||
void registerAsDragHandle(QGraphicsItem *item);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unregister a widget registered with registerAsDragHandle.
|
|
||||||
*
|
|
||||||
* @param item the item to unregister
|
|
||||||
*/
|
|
||||||
void unregisterAsDragHandle(QGraphicsItem *item);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param item the item to look for if it is registered or not
|
|
||||||
* @return true if it is registered, false otherwise
|
|
||||||
*/
|
|
||||||
bool isRegisteredAsDragHandle(QGraphicsItem *item);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the extender of this applet.
|
|
||||||
*/
|
|
||||||
Extender *extender() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal event filter; used for focus watching
|
|
||||||
**/
|
|
||||||
bool eventFilter(QObject *o, QEvent *e);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal scene event filter; used to manage applet dragging
|
|
||||||
*/
|
|
||||||
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal manage the mouse movement to drag the applet around
|
|
||||||
*/
|
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
*/
|
|
||||||
void focusInEvent(QFocusEvent *event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
*/
|
|
||||||
void resizeEvent(QGraphicsSceneResizeEvent *event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
*/
|
|
||||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
*/
|
|
||||||
QPainterPath shape() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsLayoutItem
|
|
||||||
*/
|
|
||||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsLayoutItem
|
|
||||||
*/
|
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsLayoutItem
|
|
||||||
*/
|
|
||||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented from QObject
|
* Reimplemented from QObject
|
||||||
@ -1118,23 +862,12 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
Applet(const QString &packagePath, uint appletId, const QVariantList &args);
|
Applet(const QString &packagePath, uint appletId, const QVariantList &args);
|
||||||
|
|
||||||
Q_PRIVATE_SLOT(d, void setFocus())
|
|
||||||
Q_PRIVATE_SLOT(d, void themeChanged())
|
|
||||||
Q_PRIVATE_SLOT(d, void cleanUpAndDelete())
|
Q_PRIVATE_SLOT(d, void cleanUpAndDelete())
|
||||||
Q_PRIVATE_SLOT(d, void selectItemToDestroy())
|
|
||||||
Q_PRIVATE_SLOT(d, void updateRect(const QRectF& rect))
|
|
||||||
Q_PRIVATE_SLOT(d, void destroyMessageOverlay())
|
|
||||||
Q_PRIVATE_SLOT(d, void configDialogFinished())
|
Q_PRIVATE_SLOT(d, void configDialogFinished())
|
||||||
Q_PRIVATE_SLOT(d, void updateShortcuts())
|
Q_PRIVATE_SLOT(d, void updateShortcuts())
|
||||||
Q_PRIVATE_SLOT(d, void publishCheckboxStateChanged(int state))
|
Q_PRIVATE_SLOT(d, void publishCheckboxStateChanged(int state))
|
||||||
Q_PRIVATE_SLOT(d, void globalShortcutChanged())
|
Q_PRIVATE_SLOT(d, void globalShortcutChanged())
|
||||||
Q_PRIVATE_SLOT(d, void propagateConfigChanged())
|
Q_PRIVATE_SLOT(d, void propagateConfigChanged())
|
||||||
Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsItem
|
|
||||||
**/
|
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
||||||
|
|
||||||
AppletPrivate *const d;
|
AppletPrivate *const d;
|
||||||
|
|
||||||
@ -1147,22 +880,15 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
friend class AppletHandle;
|
friend class AppletHandle;
|
||||||
friend class AppletPrivate;
|
friend class AppletPrivate;
|
||||||
friend class AccessAppletJobPrivate;
|
friend class AccessAppletJobPrivate;
|
||||||
|
friend class GraphicsViewAppletPrivate;
|
||||||
friend class PluginLoader;
|
friend class PluginLoader;
|
||||||
friend class PopupApplet;
|
friend class PopupApplet;
|
||||||
friend class PopupAppletPrivate;
|
friend class PopupAppletPrivate;
|
||||||
friend class AssociatedApplicationManager;
|
friend class AssociatedApplicationManager;
|
||||||
|
|
||||||
friend class Extender;
|
|
||||||
friend class ExtenderGroup;
|
|
||||||
friend class ExtenderGroupPrivate;
|
|
||||||
friend class ExtenderPrivate;
|
|
||||||
friend class ExtenderItem;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Applet::BackgroundHints)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an applet when it is contained in a loadable module
|
* Register an applet when it is contained in a loadable module
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Copyright 2007 by Aaron Seigo <aseigo@kde.org> *
|
* Copyright 2011 by Aaron Seigo <aseigo@kde.org> *
|
||||||
* *
|
* *
|
||||||
* This library is free software; you can redistribute it and/or *
|
* This library is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Library General Public *
|
* modify it under the terms of the GNU Library General Public *
|
||||||
@ -18,652 +18,44 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include "packagestructure.h"
|
#include "packagestructure.h"
|
||||||
|
#include "private/package_p.h"
|
||||||
#include "config-plasma.h"
|
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
#include <QMap>
|
|
||||||
#include <QMutableListIterator>
|
|
||||||
#include <QFileInfo>
|
|
||||||
|
|
||||||
#include <kconfiggroup.h>
|
|
||||||
#include <kdebug.h>
|
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
#include <kio/job.h>
|
|
||||||
#endif
|
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kstandarddirs.h>
|
|
||||||
#include <kservicetypetrader.h>
|
|
||||||
#include <ktar.h>
|
|
||||||
#include <ktemporaryfile.h>
|
|
||||||
#include <ktempdir.h>
|
|
||||||
#include <kurl.h>
|
|
||||||
#include <kzip.h>
|
|
||||||
|
|
||||||
#include "package.h"
|
|
||||||
#include "private/packages_p.h"
|
|
||||||
#include "theme.h"
|
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
class ContentStructure
|
PackageStructure::PackageStructure(QObject *parent, const QVariantList &args)
|
||||||
{
|
|
||||||
public:
|
|
||||||
ContentStructure()
|
|
||||||
: directory(false),
|
|
||||||
required(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ContentStructure(const ContentStructure &other)
|
|
||||||
{
|
|
||||||
paths = other.paths;
|
|
||||||
name = other.name;
|
|
||||||
mimetypes = other.mimetypes;
|
|
||||||
directory = other.directory;
|
|
||||||
required = other.required;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList paths;
|
|
||||||
QString name;
|
|
||||||
QStringList mimetypes;
|
|
||||||
bool directory : 1;
|
|
||||||
bool required : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
class PackageStructurePrivate
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PackageStructurePrivate(const QString &t)
|
|
||||||
: type(t),
|
|
||||||
packageRoot("plasma/plasmoids"),
|
|
||||||
servicePrefix("plasma-applet-"),
|
|
||||||
metadata(0),
|
|
||||||
externalPaths(false)
|
|
||||||
{
|
|
||||||
contentsPrefixPaths << "contents/";
|
|
||||||
}
|
|
||||||
|
|
||||||
~PackageStructurePrivate()
|
|
||||||
{
|
|
||||||
delete metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
void createPackageMetadata(const QString &path);
|
|
||||||
QStringList entryList(const QString &prefix, const QString &requestedPath);
|
|
||||||
|
|
||||||
QString type;
|
|
||||||
QString path;
|
|
||||||
QStringList contentsPrefixPaths;
|
|
||||||
QString packageRoot;
|
|
||||||
QString servicePrefix;
|
|
||||||
QMap<QByteArray, ContentStructure> contents;
|
|
||||||
QStringList mimetypes;
|
|
||||||
PackageMetadata *metadata;
|
|
||||||
bool externalPaths;
|
|
||||||
};
|
|
||||||
|
|
||||||
PackageStructure::PackageStructure(QObject *parent, const QString &type)
|
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
d(new PackageStructurePrivate(type))
|
d(0)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageStructure::~PackageStructure()
|
PackageStructure::~PackageStructure()
|
||||||
{
|
{
|
||||||
delete d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageStructure::Ptr PackageStructure::load(const QString &packageFormat)
|
void PackageStructure::initPackage(Package *package)
|
||||||
{
|
{
|
||||||
if (packageFormat.isEmpty()) {
|
Q_UNUSED(package)
|
||||||
return Ptr(new PackageStructure());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageStructure::Ptr structure;
|
void PackageStructure::pathChanged(Package *package)
|
||||||
|
|
||||||
if (packageFormat == "Plasma/Applet") {
|
|
||||||
structure = defaultPackageStructure(AppletComponent);
|
|
||||||
structure->d->type = "Plasma/Applet";
|
|
||||||
} else if (packageFormat == "Plasma/DataEngine") {
|
|
||||||
structure = defaultPackageStructure(DataEngineComponent);
|
|
||||||
structure->d->type = "Plasma/DataEngine";
|
|
||||||
} else if (packageFormat == "Plasma/Runner") {
|
|
||||||
structure = defaultPackageStructure(RunnerComponent);
|
|
||||||
structure->d->type = "Plasma/Runner";
|
|
||||||
} else if (packageFormat == "Plasma/Wallpaper") {
|
|
||||||
structure = defaultPackageStructure(WallpaperComponent);
|
|
||||||
structure->d->type = "Plasma/Wallpaper";
|
|
||||||
} else if (packageFormat == "Plasma/Theme") {
|
|
||||||
structure = Theme::packageStructure();
|
|
||||||
structure->d->type = "Plasma/Theme";
|
|
||||||
} else if (packageFormat == "Plasma/Generic") {
|
|
||||||
structure = defaultPackageStructure(GenericComponent);
|
|
||||||
structure->d->type = "Plasma/Generic";
|
|
||||||
structure->setDefaultPackageRoot(KStandardDirs::locate("data", "plasma/packages/"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (structure) {
|
|
||||||
return structure;
|
|
||||||
}
|
|
||||||
|
|
||||||
// first we check for plugins in sycoca
|
|
||||||
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(packageFormat);
|
|
||||||
KService::List offers =
|
|
||||||
KServiceTypeTrader::self()->query("Plasma/PackageStructure", constraint);
|
|
||||||
|
|
||||||
QVariantList args;
|
|
||||||
QString error;
|
|
||||||
foreach (const KService::Ptr &offer, offers) {
|
|
||||||
PackageStructure::Ptr structure(
|
|
||||||
offer->createInstance<Plasma::PackageStructure>(0, args, &error));
|
|
||||||
|
|
||||||
if (structure) {
|
|
||||||
return structure;
|
|
||||||
}
|
|
||||||
|
|
||||||
kDebug() << "Couldn't load PackageStructure for" << packageFormat
|
|
||||||
<< "! reason given: " << error;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if that didn't give us any love, then we try to load from a config file
|
|
||||||
structure = new PackageStructure();
|
|
||||||
QString configPath("plasma/packageformats/%1rc");
|
|
||||||
configPath = KStandardDirs::locate("data", configPath.arg(packageFormat));
|
|
||||||
|
|
||||||
if (!configPath.isEmpty()) {
|
|
||||||
KConfig config(configPath);
|
|
||||||
structure->read(&config);
|
|
||||||
return structure;
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to load from absolute file path
|
|
||||||
KUrl url(packageFormat);
|
|
||||||
if (url.isLocalFile()) {
|
|
||||||
KConfig config(url.toLocalFile(), KConfig::SimpleConfig);
|
|
||||||
structure->read(&config);
|
|
||||||
}
|
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
else {
|
|
||||||
KTemporaryFile tmp;
|
|
||||||
if (tmp.open()) {
|
|
||||||
KIO::Job *job = KIO::file_copy(url, KUrl(tmp.fileName()),
|
|
||||||
-1, KIO::Overwrite | KIO::HideProgressInfo);
|
|
||||||
if (job->exec()) {
|
|
||||||
KConfig config(tmp.fileName(), KConfig::SimpleConfig);
|
|
||||||
structure->read(&config);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return structure;
|
|
||||||
}
|
|
||||||
|
|
||||||
PackageStructure &PackageStructure::operator=(const PackageStructure &rhs)
|
|
||||||
{
|
{
|
||||||
if (this == &rhs) {
|
Q_UNUSED(package)
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*d = *rhs.d;
|
bool PackageStructure::installPackage(Package *package, const QString &archivePath, const QString &packageRoot)
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::type() const
|
|
||||||
{
|
{
|
||||||
return d->type;
|
return PackagePrivate::installPackage(archivePath, packageRoot, package->servicePrefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<const char*> PackageStructure::directories() const
|
bool PackageStructure::uninstallPackage(Package *package, const QString &packageName, const QString &packageRoot)
|
||||||
{
|
{
|
||||||
QList<const char*> dirs;
|
return PackagePrivate::uninstallPackage(packageName, packageRoot, package->servicePrefix());
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
|
|
||||||
while (it != d->contents.constEnd()) {
|
|
||||||
if (it.value().directory) {
|
|
||||||
dirs << it.key();
|
|
||||||
}
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
return dirs;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<const char*> PackageStructure::requiredDirectories() const
|
|
||||||
{
|
|
||||||
QList<const char*> dirs;
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
|
|
||||||
while (it != d->contents.constEnd()) {
|
|
||||||
if (it.value().directory &&
|
|
||||||
it.value().required) {
|
|
||||||
dirs << it.key();
|
|
||||||
}
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
return dirs;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<const char*> PackageStructure::files() const
|
|
||||||
{
|
|
||||||
QList<const char*> files;
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
|
|
||||||
while (it != d->contents.constEnd()) {
|
|
||||||
if (!it.value().directory) {
|
|
||||||
files << it.key();
|
|
||||||
}
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
return files;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<const char*> PackageStructure::requiredFiles() const
|
|
||||||
{
|
|
||||||
QList<const char*> files;
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
|
|
||||||
while (it != d->contents.constEnd()) {
|
|
||||||
if (!it.value().directory && it.value().required) {
|
|
||||||
files << it.key();
|
|
||||||
}
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
return files;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList PackageStructure::entryList(const char *key)
|
|
||||||
{
|
|
||||||
QString p = path(key);
|
|
||||||
|
|
||||||
if (p.isEmpty()) {
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList list;
|
|
||||||
if (d->contentsPrefixPaths.isEmpty()) {
|
|
||||||
// no prefixes is the same as d->contentsPrefixPths with QStringList() << QString()
|
|
||||||
list << d->entryList(QString(), p);
|
|
||||||
} else {
|
|
||||||
foreach (QString prefix, d->contentsPrefixPaths) {
|
|
||||||
list << d->entryList(prefix, p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList PackageStructurePrivate::entryList(const QString &prefix, const QString &requestedPath)
|
|
||||||
{
|
|
||||||
QDir dir(path + prefix + requestedPath);
|
|
||||||
|
|
||||||
if (externalPaths) {
|
|
||||||
return dir.entryList(QDir::Files | QDir::Readable);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ensure that we don't return files outside of our base path
|
|
||||||
// due to symlink or ../ games
|
|
||||||
QString canonicalized = dir.canonicalPath();
|
|
||||||
if (canonicalized.startsWith(path)) {
|
|
||||||
return dir.entryList(QDir::Files | QDir::Readable);
|
|
||||||
}
|
|
||||||
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::addDirectoryDefinition(const char *key,
|
|
||||||
const QString &path, const QString &name)
|
|
||||||
{
|
|
||||||
ContentStructure s;
|
|
||||||
|
|
||||||
if (d->contents.contains(key)) {
|
|
||||||
s = d->contents[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
s.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
s.paths.append(path);
|
|
||||||
s.directory = true;
|
|
||||||
|
|
||||||
d->contents[key] = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::addFileDefinition(const char *key, const QString &path, const QString &name)
|
|
||||||
{
|
|
||||||
ContentStructure s;
|
|
||||||
|
|
||||||
if (d->contents.contains(key)) {
|
|
||||||
s = d->contents[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
s.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
s.paths.append(path);
|
|
||||||
s.directory = false;
|
|
||||||
|
|
||||||
d->contents[key] = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::removeDefinition(const char *key)
|
|
||||||
{
|
|
||||||
d->contents.remove(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::path(const char *key) const
|
|
||||||
{
|
|
||||||
//kDebug() << "looking for" << key;
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
|
|
||||||
if (it == d->contents.constEnd()) {
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
//kDebug() << "found" << key << "and the value is" << it.value().paths.first();
|
|
||||||
return it.value().paths.first();
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList PackageStructure::searchPath(const char *key) const
|
|
||||||
{
|
|
||||||
//kDebug() << "looking for" << key;
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
|
|
||||||
if (it == d->contents.constEnd()) {
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
//kDebug() << "found" << key << "and the value is" << it.value().paths;
|
|
||||||
return it.value().paths;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::name(const char *key) const
|
|
||||||
{
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
|
|
||||||
if (it == d->contents.constEnd()) {
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return it.value().name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setRequired(const char *key, bool required)
|
|
||||||
{
|
|
||||||
QMap<QByteArray, ContentStructure>::iterator it = d->contents.find(key);
|
|
||||||
if (it == d->contents.end()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
it.value().required = required;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PackageStructure::isRequired(const char *key) const
|
|
||||||
{
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
|
|
||||||
if (it == d->contents.constEnd()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return it.value().required;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setDefaultMimetypes(QStringList mimetypes)
|
|
||||||
{
|
|
||||||
d->mimetypes = mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setMimetypes(const char *key, QStringList mimetypes)
|
|
||||||
{
|
|
||||||
QMap<QByteArray, ContentStructure>::iterator it = d->contents.find(key);
|
|
||||||
if (it == d->contents.end()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
it.value().mimetypes = mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList PackageStructure::mimetypes(const char *key) const
|
|
||||||
{
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
|
|
||||||
if (it == d->contents.constEnd()) {
|
|
||||||
return QStringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (it.value().mimetypes.isEmpty()) {
|
|
||||||
return d->mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
return it.value().mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setPath(const QString &path)
|
|
||||||
{
|
|
||||||
KUrl url(path);
|
|
||||||
QDir dir(url.toLocalFile());
|
|
||||||
QString basePath = dir.canonicalPath();
|
|
||||||
bool valid = QFile::exists(basePath);
|
|
||||||
|
|
||||||
if (valid) {
|
|
||||||
QFileInfo info(basePath);
|
|
||||||
if (info.isDir() && !basePath.endsWith('/')) {
|
|
||||||
basePath.append('/');
|
|
||||||
}
|
|
||||||
//kDebug() << "basePath is" << basePath;
|
|
||||||
} else {
|
|
||||||
kDebug() << path << "invalid, basePath is" << basePath;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d->path == basePath) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
d->path = basePath;
|
|
||||||
delete d->metadata;
|
|
||||||
d->metadata = 0;
|
|
||||||
pathChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::path() const
|
|
||||||
{
|
|
||||||
return d->path;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::pathChanged()
|
|
||||||
{
|
|
||||||
// default impl does nothing, this is a hook for subclasses.
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::read(const KConfigBase *config)
|
|
||||||
{
|
|
||||||
d->contents.clear();
|
|
||||||
d->mimetypes.clear();
|
|
||||||
KConfigGroup general(config, QString());
|
|
||||||
d->type = general.readEntry("Type", QString());
|
|
||||||
d->contentsPrefixPaths = general.readEntry("ContentsPrefixPaths", d->contentsPrefixPaths);
|
|
||||||
d->packageRoot = general.readEntry("DefaultPackageRoot", d->packageRoot);
|
|
||||||
d->externalPaths = general.readEntry("AllowExternalPaths", d->externalPaths);
|
|
||||||
|
|
||||||
QStringList groups = config->groupList();
|
|
||||||
foreach (const QString &group, groups) {
|
|
||||||
KConfigGroup entry(config, group);
|
|
||||||
QByteArray key = group.toAscii();
|
|
||||||
|
|
||||||
QString path = entry.readEntry("Path", QString());
|
|
||||||
QString name = entry.readEntry("Name", QString());
|
|
||||||
QStringList mimetypes = entry.readEntry("Mimetypes", QStringList());
|
|
||||||
bool directory = entry.readEntry("Directory", false);
|
|
||||||
bool required = entry.readEntry("Required", false);
|
|
||||||
|
|
||||||
if (directory) {
|
|
||||||
addDirectoryDefinition(key, path, name);
|
|
||||||
} else {
|
|
||||||
addFileDefinition(key, path, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
setMimetypes(key, mimetypes);
|
|
||||||
setRequired(key, required);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::write(KConfigBase *config) const
|
|
||||||
{
|
|
||||||
KConfigGroup general = KConfigGroup(config, "");
|
|
||||||
general.writeEntry("Type", type());
|
|
||||||
general.writeEntry("ContentsPrefixPaths", d->contentsPrefixPaths);
|
|
||||||
general.writeEntry("DefaultPackageRoot", d->packageRoot);
|
|
||||||
general.writeEntry("AllowExternalPaths", d->externalPaths);
|
|
||||||
|
|
||||||
QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
|
|
||||||
while (it != d->contents.constEnd()) {
|
|
||||||
KConfigGroup group = config->group(it.key());
|
|
||||||
group.writeEntry("Path", it.value().paths);
|
|
||||||
group.writeEntry("Name", it.value().name);
|
|
||||||
if (!it.value().mimetypes.isEmpty()) {
|
|
||||||
group.writeEntry("Mimetypes", it.value().mimetypes);
|
|
||||||
}
|
|
||||||
if (it.value().directory) {
|
|
||||||
group.writeEntry("Directory", true);
|
|
||||||
}
|
|
||||||
if (it.value().required) {
|
|
||||||
group.writeEntry("Required", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::contentsPrefix() const
|
|
||||||
{
|
|
||||||
return d->contentsPrefixPaths.isEmpty() ? QString() : d->contentsPrefixPaths.first();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setContentsPrefix(const QString &prefix)
|
|
||||||
{
|
|
||||||
d->contentsPrefixPaths.clear();
|
|
||||||
d->contentsPrefixPaths << prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList PackageStructure::contentsPrefixPaths() const
|
|
||||||
{
|
|
||||||
return d->contentsPrefixPaths;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setContentsPrefixPaths(const QStringList &prefixPaths)
|
|
||||||
{
|
|
||||||
d->contentsPrefixPaths = prefixPaths;
|
|
||||||
|
|
||||||
// the code assumes that the prefixes have a trailing slash
|
|
||||||
// so let's make that true here
|
|
||||||
QMutableStringListIterator it(d->contentsPrefixPaths);
|
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
|
|
||||||
if (!it.value().endsWith('/')) {
|
|
||||||
it.setValue(it.value() % '/');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PackageStructure::installPackage(const QString &package, const QString &packageRoot)
|
|
||||||
{
|
|
||||||
return Package::installPackage(package, packageRoot, d->servicePrefix);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PackageStructure::uninstallPackage(const QString &packageName, const QString &packageRoot)
|
|
||||||
{
|
|
||||||
return Package::uninstallPackage(packageName, packageRoot, d->servicePrefix);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::createNewWidgetBrowser(QWidget *parent)
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent)
|
|
||||||
emit newWidgetBrowserFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::defaultPackageRoot() const
|
|
||||||
{
|
|
||||||
return d->packageRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PackageStructure::servicePrefix() const
|
|
||||||
{
|
|
||||||
return d->servicePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setDefaultPackageRoot(const QString &packageRoot)
|
|
||||||
{
|
|
||||||
d->packageRoot = packageRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructure::setServicePrefix(const QString &servicePrefix)
|
|
||||||
{
|
|
||||||
d->servicePrefix = servicePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PackageStructurePrivate::createPackageMetadata(const QString &path)
|
|
||||||
{
|
|
||||||
delete metadata;
|
|
||||||
metadata = 0;
|
|
||||||
|
|
||||||
QString metadataPath(path + "/metadata.desktop");
|
|
||||||
if (!QFile::exists(metadataPath)) {
|
|
||||||
kWarning() << "No metadata file in the package, expected it at:" << metadataPath;
|
|
||||||
metadataPath.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
metadata = new PackageMetadata(metadataPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
//FIXME KDE5: should be const
|
|
||||||
PackageMetadata PackageStructure::metadata()
|
|
||||||
{
|
|
||||||
if (!d->metadata && !d->path.isEmpty()) {
|
|
||||||
QFileInfo fileInfo(d->path);
|
|
||||||
|
|
||||||
if (fileInfo.isDir()) {
|
|
||||||
d->createPackageMetadata(d->path);
|
|
||||||
} else if (fileInfo.exists()) {
|
|
||||||
KArchive *archive = 0;
|
|
||||||
KMimeType::Ptr mimetype = KMimeType::findByPath(d->path);
|
|
||||||
|
|
||||||
if (mimetype->is("application/zip")) {
|
|
||||||
archive = new KZip(d->path);
|
|
||||||
} else if (mimetype->is("application/x-compressed-tar") || mimetype->is("application/x-gzip") ||
|
|
||||||
mimetype->is("application/x-tar")|| mimetype->is("application/x-bzip-compressed-tar")) {
|
|
||||||
archive = new KTar(d->path);
|
|
||||||
} else {
|
|
||||||
kWarning() << "Could not open package file, unsupported archive format:" << d->path << mimetype->name();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (archive && archive->open(QIODevice::ReadOnly)) {
|
|
||||||
const KArchiveDirectory *source = archive->directory();
|
|
||||||
KTempDir tempdir;
|
|
||||||
source->copyTo(tempdir.name());
|
|
||||||
d->createPackageMetadata(tempdir.name());
|
|
||||||
} else {
|
|
||||||
kWarning() << "Could not open package file:" << d->path;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete archive;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!d->metadata) {
|
|
||||||
d->metadata = new PackageMetadata();
|
|
||||||
}
|
|
||||||
|
|
||||||
return *d->metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PackageStructure::allowExternalPaths() const
|
|
||||||
{
|
|
||||||
return d->externalPaths;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackageStructure::setAllowExternalPaths(bool allow)
|
|
||||||
{
|
|
||||||
d->externalPaths = allow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Plasma namespace
|
|
||||||
|
|
||||||
#include "packagestructure.moc"
|
|
||||||
|
|
||||||
|
#include "moc_packagestructure.cpp"
|
||||||
|
@ -27,23 +27,68 @@
|
|||||||
|
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
#include <kdesktopfile.h>
|
#include <kdesktopfile.h>
|
||||||
#include <klocale.h>
|
#include <klocalizedstring.h>
|
||||||
#include <kmessagebox.h>
|
#include <kmessagebox.h>
|
||||||
|
|
||||||
#ifndef PLASMA_NO_KNEWSTUFF
|
|
||||||
#include <knewstuff3/downloaddialog.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "kdeclarative.h"
|
#include "kdeclarative.h"
|
||||||
|
#include "package.h"
|
||||||
#include "private/wallpaper_p.h"
|
#include "config-plasma.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
void ChangeableMainScriptPackage::initPackage(Package *package)
|
||||||
: Plasma::PackageStructure(parent, QString("Plasmoid"))
|
|
||||||
{
|
{
|
||||||
|
package->addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
||||||
|
package->setRequired("mainscript", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ChangeableMainScriptPackage::findMainScript(Package *package) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(package)
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ChangeableMainScriptPackage::mainScriptConfigKey() const
|
||||||
|
{
|
||||||
|
return QLatin1String("X-Plasma-MainScript");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChangeableMainScriptPackage::pathChanged(Package *package)
|
||||||
|
{
|
||||||
|
KDesktopFile config(package->path() + "/metadata.desktop");
|
||||||
|
KConfigGroup cg = config.desktopGroup();
|
||||||
|
QString mainScript = cg.readEntry(mainScriptConfigKey(), QString());
|
||||||
|
if (mainScript.isEmpty()) {
|
||||||
|
mainScript = findMainScript(package);
|
||||||
|
|
||||||
|
if (mainScript.isEmpty()) {
|
||||||
|
mainScript = package->path() + "/code/main.js";
|
||||||
|
if (!QFile::exists(mainScript)) {
|
||||||
|
mainScript.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mainScript.isEmpty()) {
|
||||||
|
package->addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PlasmoidPackage::findMainScript(Package *package) const
|
||||||
|
{
|
||||||
|
const QString mainScript = package->path() + "/ui/main.qml";
|
||||||
|
if (QFile::exists(mainScript)) {
|
||||||
|
return mainScript;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlasmoidPackage::initPackage(Package *package)
|
||||||
|
{
|
||||||
|
ChangeableMainScriptPackage::initPackage(package);
|
||||||
|
|
||||||
QStringList platform = KDeclarative::runtimePlatform();
|
QStringList platform = KDeclarative::runtimePlatform();
|
||||||
if (!platform.isEmpty()) {
|
if (!platform.isEmpty()) {
|
||||||
QMutableStringListIterator it(platform);
|
QMutableStringListIterator it(platform);
|
||||||
@ -51,384 +96,190 @@ PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
|||||||
it.next();
|
it.next();
|
||||||
it.setValue("platformcontents/" + it.value());
|
it.setValue("platformcontents/" + it.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
platform.append("contents");
|
platform.append("contents");
|
||||||
setContentsPrefixPaths(platform);
|
package->setContentsPrefixPaths(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
addDirectoryDefinition("images", "images", i18n("Images"));
|
package->setServicePrefix("plasma-applet-");
|
||||||
|
package->setDefaultPackageRoot("plasma/plasmoids");
|
||||||
|
|
||||||
|
package->addDirectoryDefinition("images", "images", i18n("Images"));
|
||||||
QStringList mimetypes;
|
QStringList mimetypes;
|
||||||
mimetypes << "image/svg+xml" << "image/png" << "image/jpeg";
|
mimetypes << "image/svg+xml" << "image/png" << "image/jpeg";
|
||||||
setMimetypes("images", mimetypes);
|
package->setMimeTypes("images", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("config", "config", i18n("Configuration Definitions"));
|
package->addDirectoryDefinition("config", "config", i18n("Configuration Definitions"));
|
||||||
mimetypes.clear();
|
mimetypes.clear();
|
||||||
mimetypes << "text/xml";
|
mimetypes << "text/xml";
|
||||||
setMimetypes("config", mimetypes);
|
package->setMimeTypes("config", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("ui", "ui", i18n("User Interface"));
|
package->addDirectoryDefinition("ui", "ui", i18n("User Interface"));
|
||||||
setMimetypes("ui", mimetypes);
|
package->setMimeTypes("ui", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("data", "data", i18n("Data Files"));
|
package->addDirectoryDefinition("data", "data", i18n("Data Files"));
|
||||||
|
|
||||||
addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
package->addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
||||||
mimetypes.clear();
|
mimetypes.clear();
|
||||||
mimetypes << "text/plain";
|
mimetypes << "text/plain";
|
||||||
setMimetypes("scripts", mimetypes);
|
package->setMimeTypes("scripts", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
package->addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
||||||
|
|
||||||
addFileDefinition("mainconfigui", "ui/config.ui", i18n("Main Config UI File"));
|
package->addFileDefinition("mainconfigui", "ui/config.ui", i18n("Main Config UI File"));
|
||||||
addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
|
package->addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
|
||||||
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
package->addDirectoryDefinition("animations", "animations", i18n("Animation scripts"));
|
||||||
addFileDefinition("defaultconfig", "config/default-configrc", i18n("Default configuration"));
|
|
||||||
addDirectoryDefinition("animations", "animations", i18n("Animation scripts"));
|
|
||||||
setRequired("mainscript", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmoidPackage::~PlasmoidPackage()
|
QString ContainmentPackage::mainScriptConfigKey() const
|
||||||
{
|
{
|
||||||
#ifndef PLASMA_NO_KNEWSTUFF
|
return QLatin1String("X-Plasma-Containment-MainScript");
|
||||||
if (!QCoreApplication::closingDown()) {
|
|
||||||
// let it "leak" on application close as this causes crashes otherwise, BUG 288153
|
|
||||||
delete m_knsDialog.data();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlasmoidPackage::pathChanged()
|
void DataEnginePackage::initPackage(Package *package)
|
||||||
{
|
{
|
||||||
KDesktopFile config(path() + "/metadata.desktop");
|
ChangeableMainScriptPackage::initPackage(package);
|
||||||
KConfigGroup cg = config.desktopGroup();
|
package->setServicePrefix("plasma-dataengine-");
|
||||||
QString mainScript = cg.readEntry("X-Plasma-MainScript", QString());
|
package->setDefaultPackageRoot("plasma/dataengines/");
|
||||||
if (!mainScript.isEmpty()) {
|
|
||||||
addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
|
||||||
setRequired("mainscript", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlasmoidPackage::createNewWidgetBrowser(QWidget *parent)
|
package->addDirectoryDefinition("data", "data", i18n("Data Files"));
|
||||||
{
|
|
||||||
#ifndef PLASMA_NO_KNEWSTUFF
|
|
||||||
KNS3::DownloadDialog *knsDialog = m_knsDialog.data();
|
|
||||||
if (!knsDialog) {
|
|
||||||
m_knsDialog = knsDialog = new KNS3::DownloadDialog("plasmoids.knsrc", parent);
|
|
||||||
knsDialog->setProperty("DoNotCloseController", true);
|
|
||||||
connect(knsDialog, SIGNAL(accepted()), this, SIGNAL(newWidgetBrowserFinished()));
|
|
||||||
connect(knsDialog, SIGNAL(accepted()), knsDialog, SLOT(deleteLater()));
|
|
||||||
}
|
|
||||||
|
|
||||||
knsDialog->show();
|
package->addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
||||||
knsDialog->raise();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
DataEnginePackage::DataEnginePackage(QObject *parent)
|
|
||||||
: Plasma::PackageStructure(parent, QString("DataEngine"))
|
|
||||||
{
|
|
||||||
setServicePrefix("plasma-dataengine-");
|
|
||||||
setDefaultPackageRoot("plasma/dataengine/");
|
|
||||||
|
|
||||||
addDirectoryDefinition("data", "data", i18n("Data Files"));
|
|
||||||
|
|
||||||
addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
|
||||||
QStringList mimetypes;
|
QStringList mimetypes;
|
||||||
mimetypes << "text/plain";
|
mimetypes << "text/plain";
|
||||||
setMimetypes("scripts", mimetypes);
|
package->setMimeTypes("scripts", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("services", "services/", i18n("Service Descriptions"));
|
package->addDirectoryDefinition("services", "services/", i18n("Service Descriptions"));
|
||||||
setMimetypes("services", mimetypes);
|
package->setMimeTypes("services", mimetypes);
|
||||||
|
|
||||||
addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
package->addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
||||||
|
|
||||||
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
|
||||||
setRequired("mainscript", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataEnginePackage::~DataEnginePackage()
|
void RunnerPackage::initPackage(Package *package)
|
||||||
{
|
{
|
||||||
|
ChangeableMainScriptPackage::initPackage(package);
|
||||||
|
package->setServicePrefix("plasma-runner-");
|
||||||
|
package->setDefaultPackageRoot("plasma/runners/");
|
||||||
|
|
||||||
|
package->addDirectoryDefinition("data", "data", i18n("Data Files"));
|
||||||
|
|
||||||
|
package->addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
||||||
|
QStringList mimetypes;
|
||||||
|
mimetypes << "text/plain";
|
||||||
|
package->setMimeTypes("scripts", mimetypes);
|
||||||
|
|
||||||
|
package->addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataEnginePackage::pathChanged()
|
void ThemePackage::initPackage(Package *package)
|
||||||
{
|
{
|
||||||
KDesktopFile config(path() + "/metadata.desktop");
|
package->addDirectoryDefinition("dialogs", "dialogs/", i18n("Images for dialogs"));
|
||||||
KConfigGroup cg = config.desktopGroup();
|
package->addFileDefinition("dialogs/background", "dialogs/background.svg",
|
||||||
QString mainScript = cg.readEntry("X-Plasma-MainScript", QString());
|
|
||||||
if (!mainScript.isEmpty()) {
|
|
||||||
addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
|
||||||
setRequired("mainscript", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ThemePackage::ThemePackage(QObject *parent)
|
|
||||||
: Plasma::PackageStructure(parent, QString("Plasma Theme"))
|
|
||||||
{
|
|
||||||
addDirectoryDefinition("dialogs", "dialogs/", i18n("Images for dialogs"));
|
|
||||||
|
|
||||||
addFileDefinition("dialogs/background", "dialogs/background.svg",
|
|
||||||
i18n("Generic dialog background"));
|
i18n("Generic dialog background"));
|
||||||
addFileDefinition("dialogs/background", "dialogs/background.svgz",
|
package->addFileDefinition("dialogs/background", "dialogs/background.svgz",
|
||||||
i18n("Generic dialog background"));
|
i18n("Generic dialog background"));
|
||||||
|
package->addFileDefinition("dialogs/shutdowndialog", "dialogs/shutdowndialog.svg",
|
||||||
addFileDefinition("dialogs/shutdowndialog", "dialogs/shutdowndialog.svg",
|
|
||||||
i18n("Theme for the logout dialog"));
|
i18n("Theme for the logout dialog"));
|
||||||
addFileDefinition("dialogs/shutdowndialog", "dialogs/shutdowndialog.svgz",
|
package->addFileDefinition("dialogs/shutdowndialog", "dialogs/shutdowndialog.svgz",
|
||||||
i18n("Theme for the logout dialog"));
|
i18n("Theme for the logout dialog"));
|
||||||
|
|
||||||
addDirectoryDefinition("wallpapers", "wallpapers/", i18n("Wallpaper packages"));
|
package->addDirectoryDefinition("wallpapers", "wallpapers/", i18n("Wallpaper packages"));
|
||||||
addDirectoryDefinition("animations", "animations/", i18n("Animation scripts"));
|
package->addDirectoryDefinition("animations", "animations/", i18n("Animation scripts"));
|
||||||
|
|
||||||
addDirectoryDefinition("widgets", "widgets/", i18n("Images for widgets"));
|
package->addDirectoryDefinition("widgets", "widgets/", i18n("Images for widgets"));
|
||||||
|
package->addFileDefinition("widgets/background", "widgets/background.svg",
|
||||||
addFileDefinition("widgets/background", "widgets/background.svg",
|
|
||||||
i18n("Background image for widgets"));
|
i18n("Background image for widgets"));
|
||||||
addFileDefinition("widgets/background", "widgets/background.svgz",
|
package->addFileDefinition("widgets/background", "widgets/background.svgz",
|
||||||
i18n("Background image for widgets"));
|
i18n("Background image for widgets"));
|
||||||
|
package->addFileDefinition("widgets/clock", "widgets/clock.svg",
|
||||||
addFileDefinition("widgets/clock", "widgets/clock.svg",
|
|
||||||
i18n("Analog clock face"));
|
i18n("Analog clock face"));
|
||||||
addFileDefinition("widgets/clock", "widgets/clock.svgz",
|
package->addFileDefinition("widgets/clock", "widgets/clock.svgz",
|
||||||
i18n("Analog clock face"));
|
i18n("Analog clock face"));
|
||||||
|
package->addFileDefinition("widgets/panel-background", "widgets/panel-background.svg",
|
||||||
addFileDefinition("widgets/panel-background", "widgets/panel-background.svg",
|
|
||||||
i18n("Background image for panels"));
|
i18n("Background image for panels"));
|
||||||
addFileDefinition("widgets/panel-background", "widgets/panel-background.svgz",
|
package->addFileDefinition("widgets/panel-background", "widgets/panel-background.svgz",
|
||||||
i18n("Background image for panels"));
|
i18n("Background image for panels"));
|
||||||
|
package->addFileDefinition("widgets/plot-background", "widgets/plot-background.svg",
|
||||||
addFileDefinition("widgets/plot-background", "widgets/plot-background.svg",
|
|
||||||
i18n("Background for graphing widgets"));
|
i18n("Background for graphing widgets"));
|
||||||
addFileDefinition("widgets/plot-background", "widgets/plot-background.svg",
|
package->addFileDefinition("widgets/plot-background", "widgets/plot-background.svgz",
|
||||||
i18n("Background for graphing widgets"));
|
i18n("Background for graphing widgets"));
|
||||||
|
package->addFileDefinition("widgets/tooltip", "widgets/tooltip.svg",
|
||||||
addFileDefinition("widgets/tooltip", "widgets/tooltip.svg",
|
|
||||||
i18n("Background image for tooltips"));
|
i18n("Background image for tooltips"));
|
||||||
addFileDefinition("widgets/tooltip", "widgets/tooltip.svgz",
|
package->addFileDefinition("widgets/tooltip", "widgets/tooltip.svgz",
|
||||||
i18n("Background image for tooltips"));
|
i18n("Background image for tooltips"));
|
||||||
|
|
||||||
addDirectoryDefinition("opaque/dialogs", "opaque/dialogs/", i18n("Opaque images for dialogs"));
|
package->addDirectoryDefinition("opaque/dialogs", "opaque/dialogs/", i18n("Opaque images for dialogs"));
|
||||||
|
package->addFileDefinition("opaque/dialogs/background", "opaque/dialogs/background.svg",
|
||||||
addFileDefinition("opaque/dialogs/background", "opaque/dialogs/background.svg",
|
|
||||||
i18n("Opaque generic dialog background"));
|
i18n("Opaque generic dialog background"));
|
||||||
addFileDefinition("opaque/dialogs/background", "opaque/dialogs/background.svgz",
|
package->addFileDefinition("opaque/dialogs/background", "opaque/dialogs/background.svgz",
|
||||||
i18n("Opaque generic dialog background"));
|
i18n("Opaque generic dialog background"));
|
||||||
|
package->addFileDefinition("opaque/dialogs/shutdowndialog", "opaque/dialogs/shutdowndialog.svg",
|
||||||
addFileDefinition("opaque/dialogs/shutdowndialog", "opaque/dialogs/shutdowndialog.svg",
|
|
||||||
i18n("Opaque theme for the logout dialog"));
|
i18n("Opaque theme for the logout dialog"));
|
||||||
addFileDefinition("opaque/dialogs/shutdowndialog", "opaque/dialogs/shutdowndialog.svgz",
|
package->addFileDefinition("opaque/dialogs/shutdowndialog", "opaque/dialogs/shutdowndialog.svgz",
|
||||||
i18n("Opaque theme for the logout dialog"));
|
i18n("Opaque theme for the logout dialog"));
|
||||||
|
|
||||||
addDirectoryDefinition("opaque/widgets", "opaque/widgets/", i18n("Opaque images for widgets"));
|
package->addDirectoryDefinition("opaque/widgets", "opaque/widgets/", i18n("Opaque images for widgets"));
|
||||||
|
package->addFileDefinition("opaque/widgets/panel-background", "opaque/widgets/panel-background.svg",
|
||||||
addFileDefinition("opaque/widgets/panel-background", "opaque/widgets/panel-background.svg",
|
|
||||||
i18n("Opaque background image for panels"));
|
i18n("Opaque background image for panels"));
|
||||||
addFileDefinition("opaque/widgets/panel-background", "opaque/widgets/panel-background.svgz",
|
package->addFileDefinition("opaque/widgets/panel-background", "opaque/widgets/panel-background.svgz",
|
||||||
i18n("Opaque background image for panels"));
|
i18n("Opaque background image for panels"));
|
||||||
|
package->addFileDefinition("opaque/widgets/tooltip", "opaque/widgets/tooltip.svg",
|
||||||
addFileDefinition("opaque/widgets/tooltip", "opaque/widgets/tooltip.svg",
|
|
||||||
i18n("Opaque background image for tooltips"));
|
i18n("Opaque background image for tooltips"));
|
||||||
addFileDefinition("opaque/widgets/tooltip", "opaque/widgets/tooltip.svgz",
|
package->addFileDefinition("opaque/widgets/tooltip", "opaque/widgets/tooltip.svgz",
|
||||||
i18n("Opaque background image for tooltips"));
|
i18n("Opaque background image for tooltips"));
|
||||||
|
|
||||||
addDirectoryDefinition("locolor/dialogs", "locolor/dialogs/",
|
package->addDirectoryDefinition("locolor/dialogs", "locolor/dialogs/",
|
||||||
i18n("Low color images for dialogs"));
|
i18n("Low color images for dialogs"));
|
||||||
|
package->addFileDefinition("locolor/dialogs/background", "locolor/dialogs/background.svg",
|
||||||
addFileDefinition("locolor/dialogs/background", "locolor/dialogs/background.svg",
|
|
||||||
i18n("Low color generic dialog background"));
|
i18n("Low color generic dialog background"));
|
||||||
addFileDefinition("locolor/dialogs/background", "locolor/dialogs/background.svgz",
|
package->addFileDefinition("locolor/dialogs/background", "locolor/dialogs/background.svgz",
|
||||||
i18n("Low color generic dialog background"));
|
i18n("Low color generic dialog background"));
|
||||||
|
package->addFileDefinition("locolor/dialogs/shutdowndialog", "locolor/dialogs/shutdowndialog.svg",
|
||||||
addFileDefinition("locolor/dialogs/shutdowndialog", "locolor/dialogs/shutdowndialog.svg",
|
|
||||||
i18n("Low color theme for the logout dialog"));
|
i18n("Low color theme for the logout dialog"));
|
||||||
addFileDefinition("locolor/dialogs/shutdowndialog", "locolor/dialogs/shutdowndialog.svgz",
|
package->addFileDefinition("locolor/dialogs/shutdowndialog", "locolor/dialogs/shutdowndialog.svgz",
|
||||||
i18n("Low color theme for the logout dialog"));
|
i18n("Low color theme for the logout dialog"));
|
||||||
|
|
||||||
addDirectoryDefinition("locolor/widgets", "locolor/widgets/", i18n("Images for widgets"));
|
package->addDirectoryDefinition("locolor/widgets", "locolor/widgets/", i18n("Images for widgets"));
|
||||||
|
package->addFileDefinition("locolor/widgets/background", "locolor/widgets/background.svg",
|
||||||
addFileDefinition("locolor/widgets/background", "locolor/widgets/background.svg",
|
|
||||||
i18n("Low color background image for widgets"));
|
i18n("Low color background image for widgets"));
|
||||||
addFileDefinition("locolor/widgets/background", "locolor/widgets/background.svgz",
|
package->addFileDefinition("locolor/widgets/background", "locolor/widgets/background.svgz",
|
||||||
i18n("Low color background image for widgets"));
|
i18n("Low color background image for widgets"));
|
||||||
|
package->addFileDefinition("locolor/widgets/clock", "locolor/widgets/clock.svg",
|
||||||
addFileDefinition("locolor/widgets/clock", "locolor/widgets/clock.svg",
|
|
||||||
i18n("Low color analog clock face"));
|
i18n("Low color analog clock face"));
|
||||||
addFileDefinition("locolor/widgets/clock", "locolor/widgets/clock.svgz",
|
package->addFileDefinition("locolor/widgets/clock", "locolor/widgets/clock.svgz",
|
||||||
i18n("Low color analog clock face"));
|
i18n("Low color analog clock face"));
|
||||||
|
package->addFileDefinition("locolor/widgets/panel-background", "locolor/widgets/panel-background.svg",
|
||||||
addFileDefinition("locolor/widgets/panel-background", "locolor/widgets/panel-background.svg",
|
|
||||||
i18n("Low color background image for panels"));
|
i18n("Low color background image for panels"));
|
||||||
addFileDefinition("locolor/widgets/panel-background", "locolor/widgets/panel-background.svgz",
|
package->addFileDefinition("locolor/widgets/panel-background", "locolor/widgets/panel-background.svgz",
|
||||||
i18n("Low color background image for panels"));
|
i18n("Low color background image for panels"));
|
||||||
|
package->addFileDefinition("locolor/widgets/plot-background", "locolor/widgets/plot-background.svg",
|
||||||
addFileDefinition("locolor/widgets/plot-background", "locolor/widgets/plot-background.svg",
|
|
||||||
i18n("Low color background for graphing widgets"));
|
i18n("Low color background for graphing widgets"));
|
||||||
addFileDefinition("locolor/widgets/plot-background", "locolor/widgets/plot-background.svgz",
|
package->addFileDefinition("locolor/widgets/plot-background", "locolor/widgets/plot-background.svgz",
|
||||||
i18n("Low color background for graphing widgets"));
|
i18n("Low color background for graphing widgets"));
|
||||||
|
package->addFileDefinition("locolor/widgets/tooltip", "locolor/widgets/tooltip.svg",
|
||||||
addFileDefinition("locolor/widgets/tooltip", "locolor/widgets/tooltip.svg",
|
|
||||||
i18n("Low color background image for tooltips"));
|
i18n("Low color background image for tooltips"));
|
||||||
addFileDefinition("locolor/widgets/tooltip", "locolor/widgets/tooltip.svgz",
|
package->addFileDefinition("locolor/widgets/tooltip", "locolor/widgets/tooltip.svgz",
|
||||||
i18n("Low color background image for tooltips"));
|
i18n("Low color background image for tooltips"));
|
||||||
|
|
||||||
addFileDefinition("colors", "colors", i18n("KColorScheme configuration file"));
|
package->addFileDefinition("colors", "colors", i18n("KColorScheme configuration file"));
|
||||||
|
|
||||||
QStringList mimetypes;
|
QStringList mimetypes;
|
||||||
mimetypes << "image/svg+xml";
|
mimetypes << "image/svg+xml";
|
||||||
setDefaultMimetypes(mimetypes);
|
package->setDefaultMimeTypes(mimetypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
WallpaperPackage::WallpaperPackage(Wallpaper *paper, QObject *parent)
|
void ContainmentActionsPackage::initPackage(Package *package)
|
||||||
: PackageStructure(parent, "Background"),
|
|
||||||
m_paper(paper),
|
|
||||||
m_fullPackage(true),
|
|
||||||
m_targetSize(100000, 100000),
|
|
||||||
m_resizeMethod(Wallpaper::ScaledResize)
|
|
||||||
{
|
{
|
||||||
QStringList mimetypes;
|
ChangeableMainScriptPackage::initPackage(package);
|
||||||
mimetypes << "image/svg" << "image/png" << "image/jpeg" << "image/jpg";
|
package->setDefaultPackageRoot("plasma/containmentactions/");
|
||||||
setDefaultMimetypes(mimetypes);
|
|
||||||
|
|
||||||
addDirectoryDefinition("images", "images/", i18n("Images"));
|
|
||||||
setRequired("images", true);
|
|
||||||
addFileDefinition("screenshot", "screenshot.png", i18n("Screenshot"));
|
|
||||||
setAllowExternalPaths(true);
|
|
||||||
|
|
||||||
if (m_paper) {
|
|
||||||
m_targetSize = m_paper->d->targetSize.toSize();
|
|
||||||
m_resizeMethod = m_paper->d->lastResizeMethod;
|
|
||||||
|
|
||||||
connect(m_paper, SIGNAL(renderHintsChanged()), this, SLOT(renderHintsChanged()));
|
|
||||||
connect(m_paper, SIGNAL(destroyed(QObject*)), this, SLOT(paperDestroyed()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WallpaperPackage::renderHintsChanged()
|
void GenericPackage::initPackage(Package *package)
|
||||||
{
|
{
|
||||||
if (m_paper) {
|
package->setDefaultPackageRoot("plasma/packages/");
|
||||||
m_targetSize = m_paper->d->targetSize.toSize();
|
|
||||||
m_resizeMethod = m_paper->d->lastResizeMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_fullPackage) {
|
|
||||||
findBestPaper();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WallpaperPackage::pathChanged()
|
|
||||||
{
|
|
||||||
static bool guard = false;
|
|
||||||
|
|
||||||
if (guard) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
guard = true;
|
|
||||||
|
|
||||||
QFileInfo info(path());
|
|
||||||
m_fullPackage = info.isDir();
|
|
||||||
removeDefinition("preferred");
|
|
||||||
setRequired("images", m_fullPackage);
|
|
||||||
|
|
||||||
if (m_fullPackage) {
|
|
||||||
setContentsPrefixPaths(QStringList() << "contents/");
|
|
||||||
findBestPaper();
|
|
||||||
} else {
|
|
||||||
// dirty trick to support having a file passed in instead of a directory
|
|
||||||
addFileDefinition("preferred", info.fileName(), i18n("Recommended wallpaper file"));
|
|
||||||
setContentsPrefixPaths(QStringList());
|
|
||||||
//kDebug() << "changing" << path() << "to" << info.path();
|
|
||||||
setPath(info.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
guard = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize WallpaperPackage::resSize(const QString &str) const
|
|
||||||
{
|
|
||||||
int index = str.indexOf('x');
|
|
||||||
if (index != -1) {
|
|
||||||
return QSize(str.left(index).toInt(),
|
|
||||||
str.mid(index + 1).toInt());
|
|
||||||
} else {
|
|
||||||
return QSize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WallpaperPackage::findBestPaper()
|
|
||||||
{
|
|
||||||
QStringList images = entryList("images");
|
|
||||||
if (images.empty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//kDebug() << "wanted" << size;
|
|
||||||
|
|
||||||
// choose the nearest resolution
|
|
||||||
float best = FLT_MAX;
|
|
||||||
|
|
||||||
QString bestImage;
|
|
||||||
foreach (const QString &entry, images) {
|
|
||||||
QSize candidate = resSize(QFileInfo(entry).baseName());
|
|
||||||
if (candidate == QSize()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double dist = distance(candidate, m_targetSize, m_resizeMethod);
|
|
||||||
//kDebug() << "candidate" << candidate << "distance" << dist;
|
|
||||||
if (bestImage.isEmpty() || dist < best) {
|
|
||||||
bestImage = entry;
|
|
||||||
best = dist;
|
|
||||||
//kDebug() << "best" << bestImage;
|
|
||||||
if (dist == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//kDebug() << "best image" << bestImage;
|
|
||||||
addFileDefinition("preferred", path("images") + bestImage, i18n("Recommended wallpaper file"));
|
|
||||||
}
|
|
||||||
|
|
||||||
float WallpaperPackage::distance(const QSize& size, const QSize& desired,
|
|
||||||
Plasma::Wallpaper::ResizeMethod method) const
|
|
||||||
{
|
|
||||||
// compute difference of areas
|
|
||||||
float delta = size.width() * size.height() -
|
|
||||||
desired.width() * desired.height();
|
|
||||||
// scale down to about 1.0
|
|
||||||
delta /= ((desired.width() * desired.height())+(size.width() * size.height()))/2;
|
|
||||||
|
|
||||||
|
|
||||||
switch (method) {
|
|
||||||
case Plasma::Wallpaper::ScaledResize: {
|
|
||||||
// Consider first the difference in aspect ratio,
|
|
||||||
// then in areas. Prefer scaling down.
|
|
||||||
float deltaRatio = 1.0;
|
|
||||||
if (size.height() > 0 && desired.height() > 0) {
|
|
||||||
deltaRatio = float(size.width()) / float(size.height()) -
|
|
||||||
float(desired.width()) / float(desired.height());
|
|
||||||
}
|
|
||||||
return fabs(deltaRatio) * 3.0 + (delta >= 0.0 ? delta : -delta + 5.0);
|
|
||||||
}
|
|
||||||
case Plasma::Wallpaper::ScaledAndCroppedResize:
|
|
||||||
// Difference of areas, slight preference to scale down
|
|
||||||
return delta >= 0.0 ? delta : -delta + 2.0;
|
|
||||||
default:
|
|
||||||
// Difference in areas
|
|
||||||
return fabs(delta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WallpaperPackage::paperDestroyed()
|
|
||||||
{
|
|
||||||
m_paper = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ContainmentActionsPackage::ContainmentActionsPackage(QObject *parent)
|
|
||||||
: Plasma::PackageStructure(parent, QString("ContainmentActions"))
|
|
||||||
{
|
|
||||||
//FIXME how do I do the mimetypes stuff?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
|
||||||
#include "packages_p.moc"
|
#include "moc_packages_p.cpp"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user