Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lipstick] Use QOrientationSensor to get updates about current device or... #90

Merged
merged 1 commit into from Oct 10, 2013

Conversation

bzeller
Copy link
Contributor

@bzeller bzeller commented Sep 30, 2013

...ientation

@@ -39,11 +40,16 @@
QObject::connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(clearUpdateRequest()));
connect(m_displayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(reactOnDisplayStateChanges(MeeGo::QmDisplayState::DisplayState)));

m_orientationSensor = new QOrientationSensor(this);
QObject::connect(m_orientationSensor,SIGNAL(readingChanged()),this,SLOT(orientationSensorChanged()));
m_orientationSensor->start();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to call m_orientationSensor->connectToBackend(); before the call to start().

I know, its a bad legacy API design, and unfortunately, we are stuck with it.

You might also look into setting a rate. Some sensor devices only fire off with a change, others do polling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok no problem, but it worked without the call to connectToBackend.

Any idea what rate would be good?

@rburchell
Copy link
Contributor

@Vesuri, what do you think about doing orientation handling in C++?

@Vesuri
Copy link

Vesuri commented Oct 7, 2013

@rburchell I don't see why it shouldn't be done on the C++ side. Otherwise all QML implementations have to add it separately.

@@ -39,6 +40,7 @@ BuildRequires: pkgconfig(contextkit-statefs) >= 0.2.7
BuildRequires: qt5-qttools-linguist
BuildRequires: qt5-qtwayland-wayland_egl-devel >= 5.1.0+git7
BuildRequires: doxygen
Requires: qt5-qtsensors-plugin-sensorfw
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it should be qt5-qtdeclarative-import-sensors.
...-sensorfw will be the one going into patterns, so not needed here (I'm pressing hard those responsible ;) bear with me rrrrrr :))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rburchell pointed out he doesn't need the QML module

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patterns are sorted out now. @bzeller, to sum up (squashing with @faenil's remark), please perform the following:

-BuildRequires: pkgconfig(Qt5Qml)
...
-Requires: qt5-qtsensors-plugin-sensorfw
+Requires: qt5-qtdeclarative-import-sensors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, does he need the declarative sensors? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xo correction :D he doesn't (as per #90 (comment) )
So yes, final view:
-BuildRequires: pkgconfig(Qt5Qml)
...
-Requires: qt5-qtsensors-plugin-sensorfw

Many thanks @faenil for pointing this out

… orientation

Call connect to backend

Fix style

Fixed problems pointed out by @Vesuri

removed unneeded packages from spec file
@sledges
Copy link
Contributor

sledges commented Oct 10, 2013

LVGTM :)
/me pulls the trigger

sledges added a commit that referenced this pull request Oct 10, 2013
[lipstick] Use QOrientationSensor to get updates about current device or...
@sledges sledges merged commit d19cbec into nemomobile:master Oct 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants