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.
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 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 in constructor to switch statement

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
specfile
debug & callgrind
property debug