diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-08-05 13:05:17 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-08-05 11:45:23 +0000 |
commit | fc1c5670e943daa2e593294ed6eeb5e40e10dffa (patch) | |
tree | effc4818db68c6d8c505bfa8dfda4470f817a4aa | |
parent | 89486eb2109585f9bf0793e72e1a44b7ebf0d79c (diff) |
Remove QtSensors dependency
The only thing the Mir plugin used from QtSensors was the enum
QOrientationReading::Orientation.
Change-Id: I09ea17ddb243e079506c5969f60296f61b113bbb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/mirclient/input.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/mirclient/mirclient.pro | 2 | ||||
-rw-r--r-- | src/plugins/platforms/mirclient/orientationchangeevent_p.h | 15 | ||||
-rw-r--r-- | src/plugins/platforms/mirclient/screen.cpp | 8 |
4 files changed, 22 insertions, 13 deletions
diff --git a/src/plugins/platforms/mirclient/input.cpp b/src/plugins/platforms/mirclient/input.cpp index 97da21ef25..badbd1943c 100644 --- a/src/plugins/platforms/mirclient/input.cpp +++ b/src/plugins/platforms/mirclient/input.cpp @@ -470,19 +470,19 @@ void UbuntuInput::dispatchOrientationEvent(QWindow *window, const MirOrientation return; } - QOrientationReading::Orientation orientation; + OrientationChangeEvent::Orientation orientation; switch (mir_orientation) { case mir_orientation_normal: - orientation = QOrientationReading::TopUp; + orientation = OrientationChangeEvent::TopUp; break; case mir_orientation_left: - orientation = QOrientationReading::LeftUp; + orientation = OrientationChangeEvent::LeftUp; break; case mir_orientation_inverted: - orientation = QOrientationReading::TopDown; + orientation = OrientationChangeEvent::TopDown; break; case mir_orientation_right: - orientation = QOrientationReading::RightUp; + orientation = OrientationChangeEvent::RightUp; break; default: DLOG("No such orientation %d", mir_orientation); diff --git a/src/plugins/platforms/mirclient/mirclient.pro b/src/plugins/platforms/mirclient/mirclient.pro index c93fc530c0..c456f34c39 100644 --- a/src/plugins/platforms/mirclient/mirclient.pro +++ b/src/plugins/platforms/mirclient/mirclient.pro @@ -6,7 +6,7 @@ PLUGIN_CLASS_NAME = MirServerIntegrationPlugin !equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = - load(qt_plugin) -QT += core-private gui-private platformsupport-private sensors dbus +QT += core-private gui-private platformsupport-private dbus CONFIG += qpa/genericunixfontdatabase diff --git a/src/plugins/platforms/mirclient/orientationchangeevent_p.h b/src/plugins/platforms/mirclient/orientationchangeevent_p.h index 35a65f136f..1a6553155e 100644 --- a/src/plugins/platforms/mirclient/orientationchangeevent_p.h +++ b/src/plugins/platforms/mirclient/orientationchangeevent_p.h @@ -18,19 +18,28 @@ #define ORIENTATIONCHANGEEVENT_P_H #include <QEvent> -#include <QOrientationReading> #include "logging.h" class OrientationChangeEvent : public QEvent { public: - OrientationChangeEvent(QEvent::Type type, QOrientationReading::Orientation orientation) + enum Orientation { + Undefined = 0, + TopUp, + TopDown, + LeftUp, + RightUp, + FaceUp, + FaceDown + }; + + OrientationChangeEvent(QEvent::Type type, Orientation orientation) : QEvent(type) , mOrientation(orientation) { } static const QEvent::Type mType; - QOrientationReading::Orientation mOrientation; + Orientation mOrientation; }; #endif // ORIENTATIONCHANGEEVENT_P_H diff --git a/src/plugins/platforms/mirclient/screen.cpp b/src/plugins/platforms/mirclient/screen.cpp index 52aa8f501e..460761c4cb 100644 --- a/src/plugins/platforms/mirclient/screen.cpp +++ b/src/plugins/platforms/mirclient/screen.cpp @@ -210,22 +210,22 @@ void UbuntuScreen::customEvent(QEvent* event) { OrientationChangeEvent* oReadingEvent = static_cast<OrientationChangeEvent*>(event); switch (oReadingEvent->mOrientation) { - case QOrientationReading::LeftUp: { + case OrientationChangeEvent::LeftUp: { mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ? Qt::InvertedPortraitOrientation : Qt::LandscapeOrientation; break; } - case QOrientationReading::TopUp: { + case OrientationChangeEvent::TopUp: { mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ? Qt::LandscapeOrientation : Qt::PortraitOrientation; break; } - case QOrientationReading::RightUp: { + case OrientationChangeEvent::RightUp: { mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ? Qt::PortraitOrientation : Qt::InvertedLandscapeOrientation; break; } - case QOrientationReading::TopDown: { + case OrientationChangeEvent::TopDown: { mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ? Qt::InvertedLandscapeOrientation : Qt::InvertedPortraitOrientation; break; |