summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused field.BogDan Vatra2013-11-011-7/+0
| | | | | | | Fix crash on Android 4.4 Change-Id: Ibee584c0154b0b116af58477302e7e8385f0290d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Handle virtual keyboard visibility changes.BogDan Vatra2013-11-013-2/+35
| | | | | | | | | emitInputPanelVisibleChanged when virtual keyboard visibility is changed. Task-number: QTBUG-34347 Change-Id: Iab7374db42ff8ce6f33dcc793b23f84d3c8692d5 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Don't rely on QIcon::isNull() to validate icon data.Christian Strømme2013-10-301-4/+6
| | | | | | | | | | | QIcon::isNull() only checks if it has a valid d pointer and not if it actually contains any image data. The result is that the QImage create from the icon would be invalid, and later cause an exception to be thrown. To avoid this we should check the QImage as well. Task-number: QTBUG-34416 Change-Id: I9dd0a2387d73bfc2c27ceb9df247ddc186dd659f Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Re-enable NonFullScreenWindows on AndroidEskil Abrahamsen Blomfeldt2013-10-291-1/+0
| | | | | | | | | | | | This flag was created because the eglfs plugin did not support non-fullscreen raster windows. Now that it does, we can remove it again. Turns out this also fixes several issues with positioning and sizing of dialogs due to bugs in the implementation of the flag. Task-number: QTBUG-33846, QTBUG-33499, QTBUG-32537, QTBUG-32297, QTBUG-31457 Change-Id: I3902ae57d49d77e3c1046ec57b6f6926f70ec6a4 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Don't crash if the screen is not yet initialized.BogDan Vatra2013-10-281-2/+4
| | | | | Change-Id: I4751c2dec5780f42b348a8a8ea628f65d548dcec Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Fix repaint on rotationEskil Abrahamsen Blomfeldt2013-10-255-15/+10
| | | | | | | | | | | | | After f89f099c55576992b39a8021aace64ff32747624, we no longer post a geometry-change and expose event when calling setGeometry, which the Android plugin depended on. This caused the window to stay the same size when it was resized by orientation changes. We put back the events in the code that calls setGeometry() instead. Task-number: QTBUG-32878 Change-Id: I449515dda07c839e0991c5a7031a972ca9c74dff Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Don't crash if the platform plugin is not initializedBogDan Vatra2013-10-231-0/+3
| | | | | Change-Id: I999411816192edbd2bf40c6bda92d6e94fb3d1b0 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Make platform menu more robustPaul Olav Tvete2013-10-231-3/+5
| | | | | | | | | Don't crash and lock up the whole device when people try to remove menu items that don't exist. Task-number: QTBUG-34246 Change-Id: I4396d252c5af93e021c9e218dbab7c0e7f190d9d Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Accessibilty: Handle text betterFrederik Gladhorn2013-10-201-3/+15
| | | | | | | | Try harder to actually return text, before TalkBack would not read the contents of line edits and other text widgets. Change-Id: Ibb9bb8ac4a2728674f6f5ccf29eda5ed66a81a34 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Remove unused includeBogDan Vatra2013-10-161-1/+0
| | | | | Change-Id: I77bd22b3e0314686450343c5a52914d7f97298d3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: don't set autorepeat to true by defaultPaul Olav Tvete2013-10-161-2/+2
| | | | | | | | | | When we don't know if a key event is caused by autorepeat, then the safest assumption is that it is not. Task-number: QTBUG-30793 Change-Id: Iea6aba164e299f0f2c772547b45df6a49639b7e9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Make it possible to pass arguments via intent extrasEskil Abrahamsen Blomfeldt2013-10-161-5/+2
| | | | | | | | | | | | | | | Needed for autotest script, so that we can pass command line arguments to Qt Test. This can now be done by: % adb shell am start \ -e applicationArguments "argument1 argument2" \ <INTENT> Change-Id: I772209f66da055c6a0b01b709f36e33fdb5c2ed6 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Update keycode mappings of multimedia keysAllan Sandfeld Jensen2013-10-151-6/+44
| | | | | | | Updates keycode mappings for evdev, directfb and android. Change-Id: I6789f13dbb662da4261a3c947757644e12306dd9 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix backspace bug with 4.3 stock keyboardPaul Olav Tvete2013-10-092-3/+111
| | | | | | | | | | The Android 4.3 keyboard will cause setComposingRegion() to be called when backspacing over an existing word. If we don't implement that, the editor will be out of sync with the input method. Task-number: QTBUG-32955 Change-Id: I6c4ff786269a4e74c70a093c5f03c4c5a5727dd5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QPA: Fix semantics of GUI event dispatcher ownership in platform pluginsTor Arne Vestbø2013-09-302-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformIntegration::guiThreadEventDispatcher() function acted as an accessor to event dispatchers created in the constructor of each platform plugin, but the logic and semantics of event-dispatcher handling in Qt itself (QCoreApplication/QGuiApplication) still assumed both ownership and control over the event dispatcher, such as when to create one, which one to create, and when to delete it. This conflicted with the explicit calls in the platform plugins to QGuiApplication::setEventDispatcher(), as well as left a possibility that the event-dispatcher created by the platform plugin would never be deleted, as none of the platform plugins actually took full ownership of the dispatcher and deleted it in its destructor. The integration function has now been renamed back to its old name, createEventDispatcher(), and acts as a factory function, leaving the logic and lifetime of event dispatcher to QtCoreApplication. The only platform left with creating the event-dispatcher in the constructor is QNX, where other parts of the platform relies on having an event-dispatcher before their initialization. We then need to manually take care of the ownership transfer, so that the event-dispatcher is still destroyed at some point. Change-Id: I113db97d2545ebda39ebdefa865e488d2ce9368b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Android: remove environment variable warnings at app startup.Yoann Lopes2013-09-251-1/+1
| | | | | Change-Id: I8542809fd16465a29b4fb7e8276b63d71e1b9c0e Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Use the new QJNI api in our QLocale implementation.Christian Strømme2013-09-201-11/+9
| | | | | | | This change makes use of the private QJNI api that now exists in QtCore. Change-Id: Id03664942d6c6cbfec028a3b52729057153a8466 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix android after Eglfs binary compatibility breakPaul Olav Tvete2013-09-201-2/+3
| | | | | Change-Id: I95d98b475188b43f1e0946c7ad6fd2388839d619 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Android: handle inverted orientationsPaul Olav Tvete2013-09-206-11/+69
| | | | | | | | | | Add logic to detect InvertedPortrait and InvertedLandscape orientations and implement QPlatformScreen::nativeOrientation() for Android. Task-number: QTBUG-32144 Change-Id: I294506714ea0faa9eacd7a15e1cfc45342659964 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Make font size compatible with Qt for iOSPaul Olav Tvete2013-09-123-2/+7
| | | | | | | | | | | | We recommend using pixel sizes for predictable results. For those who use point sizes in their UIs, we will now give them results that look similar to what we do on iOS. The default font is changed to give the same size as before this change. Task-number: QTBUG-32096 Change-Id: Ia25506ba721a39d31340f3df8bc14129e507af14 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-09-104-21/+43
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devSergio Ahumada2013-09-074-21/+43
| |\ | | | | | | | | | Change-Id: I9ee4176f0a0078908d49896508826154c9f71530
| | * Merge remote-tracking branch 'origin/release' into stableSergio Ahumada2013-08-284-21/+43
| | |\ | | | | | | | | | | | | Change-Id: I815757e33b6c0b1e702c8e386e8e30307f78e318
| | | * Android: Fix orientation change on Android 4.3Eskil Abrahamsen Blomfeldt2013-08-194-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android 4.3, we will get a new native window pointer for the same surface (the old surface has not been destroyed), whereas before we would get the same pointer, thus hitting the "sameNativeWindow" branch. This revealed some bugs in the surfaceChanged code path when the old surface had not been destroyed. This path is now taken both when there's no old surface (the app has been suspended in the mean time) and when the orientation changes. To handle the second case, we need to make sure: 1. We update the static pointer 2. We update the pointers in the platform windows 3. We don't add a second reference to the static data for windows 4. We schedule an update of the window size Task-number: QTBUG-32878 Change-Id: I47257615f9ba820315fc98d7a804e52223f430bf Reviewed-by: Christian Stromme <christian.stromme@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | | | Fix Android Style plugin.BogDan Vatra2013-09-104-4/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-29565 Change-Id: Iedb861962e3638bcbdf9d9a72a47bebc63b425b9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | | | Android: Fix unused variable/argument warningsEskil Abrahamsen Blomfeldt2013-09-092-14/+2
|/ / / | | | | | | | | | | | | | | | | | | There were a bunch of these in Android specific code. Change-Id: Icf6cda40302171810c1b559f9d442fba6444a3a5 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-09-021-1/+0
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-271-1/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| | * | Android: Remove EGL_BAD_SURFACE warning on suspensionEskil Abrahamsen Blomfeldt2013-08-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When suspending the app we would destroy the surface twice, causing libEGL to output a warning on the second attempt. We would also destroy the surface before all references were released which is not 100% nice. We don't need to call the super class implementation at all, since we are managing the EGL surface ourselves. Change-Id: Ie1ab2ea8561d0018b5f16ac8cdf3296313a0a92c Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* | | | Android: added ApplicationState capability.Yoann Lopes2013-08-286-0/+44
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The application state is tied to the QtActivity lifecycle. Mapping of states between Android and Qt is as follows: onResume --> ApplicationActive onPause --> ApplicationInactive onStop --> ApplicationSuspended Change-Id: Iefef08d6c7a7fde28fba1f4886882458cda6a0c0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | | Accessibility for AndroidFrederik Gladhorn2013-08-228-1/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables both modes for TalkBack, explore-by-touch and the normal swiping mode. It is partially inspired by the BarGraphView example of the Google/Android Eyes-Free project. Note that for any accessibility to work you'll need a device with api level 16 at least. Using reflection we should be able to dynamically pick up the classes if we have the high enough api level. Change-Id: I11b93bead451483782a1711434d45c8f9a35996f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-142-0/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * | Add workaround for GL on Android emulatorEskil Abrahamsen Blomfeldt2013-07-292-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | On the Android Emulator, the shaders will be compiled by a desktop GL driver, since the GL driver in the emulator is just a thin wrapper. The GL driver does not necessarily support the precision qualifiers, which can cause applications to break. We detect this at runtime in the platform plugin and set a workaround flag to Task-number: QTBUG-32557 Change-Id: Ied00cfe8e804d1f7862697dd379a14f3bed3d980 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Android: Fix crash when setting WA_NativeWindowEskil Abrahamsen Blomfeldt2013-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We don't support native widgets in Android, so we can get into a mess when people set this widget attribute, since the FB compositor will assume that all widgets have their own backing store. This adds a capability flag to the QPlatformIntegration which allows the plugin to disable the WA_NativeWindow feature. Task-number: QTBUG-32685 Change-Id: Ic200487da4a297f71ab594cf7c90d1e1d53bacd3 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Bump QPA-API-version.Friedemann Kleint2013-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Changes f5dbc876378ae58a7bdfe1e9664fc81caca18dfb (Use QUrl in QFileDialog API) and c96a6ab627100452864eb4d8da973300401c1bfa (Pass argc, argv to platform plugin) introduced changes to the plugin API. Task-number: QTBUG-29396 Change-Id: I46ee22d16f045b69f141dc6c982017586efef662 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* | Merge branch 'stable' into devSergio Ahumada2013-07-112-0/+12
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Android: Fix initial window size for raster backendPaul Olav Tvete2013-06-262-0/+12
| | | | | | | | | | | | | | | | | | | | | | We forgot to set the ShowIsFullScreen property for the raster engine case. OpenGL windows already did the right thing, since the GL backend is based on eglFS. The iOS backend also has this logic. Task-number: QTBUG-31984 Change-Id: I1cf5df32d79f441768126f00632107a7971eb5ad Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Key mappings for more remote-control keysAllan Sandfeld Jensen2013-07-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | We are missing a few key mappings to have support for remote control keys supported by Android and DirectFB. This patch adds the four color keys Red/Green/Yellow/Blue and ChannelUp and ChannelDown. Change-Id: I4d859c28e0d61c5362f1212ba1e577a47de86ec1 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Implement system locale for AndroidEskil Abrahamsen Blomfeldt2013-07-045-2/+256
|/ | | | | | | | | | | | | On Android, we would default to C locale always. We need a connection to Java in order to get the locale, so this has to be done in the platform plugin rather than the QtCore library. It's enough to instantiate the QSystemLocale subclass, since this will automatically register itself as the current system locale. Task-number: QTBUG-31651 Change-Id: I76f3e30f7dff90e8101cb560cee2b96c9300d9af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android Mute and FastForward keys mapped wrongAllan Sandfeld Jensen2013-06-171-4/+7
| | | | | | | | | | | | | | KEYCODE_MEDIA_FAST_FORWARD is mapped to Qt::Key_Forward, which undoes Back. I believe the best match in Qt would be Qt::Key_AudioForward which is also mapped by XCB from XF86XK_AudioForward /* fast-forward audio track */ KEYCODE_MUTE is mapped to Qt::Key_Volume_Mute, but the mute button is for muting the microphone, the volume mute is called KEYCODE_VOLUME_MUTE. Change-Id: Id0b78c9bde78faef1f5d31019693e6c466941d70 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Disable long press on AndroidPaul Olav Tvete2013-06-101-0/+4
| | | | | | | | | | | | | | | | Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Never show EGLFS mouse cursor in Qt for Android platform pluginEskil Abrahamsen Blomfeldt2013-05-201-0/+7
| | | | | | | | | | | | | The hack to use the environment variable for turning off the mouse cursor is broken when running against Ministro, because Ministro does not pass the environment on. A better solution is to make it possible to turn the cursor in the EGLFS plugin off in the hooks instead. Task-number: QTBUG-30553 Change-Id: Id09b48c350d2c95de9bb174f7480cf0cd2bf8145 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Android: don't crash on exitPaul Olav Tvete2013-04-302-27/+21
| | | | | | | | | | | We have to call DetachCurrentThread() for each time we call AttachCurrentThread(). Fortunately we have this convenience class that we prepared earlier. Task-number: QTBUG-30847 Change-Id: I5ffb94b336d3787a3bae197bab22b91770d58848 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: fix crash on exitPaul Olav Tvete2013-04-261-1/+0
| | | | | | | | QTouchDevice is already automatically deleted at shutdown. Task-number: QTBUG-30847 Change-Id: Id6a407083efed849a34ccb1caa315204fc5a5891 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-187-33/+108
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Remove code for Android API level < 9Eskil Abrahamsen Blomfeldt2013-04-151-35/+2
| | | | | | | | We don't support API levels < 9, so we can simplify this code a little. Change-Id: I9823d4c5a44d265e03dec0ceedeeb3c34a1e1eab Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: set logicalDpi based on DisplayMetrics.scaledDensityPaul Olav Tvete2013-04-055-2/+24
| | | | | | | | | | | | | | The mathematically correct way would be to set logicalDPi to 160*scaledDensity, but then a 12 pt font would be gigantic. On iOS, we use a factor of 72 to be compatible with the native APIs, but that means that a 12 pt font is very small. A factor of 100 means that desktop apps look reasonable by default. Task-number: QTBUG-29674 Change-Id: I607f110150fb95685a6980b92f6f92f2b489f959 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Don't show '&' character in menusPaul Olav Tvete2013-04-041-6/+23
| | | | | | | | | Strip out shortcut indicator before showing the text. Task-number: QTBUG-30507 Change-Id: I8fa2ef8a2052f4c43d14b3babfd5aca0a08e29d5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Inform android input method when cursor is movedPaul Olav Tvete2013-03-222-0/+11
| | | | | | | | | | Google Japanese Input Beta keeps track of the cursor position, and bails out if the cursor is not where it thinks it should be. We have to tell the IM every time we move the cursor, not only when we are composing. Change-Id: I9cdb28f81c76e76d3b0125d08bf0595616ca443f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Remove QtWidgets dependency from Android platform pluginEskil Abrahamsen Blomfeldt2013-03-222-25/+4
| | | | | | | | | | | The setFullScreen() function was never called from anywhere, so it was just removed. The update() loop for top level widgets has been replaced by a loop sending expose events to top level windows. Task-number: QTBUG-29313 Change-Id: Ic31a05ad3a0693f1d3f61457cee9d78f6b334b4d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>