cplusplus: Make functions of Icons static

This avoids multiple instatiations and reloading of the same image files.

Change-Id: I4d0bb955e23c1cb817671c25bff4e74fb7b3d0f4
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-04-06 10:08:01 +02:00
parent 44aaec767f
commit 984a6eca73
13 changed files with 140 additions and 168 deletions

View File

@@ -25,6 +25,7 @@
#include "searchsymbols.h"
#include <cplusplus/Icons.h>
#include <cplusplus/LookupContext.h>
#include <utils/qtcassert.h>
#include <utils/scopedswap.h>
@@ -292,7 +293,7 @@ IndexItem::Ptr SearchSymbols::addChildItem(const QString &symbolName, const QStr
m_paths.insert(symbol->fileId(), path);
}
const QIcon icon = icons.iconForSymbol(symbol);
const QIcon icon = Icons::iconForSymbol(symbol);
IndexItem::Ptr newItem = IndexItem::create(findOrInsert(symbolName),
findOrInsert(symbolType),
findOrInsert(symbolScope),