summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-18 20:10:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-18 20:27:37 (GMT)
commit0d3d7579032959203c5c52f5ced9de5494c7b0bf (patch)
tree1e166cbae3dac23e8f815bc32f856b6c0a666fbd /Swift/QtUI/MUCSearch
parentc2580661a20e30abaa23c61808d6370a575665c1 (diff)
downloadswift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.zip
swift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.tar.bz2
Cleaned up some code.
Diffstat (limited to 'Swift/QtUI/MUCSearch')
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchModel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchModel.cpp b/Swift/QtUI/MUCSearch/MUCSearchModel.cpp
index eb7fe20..2526039 100644
--- a/Swift/QtUI/MUCSearch/MUCSearchModel.cpp
+++ b/Swift/QtUI/MUCSearch/MUCSearchModel.cpp
@@ -59,8 +59,13 @@ QModelIndex MUCSearchModel::parent(const QModelIndex& index) const {
return QModelIndex();
}
MUCSearchServiceItem* parent = dynamic_cast<MUCSearchRoomItem*>(item)->getParent();
- int row = services_.indexOf(parent);
- return parent ? createIndex(row, 1, parent) : QModelIndex();
+ if (parent) {
+ int row = services_.indexOf(parent);
+ return createIndex(row, 1, parent);
+ }
+ else {
+ return QModelIndex();
+ }
}
int MUCSearchModel::rowCount(const QModelIndex& parentIndex) const {