get rid of Plasma::Location

This commit is contained in:
Marco Martin 2013-05-14 18:27:27 +02:00
parent 9b9fbf6eb9
commit 812b9a06ab
14 changed files with 29 additions and 29 deletions

View File

@ -38,7 +38,7 @@
#include <QDebug> #include <QDebug>
// just for debugging purposes, FIXME: remove later // just for debugging purposes, FIXME: remove later
QString locString(const Plasma::Location l) { QString locString(const Plasma::Types::Location l) {
QString o = "Unknown: " + l; QString o = "Unknown: " + l;
if (l == Plasma::Types::Floating) { if (l == Plasma::Types::Floating) {
o = "Floating"; o = "Floating";
@ -215,7 +215,7 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignment)
} }
} }
Plasma::Location l = (Plasma::Location)location(); Plasma::Types::Location l = (Plasma::Types::Location)location();
QPoint topPoint((item->boundingRect().width() - width())/2, QPoint topPoint((item->boundingRect().width() - width())/2,
-height()); -height());
@ -316,7 +316,7 @@ void DialogProxy::setWindowFlags(const int flags)
int DialogProxy::location() const int DialogProxy::location() const
{ {
return (Plasma::Location)m_location; return (Plasma::Types::Location)m_location;
} }
void DialogProxy::setLocation(int location) void DialogProxy::setLocation(int location)
@ -324,7 +324,7 @@ void DialogProxy::setLocation(int location)
if (m_location == location) { if (m_location == location) {
return; return;
} }
m_location = (Plasma::Location)location; m_location = (Plasma::Types::Location)location;
emit locationChanged(); emit locationChanged();
} }

View File

@ -161,7 +161,7 @@ protected:
void focusOutEvent(QFocusEvent *ev); void focusOutEvent(QFocusEvent *ev);
QTimer *m_syncTimer; QTimer *m_syncTimer;
Plasma::Location m_location; Plasma::Types::Location m_location;
Plasma::FrameSvgItem *m_frameSvgItem; Plasma::FrameSvgItem *m_frameSvgItem;
QWeakPointer<QQuickItem> m_mainItem; QWeakPointer<QQuickItem> m_mainItem;
QWeakPointer<QQuickItem> m_visualParent; QWeakPointer<QQuickItem> m_visualParent;

View File

@ -599,7 +599,7 @@ KShortcut Applet::globalShortcut() const
return KShortcut(); return KShortcut();
} }
Location Applet::location() const Types::Location Applet::location() const
{ {
Containment *c = containment(); Containment *c = containment();
return c ? c->d->location : Plasma::Types::Desktop; return c ? c->d->location : Plasma::Types::Desktop;

View File

@ -150,7 +150,7 @@ class PLASMA_EXPORT Applet : public QObject
/** /**
* Returns the location of the scene which is displaying applet. * Returns the location of the scene which is displaying applet.
* *
* @see Plasma::Location * @see Plasma::Types::Location
*/ */
Types::Location location() const; Types::Location location() const;

View File

@ -254,7 +254,7 @@ Q_SIGNALS:
* Emitted when the location has changed * Emitted when the location has changed
* @since 5.0 * @since 5.0
*/ */
void locationChanged(Plasma::Location location); void locationChanged(Plasma::Types::Location location);
/** /**
* Emitted when the formFactor has changed * Emitted when the formFactor has changed
@ -270,7 +270,7 @@ Q_SIGNALS:
* *
* @param location the new location of this Corona * @param location the new location of this Corona
*/ */
void setLocation(Plasma::Location location); void setLocation(Plasma::Types::Location location);
/** /**
* Sets the form factor for this Containment. This may cause changes in both * Sets the form factor for this Containment. This may cause changes in both

View File

@ -257,9 +257,9 @@ void Corona::setImmutability(const ImmutabilityType immutable)
} }
} }
QList<Plasma::Location> Corona::freeEdges(int screen) const QList<Plasma::Types::Location> Corona::freeEdges(int screen) const
{ {
QList<Plasma::Location> freeEdges; QList<Plasma::Types::Location> freeEdges;
freeEdges << Plasma::Types::TopEdge << Plasma::Types::BottomEdge freeEdges << Plasma::Types::TopEdge << Plasma::Types::BottomEdge
<< Plasma::Types::LeftEdge << Plasma::Types::RightEdge; << Plasma::Types::LeftEdge << Plasma::Types::RightEdge;

View File

@ -127,7 +127,7 @@ public:
* @param screen the id of the screen to look for free edges. * @param screen the id of the screen to look for free edges.
* @returns a list of free edges not filled with panel type containments. * @returns a list of free edges not filled with panel type containments.
*/ */
QList<Plasma::Location> freeEdges(int screen) const; QList<Plasma::Types::Location> freeEdges(int screen) const;
/** /**
* The actions assocated with this Corona * The actions assocated with this Corona

View File

@ -180,7 +180,7 @@ FrameSvg::EnabledBorders FrameSvg::enabledBorders() const
} }
} }
void FrameSvg::setElementPrefix(Plasma::Location location) void FrameSvg::setElementPrefix(Plasma::Types::Location location)
{ {
switch (location) { switch (location) {
case Types::TopEdge: case Types::TopEdge:
@ -283,7 +283,7 @@ bool FrameSvg::hasElementPrefix(const QString & prefix) const
} }
} }
bool FrameSvg::hasElementPrefix(Plasma::Location location) const bool FrameSvg::hasElementPrefix(Plasma::Types::Location location) const
{ {
switch (location) { switch (location) {
case Types::TopEdge: case Types::TopEdge:

View File

@ -166,7 +166,7 @@ class PLASMA_EXPORT FrameSvg : public Svg
* called successfully after setImagePath is called. * called successfully after setImagePath is called.
* @param location location in the UI this frame will be drawn * @param location location in the UI this frame will be drawn
*/ */
Q_INVOKABLE void setElementPrefix(Plasma::Location location); Q_INVOKABLE void setElementPrefix(Plasma::Types::Location location);
/** /**
* Sets the prefix for the SVG elements to be used for painting. For example, * Sets the prefix for the SVG elements to be used for painting. For example,
@ -201,7 +201,7 @@ class PLASMA_EXPORT FrameSvg : public Svg
* to draw a frame. * to draw a frame.
* @param location the given prefix we want to check if drawable * @param location the given prefix we want to check if drawable
*/ */
Q_INVOKABLE bool hasElementPrefix(Plasma::Location location) const; Q_INVOKABLE bool hasElementPrefix(Plasma::Types::Location location) const;
/** /**
* Returns the prefix for SVG elements of the FrameSvg * Returns the prefix for SVG elements of the FrameSvg

View File

@ -305,7 +305,7 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati
typedef Types::ContainmentType ContainmentType; typedef Types::ContainmentType ContainmentType;
typedef Types::ActionType ActionType; typedef Types::ActionType ActionType;
typedef Types::Direction Direction; typedef Types::Direction Direction;
typedef Types::Location Location; //typedef Types::Location Location;
typedef Types::Position Position; typedef Types::Position Position;
typedef Types::PopupPlacement PopupPlacement; typedef Types::PopupPlacement PopupPlacement;
typedef Types::FlipDirection FlipDirection; typedef Types::FlipDirection FlipDirection;

View File

@ -134,7 +134,7 @@ public:
void updateAndSignalSizes(); void updateAndSignalSizes();
QSizeF frameSize(FrameData *frame) const; QSizeF frameSize(FrameData *frame) const;
Location location; Types::Location location;
QString prefix; QString prefix;
FrameSvg *q; FrameSvg *q;

View File

@ -47,7 +47,7 @@ public:
void setContainment(Plasma::Containment *cont); void setContainment(Plasma::Containment *cont);
Plasma::Containment *containment() const; Plasma::Containment *containment() const;
//FIXME: Plasma::Location should be something qml can understand //FIXME: Plasma::Types::Location should be something qml can understand
int location() const; int location() const;
void setLocation(int location); void setLocation(int location);

View File

@ -60,10 +60,10 @@ public:
} }
void initFilters(); void initFilters();
void init(Plasma::Location loc); void init(Plasma::Types::Location loc);
void initRunningApplets(); void initRunningApplets();
void containmentDestroyed(); void containmentDestroyed();
void setLocation(Plasma::Location loc); void setLocation(Plasma::Types::Location loc);
void finished(); void finished();
/** /**
@ -78,7 +78,7 @@ public:
//this orientation is just for convenience, is the location that is important //this orientation is just for convenience, is the location that is important
Qt::Orientation orientation; Qt::Orientation orientation;
Plasma::Location location; Plasma::Types::Location location;
WidgetExplorer *q; WidgetExplorer *q;
QString application; QString application;
Plasma::Containment *containment; Plasma::Containment *containment;
@ -146,7 +146,7 @@ void WidgetExplorerPrivate::initFilters()
} }
void WidgetExplorerPrivate::init(Plasma::Location loc) void WidgetExplorerPrivate::init(Plasma::Types::Location loc)
{ {
// q->setFocusPolicy(Qt::StrongFocus); // q->setFocusPolicy(Qt::StrongFocus);
@ -211,7 +211,7 @@ void WidgetExplorerPrivate::finished()
declarativeWidget->rootObject()->setProperty("extraActions", QVariant::fromValue(actionList));*/ declarativeWidget->rootObject()->setProperty("extraActions", QVariant::fromValue(actionList));*/
} }
void WidgetExplorerPrivate::setLocation(const Plasma::Location loc) void WidgetExplorerPrivate::setLocation(const Plasma::Types::Location loc)
{ {
Qt::Orientation orient; Qt::Orientation orient;
if (loc == Plasma::Types::LeftEdge || loc == Plasma::Types::RightEdge) { if (loc == Plasma::Types::LeftEdge || loc == Plasma::Types::RightEdge) {
@ -364,7 +364,7 @@ void WidgetExplorerPrivate::appletRemoved(Plasma::Applet *applet)
//WidgetExplorer //WidgetExplorer
WidgetExplorer::WidgetExplorer(Plasma::Location loc, QObject *parent) WidgetExplorer::WidgetExplorer(Plasma::Types::Location loc, QObject *parent)
:QObject(parent), :QObject(parent),
d(new WidgetExplorerPrivate(this)) d(new WidgetExplorerPrivate(this))
{ {
@ -383,7 +383,7 @@ WidgetExplorer::~WidgetExplorer()
delete d; delete d;
} }
void WidgetExplorer::setLocation(Plasma::Location loc) void WidgetExplorer::setLocation(Plasma::Types::Location loc)
{ {
d->setLocation(loc); d->setLocation(loc);
emit(locationChanged(loc)); emit(locationChanged(loc));

View File

@ -102,7 +102,7 @@ public:
RightEdge /**< Along the right side of the screen */ RightEdge /**< Along the right side of the screen */
}; };
explicit WidgetExplorer(Plasma::Location loc, QObject *parent = 0); explicit WidgetExplorer(Plasma::Types::Location loc, QObject *parent = 0);
explicit WidgetExplorer(QObject *parent = 0); explicit WidgetExplorer(QObject *parent = 0);
~WidgetExplorer(); ~WidgetExplorer();
@ -134,7 +134,7 @@ public:
Plasma::Corona *corona() const; Plasma::Corona *corona() const;
void setLocation(const Plasma::Location loc); void setLocation(const Plasma::Types::Location loc);
//FIXME: it's asymmetric due to the problems of QML of exporting enums //FIXME: it's asymmetric due to the problems of QML of exporting enums
WidgetExplorer::Location location(); WidgetExplorer::Location location();
@ -152,7 +152,7 @@ public:
//Q_INVOKABLE QPoint tooltipPosition(QGraphicsObject *item, int tipWidth, int tipHeight); //Q_INVOKABLE QPoint tooltipPosition(QGraphicsObject *item, int tipWidth, int tipHeight);
Q_SIGNALS: Q_SIGNALS:
void locationChanged(Plasma::Location loc); void locationChanged(Plasma::Types::Location loc);
void orientationChanged(); void orientationChanged();
void closeClicked(); void closeClicked();
void widgetsMenuActionsChanged(); void widgetsMenuActionsChanged();