diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-22 16:50:27 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-22 16:50:27 -0400 |
commit | 00a302c976f63acb45fa6ba004a00f945ef2cc6b (patch) | |
tree | 4dc1ef4b35dc52a46d44101ac8b226127dc1b532 /sigmodr | |
parent | 4fb5cf2efb299150aff67e9d7ef2d474143b4f10 (diff) | |
download | sigen-00a302c976f63acb45fa6ba004a00f945ef2cc6b.tar.gz sigen-00a302c976f63acb45fa6ba004a00f945ef2cc6b.tar.xz sigen-00a302c976f63acb45fa6ba004a00f945ef2cc6b.zip |
Remove assignments athat are only used once
Diffstat (limited to 'sigmodr')
-rw-r--r-- | sigmodr/tree/SigmodrTreeModel.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sigmodr/tree/SigmodrTreeModel.cpp b/sigmodr/tree/SigmodrTreeModel.cpp index 5e44952a..9f942f9c 100644 --- a/sigmodr/tree/SigmodrTreeModel.cpp +++ b/sigmodr/tree/SigmodrTreeModel.cpp @@ -49,8 +49,7 @@ QVariant SigmodrTreeModel::data(const QModelIndex& index, int role) const { if (!index.isValid()) return QVariant(); - BaseModel* object = static_cast<BaseModel*>(index.internalPointer()); - return object->data(role); + return static_cast<BaseModel*>(index.internalPointer())->data(role); } QModelIndex SigmodrTreeModel::index(int row, int column, const QModelIndex& parent) const @@ -62,8 +61,7 @@ QModelIndex SigmodrTreeModel::index(int row, int column, const QModelIndex& pare BaseModel* model = getItem(parent); if ((model->rowCount() <= row) || (1 <= column)) return QModelIndex(); - BaseModel* object = model->childItem(row); - return createIndex(row, 0, object); + return createIndex(row, 0, model->childItem(row)); } QModelIndex SigmodrTreeModel::parent(const QModelIndex& index) const @@ -78,8 +76,7 @@ QModelIndex SigmodrTreeModel::parent(const QModelIndex& index) const int SigmodrTreeModel::rowCount(const QModelIndex& parent) const { - BaseModel* object = getItem(parent); - return object->rowCount(); + return getItem(parent)->rowCount(); } int SigmodrTreeModel::columnCount(const QModelIndex& parent) const @@ -100,9 +97,8 @@ bool SigmodrTreeModel::setData(const QModelIndex& index, const QVariant& value, { if (!index.isValid()) return false; - BaseModel* object = static_cast<BaseModel*>(index.internalPointer()); emit(layoutAboutToBeChanged()); - bool success = object->setData(value, role); + bool success = static_cast<BaseModel*>(index.internalPointer())->setData(value, role); emit(layoutChanged()); if (success) { @@ -115,11 +111,7 @@ bool SigmodrTreeModel::setData(const QModelIndex& index, const QVariant& value, BaseModel* SigmodrTreeModel::getItem(const QModelIndex& index) const { if (index.isValid()) - { - BaseModel* object = static_cast<BaseModel*>(index.internalPointer()); - if (object) - return object; - } + return static_cast<BaseModel*>(index.internalPointer()); return m_root; } |