Attempt to fix kdevplatform_shell_environment

Issue fixed:
KDevplatform (External Script): executing command  "cat
"/default.sh""  in working-dir  "/home/krf/devel/src/kf5/extragear/kdevelop/kdevelop"
Optimize: preallocate size of list containers when known.
Fix indentation.
Cleanup code by getting rid of the "fast" aliases.

This code was just a horrible anti-pattern. Any decent compiler will
inline QVector usage and there is no need to keep the size in another
variable.

Furthermore note that QVector.resize will default-construct the
data members. This means 0 for numeric and pointer types.

Finally, we use int instead of unsigned (short) int to reference
the buckets now and generally cleanup the code here and there.
Prepare code to eventually shutdown the ItemRepository cleanly.

Currently, we just leak it all... Otherwise we get crashes
at shutdown since some ItemRepository data is still referenced,
e.g. in static variables which get destroyed on shutdown after
the ItemRepository is long gone. The biggest culprit here is,
who'd have guessed it, old-cpp.
Minor: Fix string in navigation tooltip
Make "Switch Declaration/Definition" language agnostic

Most of the code originated from oldcpp. It is completely language
agnostic and hence can be easily reused.

REVIEW: 119648
Merge remote-tracking branch 'origin/1.7'
Fix more compile warnings and cleanup the code a bit more.

The warnings where about uint vs. int comparisons. The cleanup
removes m_bucketHashSize as its just an alias to the compile-time
const bucketHashSize. This also allows us to remove the runtime
allocation of m_firstBucketForHash and just make it a direct array
member variable. Note that the ItemRepository is usually constructed
on the heap so this is fine.
Optimize: Store a list of unserialized child contexts.

Profiling shows that the repeated calls to deserialize the contents
of the indexed child contexts is quite costly. We now add a cache
of the unserialized data, and the serialized contents only get
touched when we change the list. Otherwise, i.e. in the majority
of cases, we can directly operate on the cache which is quicker.

Profiling the code completion test case in kdev-qmljs shows:

before: 23,379,658,719 instructions ( +-  0.15% )
after: 21,957,230,364 instructions, ( +-  0.16% )
Cleanup code and introduce DUContextDynamicData::d_func_dynamic.
Remove dead code.
Fix compiler warnings in release mode.
Optimize: Keep a cache of local declarations.

Similar to the cache of child contexts, this has a great impact
on the performance of the DUChain. Esp. findDeclarations is much
faster now as we don't have to repeatedly de-serialize the data.

The kdev-qmljs code completion unit test now runs approx. 13% faster.
The number of instructions also drops down from ca. 22 billion to
about 19.5 billion.
Optimize: Prefer IndexedIdentifier when calling findDeclarations.

This enables us to save many serialization roundtrips and speeds
up the identifier comparison checks.

This speeds up the kdev-qmljs unit test by another ~5%.
Use a QList directly instead of a KDevVarLengthArray in between.

We convert it to a QList eventually anyways so we can use it from
the beginning as well.
Cleanup code
Cleanup code.
Manually reduce the calls to the virtual function DUChainBase::url().

The compiler doesn't seem to know this stays constant and calls it
over and over again.
Optimize: Do not allocate top-level search node on the heap.

The list always contains at least this one search item. By reffing
it manually we can allocate it on the stack and still pass it to
the shared pointer without the risk of a double deletion.