Windows QPA: Replace some ugly typedefs by auto.

Change-Id: I5fc6afe1e67dccb4fb7745edbbdf7d742b26d384
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
This commit is contained in:
Friedemann Kleint 2015-08-21 08:53:02 +02:00
parent 561acde140
commit 5a96e49145
2 changed files with 3 additions and 7 deletions

View File

@ -239,8 +239,6 @@ private:
};
typedef QMap<Qt::DropAction, CursorEntry> ActionCursorMap;
typedef ActionCursorMap::Iterator ActionCursorMapIt;
typedef ActionCursorMap::ConstIterator ActionCursorMapConstIt;
const Mode m_mode;
QWindowsDrag *m_drag;
@ -318,7 +316,7 @@ void QWindowsOleDropSource::createCursors()
if (cursorPixmap.isNull())
cursorPixmap = m_drag->defaultCursor(action);
const qint64 cacheKey = cursorPixmap.cacheKey();
const ActionCursorMapIt it = m_cursors.find(action);
const auto it = m_cursors.find(action);
if (it != m_cursors.end() && it.value().cacheKey == cacheKey)
continue;
if (cursorPixmap.isNull()) {
@ -447,7 +445,7 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
m_drag->updateAction(action);
const qint64 currentCacheKey = m_drag->currentDrag()->dragCursor(action).cacheKey();
ActionCursorMapConstIt it = m_cursors.constFind(action);
auto it = m_cursors.constFind(action);
// If a custom drag cursor is set, check its cache key to detect changes.
if (it == m_cursors.constEnd() || (currentCacheKey && currentCacheKey != it.value().cacheKey)) {
createCursors();

View File

@ -145,10 +145,8 @@ static FontKeys &fontKeys()
static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
{
typedef FontKeys::ConstIterator ConstIt;
const FontKeys &keys = fontKeys();
for (ConstIt it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) {
for (auto it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) {
const int index = it->fontNames.indexOf(name);
if (index >= 0) {
if (indexIn)