diff options
author | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2016-04-06 10:08:01 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2016-04-06 08:48:32 +0000 |
commit | 984a6eca73d1cae6484c687a42125d614cf67752 (patch) | |
tree | 264b8cd488b60de7aa3cd2f9cc78196a2800fa0c /src/plugins/classview/classviewtreeitemmodel.cpp | |
parent | 44aaec767f7975a2b38faf632292c389e90053dc (diff) | |
download | qt-creator-984a6eca73d1cae6484c687a42125d614cf67752.tar.gz |
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>
Diffstat (limited to 'src/plugins/classview/classviewtreeitemmodel.cpp')
-rw-r--r-- | src/plugins/classview/classviewtreeitemmodel.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/plugins/classview/classviewtreeitemmodel.cpp b/src/plugins/classview/classviewtreeitemmodel.cpp index 2ce88dc31b..b00f8e3020 100644 --- a/src/plugins/classview/classviewtreeitemmodel.cpp +++ b/src/plugins/classview/classviewtreeitemmodel.cpp @@ -34,21 +34,6 @@ namespace ClassView { namespace Internal { -///////////////////////////////// TreeItemModelPrivate ////////////////////////////////// - -/*! - \class TreeItemModelPrivate - \brief The TreeItemModelPrivate class contains private class data for - the TreeItemModel class. - \sa TreeItemModel - */ -class TreeItemModelPrivate -{ -public: - //! icon provider - CPlusPlus::Icons icons; -}; - ///////////////////////////////// TreeItemModel ////////////////////////////////// /*! @@ -57,14 +42,12 @@ public: */ TreeItemModel::TreeItemModel(QObject *parent) - : QStandardItemModel(parent), - d(new TreeItemModelPrivate()) + : QStandardItemModel(parent) { } TreeItemModel::~TreeItemModel() { - delete d; } QVariant TreeItemModel::data(const QModelIndex &index, int role) const @@ -79,7 +62,7 @@ QVariant TreeItemModel::data(const QModelIndex &index, int role) const bool ok = false; int type = iconType.toInt(&ok); if (ok && type >= 0) - return d->icons.iconForType(static_cast<CPlusPlus::Icons::IconType>(type)); + return CPlusPlus::Icons::iconForType(static_cast<CPlusPlus::Icons::IconType>(type)); } } break; |