diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-09-22 23:01:25 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-23 00:44:31 (GMT) |
commit | cd5cd63750e39759b10b2edf85404db7173ac8ee (patch) | |
tree | 3b545b24c0a3aa26203a554ecbf1b60c69b82b84 | |
parent | 24fe2f9f8e94e2a142bf0e17d7d03c5431eb0eab (diff) | |
download | Qt-cd5cd63750e39759b10b2edf85404db7173ac8ee.zip Qt-cd5cd63750e39759b10b2edf85404db7173ac8ee.tar.gz Qt-cd5cd63750e39759b10b2edf85404db7173ac8ee.tar.bz2 |
Remove dead code paths in declarative list model code.
Reviewed-by: Bea Lam
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 37 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel_p.h | 1 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel_p_p.h | 3 | ||||
-rw-r--r-- | src/declarative/util/qlistmodelinterface_p.h | 3 |
4 files changed, 0 insertions, 44 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 3263238..93a38f4 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -310,14 +310,6 @@ QString QDeclarativeListModel::toString(int role) const return m_flat ? m_flat->toString(role) : m_nested->toString(role); } -QHash<int,QVariant> QDeclarativeListModel::data(int index, const QList<int> &roles) const -{ - if (index >= count() || index < 0) - return QHash<int, QVariant>(); - - return m_flat ? m_flat->data(index, roles) : m_nested->data(index, roles); -} - QVariant QDeclarativeListModel::data(int index, int role) const { if (index >= count() || index < 0) @@ -920,19 +912,6 @@ FlatListModel::~FlatListModel() qDeleteAll(m_nodeData); } -QHash<int,QVariant> FlatListModel::data(int index, const QList<int> &roles) const -{ - Q_ASSERT(index >= 0 && index < m_values.count()); - - QHash<int, QVariant> row; - for (int i=0; i<roles.count(); i++) { - int role = roles[i]; - if (m_values[index].contains(role)) - row.insert(role, m_values[index][role]); - } - return row; -} - QVariant FlatListModel::data(int index, int role) const { Q_ASSERT(index >= 0 && index < m_values.count()); @@ -972,11 +951,6 @@ void FlatListModel::remove(int index) removedNode(index); } -bool FlatListModel::append(const QScriptValue &value) -{ - return insert(m_values.count(), value); -} - bool FlatListModel::insert(int index, const QScriptValue &value) { Q_ASSERT(index >= 0 && index <= m_values.count()); @@ -1350,17 +1324,6 @@ void NestedListModel::move(int from, int to, int n) qdeclarativelistmodel_move<QVariantList>(from, to, n, &_root->values); } -bool NestedListModel::append(const QScriptValue& valuemap) -{ - if (!_root) { - _root = new ModelNode(this); - m_ownsRoot = true; - } - - insert(count(), valuemap); - return true; -} - QScriptValue NestedListModel::get(int index) const { QDeclarativeEngine *eng = qmlEngine(m_listModel); diff --git a/src/declarative/util/qdeclarativelistmodel_p.h b/src/declarative/util/qdeclarativelistmodel_p.h index fe42ef6..e9673c8 100644 --- a/src/declarative/util/qdeclarativelistmodel_p.h +++ b/src/declarative/util/qdeclarativelistmodel_p.h @@ -76,7 +76,6 @@ public: virtual QList<int> roles() const; virtual QString toString(int role) const; virtual int count() const; - virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const; virtual QVariant data(int index, int role) const; Q_INVOKABLE void clear(); diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h index d2d40ee..43a0a9b 100644 --- a/src/declarative/util/qdeclarativelistmodel_p_p.h +++ b/src/declarative/util/qdeclarativelistmodel_p_p.h @@ -79,7 +79,6 @@ public: FlatListModel(QDeclarativeListModel *base); ~FlatListModel(); - QHash<int,QVariant> data(int index, const QList<int> &roles) const; QVariant data(int index, int role) const; QList<int> roles() const; @@ -88,7 +87,6 @@ public: int count() const; void clear(); void remove(int index); - bool append(const QScriptValue&); bool insert(int index, const QScriptValue&); QScriptValue get(int index) const; void set(int index, const QScriptValue&, QList<int> *roles); @@ -189,7 +187,6 @@ public: int count() const; void clear(); void remove(int index); - bool append(const QScriptValue&); bool insert(int index, const QScriptValue&); QScriptValue get(int index) const; void set(int index, const QScriptValue&, QList<int> *roles); diff --git a/src/declarative/util/qlistmodelinterface_p.h b/src/declarative/util/qlistmodelinterface_p.h index 07592ad..8c8ebb3 100644 --- a/src/declarative/util/qlistmodelinterface_p.h +++ b/src/declarative/util/qlistmodelinterface_p.h @@ -59,10 +59,7 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject virtual ~QListModelInterface() {} virtual int count() const = 0; - virtual QHash<int,QVariant> data(int index, const QList<int>& roles = QList<int>()) const = 0; virtual QVariant data(int index, int role) const = 0; - virtual bool setData(int index, const QHash<int,QVariant>& values) - { Q_UNUSED(index); Q_UNUSED(values); return false; } virtual QList<int> roles() const = 0; virtual QString toString(int role) const = 0; |