Merge pull request #35 from xhaakon/speculative-property-caching

[performance] Reduce number of queries to tracker

With this PR, queries to tracker are more often for all needed properties at once, and they are queried and cached a whole directory at a time instead of being queried for each object. This improves performance by removing per-query overhead.

This also speeds up the MTP GetObjectPropList operation (which can ask for all properties of all objects in one big list), which sometimes took so long that the protocol timed out.
Fix return value of StorageFactory::setObjectPropertyValue()

Bug introduced in e578f5a5a50bfa696a1925d28812cb61199db354.
Merge pull request #39 from xhaakon/update

Fix return value of StorageFactory::setObjectPropertyValue()
Remove MTPEvent::transMap

In its current state it has no purpose and from the extant comments it's
not apparent what it was meant to serve for.
Move cache invalidation on ObjectPropChanged event into StorageFactory

More logical place where to handle the cache.
Move MTP event dispatch into MTPResponder

StorageFactory::eventReceived() renamed to onStorageEvent() and now only
invalidates contents of ObjectPropertyCache on ObjectPropChanged event.
Remove redundant qRegisterMetaType() in StorageFactory

Those types are already registered in MTPResponder::instance(), which
must have been called before StorageFactory is instantiated.
Remove MTPEvent class

The only thing left there was creating MTPTxContainer and sending it,
which can be done in MTPResponder::dispatchEvent().

MTPEventThread class looked like an incomplete stub and wasn't used
anywhere in the code.
[propertypod] convert if-else if to switch statement in constructor

Results in less cluttered code.
Taken advantage of implicit type conversions to QVariant.
Ordered cases by MTP_DEV_PROPERTY value.
[deviceinfo] refactor DeviceInfo::getBatteryLevelForm()

Method now returns a QVariant holding either MtpRangeForm or MtpEnumForm
structure depending on the actual format of the device property.

Its test case updated accordingly.
Reformat PropertyPod::getDevicePropDesc()

Less code nesting.
Utilize implicit conversions to QVariant.
Ordered cases by MTP_DEV_PROPERTY value.
Rename getBatteryLevelForm() -> batteryLevelForm()

Name now conforms with Qt coding standards for getters.
[deviceinfo] add support for reporting BatteryLevel (0x5001)

We get battery level from UPower and are notified about the value's
changes.
Added a note about misleading MTP 1.1 device properties specification
[mtp] send DevicePropChanged on battery level change
Merge pull request #40 from xhaakon/battery-level

[mtp] Report battery level as a device property
[build] remove nonexistent ptest.h from HEADERS in test.pro

Fixes a warning during build.
Remove pre-Qt5 compat code from DeviceInfoProvider::getSystemInfo()
Allocate temporary QDeviceInfo on stack

Just why complicate things when they don't have to be?
[deviceinfo] send both OS and HW adaptation versions in MTP device info

Example version string now:
 1.0.4.385 (Ohijärvi) (armv7hl,devel) HW: 0.0.3.188 (armv7hl,devel)