@@ -28,20 +28,17 @@ ModelPrinter::ModelPrinter(QObject *parent)
2828
2929void ModelPrinter::setSourceModel(QAbstractItemModel * sourceModel)
3030{
31− if (m_model != NULL)
32− {
31+ if (m_model != NULL) {
3332 disconnect(m_model, SIGNAL(modelReset()), this, SIGNAL(sourceChanged()));
3433 disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(sourceChanged()));
3534 disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(sourceChanged()));
3635 }
37− if (m_model != sourceModel)
38− {
36+ if (m_model != sourceModel) {
3937 m_model = sourceModel;
4038 Q_EMIT modelChanged();
4139 Q_EMIT sourceChanged();
4240 }
43− if (m_model != NULL)
44− {
41+ if (m_model != NULL) {
4542 connect(m_model, SIGNAL(modelReset()), this, SIGNAL(sourceChanged()));
4643 connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(sourceChanged()));
4744 connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(sourceChanged()));
@@ -89,8 +86,7 @@ QString ModelPrinter::recurse_string(const QModelIndex& index, int level) const
8986
9087 int rowCount = m_model->rowCount(index);
9188 stream << tabify(level) << "child count" << ": " << rowCount << endl;
92− for (int i = 0; i < rowCount; i++)
93− {
89+ for (int i = 0; i < rowCount; i++) {
9490 QModelIndex child = m_model->index(i, 0, index);
9591 str += recurse_string(child, level+1);
9692 }