[Merge] lp:~gerboland/qtubuntu/exposeOrientation into lp:qtubuntu
Daniel d'Andrada
daniel.dandrada at canonical.com
Fri Aug 29 15:10:11 UTC 2014
Review: Needs Fixing
In src/ubuntumirclient/input.cpp
"""
LOG("ORIENTATION direction:%d", event->orientation.direction);
"""
Convert the enum value to a nice human-readable string, please.
""""
Qt::ScreenOrientation orientation;
switch (event->orientation.direction) {
case U_ORIENTATION_NORMAL:
orientation = Qt::PortraitOrientation;
break;
case U_ORIENTATION_LEFT:
orientation = Qt::LandscapeOrientation;
break;
case U_ORIENTATION_INVERTED:
orientation = Qt::InvertedPortraitOrientation;
break;
case U_ORIENTATION_RIGHT:
orientation = Qt::InvertedLandscapeOrientation;
break;
default:
DLOG("No such orientation %d", event->orientation.direction);
return;
}
// Dispatch orientation event to [Platform]Screen, as that is where Qt reads it. Screen will handle
// notifying Qt of the actual orientation change - done to prevent multiple Windows each creating
// an identical orientation change event and passing it directly to Qt.
// [Platform]Screen can also factor in the native orientation.
QCoreApplication::postEvent(static_cast<UbuntuScreen*>(window->screen()->handle()),
new OrientationChangeEvent(OrientationChangeEvent::mType, orientation));
""""
Then please use the same nomenclature that the mir event uses in that internal OrientationChangeEvent, thus avoiding mentioning landscape or portrait at this point, which is misleading. You could stick with the QOrientationReading::Orientation enum.
--
https://code.launchpad.net/~gerboland/qtubuntu/exposeOrientation/+merge/232252
Your team Ubuntu Phablet Team is subscribed to branch lp:qtubuntu.
More information about the Ubuntu-reviews
mailing list