removed UnityMenuModelCache refing code.
commit113177bc63786b667b06fbc102105d3e41c1ac1d
authorNick Dedekind <nicholas.dedekind@gmail.com>
dateFri 23 Aug 2013, 09:44 (13 years ago)
parentdc81012
plugins/Unity/Indicators/qml/CachedUnityMenuModel.qml−6
@@ -43,12 +43,6 @@ Item {
4343 return component;
4444 }
4545
46− Component.onCompleted: Indicators.UnityMenuModelCache.ref()
47− Component.onDestruction: {
48− model = null;
49− Indicators.UnityMenuModelCache.deref();
50− }
51−
5246 Component {
5347 id: modelComponent
5448
plugins/Unity/Indicators/unitymenumodelcache.cpp+1−16
@@ -21,29 +21,14 @@
2121#include <unitymenumodel.h>
2222
2323UnityMenuModelCache::UnityMenuModelCache(QObject* parent)
24− : QObject(parent),
25− m_ref(0)
24+ : QObject(parent)
2625{
2726}
2827
2928UnityMenuModelCache::~UnityMenuModelCache()
3029{
31− qDeleteAll(m_menuModels);
3230}
3331
34−void UnityMenuModelCache::ref()
35−{
36− m_ref++;
37−}
38−
39−void UnityMenuModelCache::deref()
40−{
41− --m_ref;
42− if (m_ref == 0) {
43− qDeleteAll(m_menuModels);
44− m_menuModels.clear();
45− }
46−}
4732
4833UnityMenuModel* UnityMenuModelCache::model(const QString& path) const
4934{
plugins/Unity/Indicators/unitymenumodelcache.h−4
@@ -34,15 +34,11 @@ public:
3434 UnityMenuModelCache(QObject*parent=NULL);
3535 ~UnityMenuModelCache();
3636
37− Q_INVOKABLE void ref();
38− Q_INVOKABLE void deref();
39−
4037 Q_INVOKABLE UnityMenuModel* model(const QString& path) const;
4138 Q_INVOKABLE void registerModel(const QString& path, UnityMenuModel* menuModel);
4239
4340private:
4441 QHash<QString, UnityMenuModel*> m_menuModels;
45− int m_ref;
4642};
4743
4844#endif // UNITYMENUMODELCACHE_H