diff options
author | aavit <eirik.aavitsland@digia.com> | 2014-09-10 14:50:28 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@digia.com> | 2014-10-08 11:37:49 +0300 |
commit | 3d6bb94a9e7c80edc4b2a2321b464533a4a7f60b (patch) | |
tree | c164a2bd67eb0b172398c38c471b9be5d9bea4ce /src/qt_hw_init | |
parent | 20b464d745b7ae319a89d9c2b14c5dcf7364c250 (diff) |
Rename DroidUtils -> B2QtUtils and refactor the API
Preparing this module for being documented and presented for
external users.
- Renamed since this is for eLinux as well as eAndroid
- Provide all settings as proper Q_PROPERTYs for easy QML access
- Hide all the detailed audio stuff that's not useful for users
- Implement a getter function for current backlight, so that we don't
have to reset it to full every time this module is loaded
- qmake now groks this as internal module, so get rid build kludges
- hostname setting on eLinux fixed
- getIPAddress() now returns ALL active addresses, and implentation
is simplified
Task-number: QTEE-704
Change-Id: I9f22d5531b5963ae7e78c840bcfe1edd6197f82a
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Diffstat (limited to 'src/qt_hw_init')
-rw-r--r-- | src/qt_hw_init/main.cpp | 28 | ||||
-rw-r--r-- | src/qt_hw_init/qt_hw_init.pro | 4 |
2 files changed, 6 insertions, 26 deletions
diff --git a/src/qt_hw_init/main.cpp b/src/qt_hw_init/main.cpp index 554004c..7a8b3a1 100644 --- a/src/qt_hw_init/main.cpp +++ b/src/qt_hw_init/main.cpp @@ -16,33 +16,15 @@ ** the contact form at http://qt.digia.com/ ** ****************************************************************************/ -#include "../utils/qdroidutils.h" -#include <QDebug> - -static void setMaxVolume(QDroidUtils *utils) -{ - // Set the audio orientation to something to force the HW driver to reconfigure - // audio routing (workaround for bug on Nexus 7) - utils->setOrientationForAudioSystem(QDroidUtils::LandscapeAudioOrientation); - utils->setMasterVolume(100); - utils->setMasterMute(false); - utils->setStreamVolume(QDroidUtils::SystemAudioStream, 100); - utils->setStreamVolume(QDroidUtils::MusicAudioStream, 100); - utils->setStreamVolume(QDroidUtils::NotificationAudioStream, 100); - utils->setStreamVolume(QDroidUtils::EnforcedAudibleAudioStream, 100); -} - -static void setDisplayBrightness(QDroidUtils *utils) -{ - utils->setDisplayBrightness(255); -} +#include "b2qtdevice.h" int main(int, char *[]) { - QDroidUtils utils; + B2QtDevice device; + + device.initAudio(); - setMaxVolume(&utils); - setDisplayBrightness(&utils); + device.setDisplayBrightness(255); return 0; } diff --git a/src/qt_hw_init/qt_hw_init.pro b/src/qt_hw_init/qt_hw_init.pro index 879e450..4784926 100644 --- a/src/qt_hw_init/qt_hw_init.pro +++ b/src/qt_hw_init/qt_hw_init.pro @@ -1,10 +1,8 @@ TEMPLATE = app TARGET = qt_hw_init QT -= gui -QT += droidutils +QT += b2qtutils SOURCES += main.cpp -LIBS += -lQt5DroidUtils - load(qt_tool) |