diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-01-18 20:10:44 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-01-18 20:27:37 (GMT) |
commit | 0d3d7579032959203c5c52f5ced9de5494c7b0bf (patch) | |
tree | 1e166cbae3dac23e8f815bc32f856b6c0a666fbd /Swift/QtUI | |
parent | c2580661a20e30abaa23c61808d6370a575665c1 (diff) | |
download | swift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.zip swift-0d3d7579032959203c5c52f5ced9de5494c7b0bf.tar.bz2 |
Cleaned up some code.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp | 4 | ||||
-rw-r--r-- | Swift/QtUI/ContextMenus/QtRosterContextMenu.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/MUCSearch/MUCSearchModel.cpp | 9 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.h | 2 |
5 files changed, 11 insertions, 8 deletions
diff --git a/Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp b/Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp index 1c2fc4b..9bbbbca 100644 --- a/Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp +++ b/Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp @@ -28,9 +28,7 @@ namespace Swift { -QtRosterContextMenu::QtRosterContextMenu(UIEventStream* eventStream, QtTreeWidget* treeWidget) { - eventStream_ = eventStream; - treeWidget_ = treeWidget; +QtRosterContextMenu::QtRosterContextMenu(UIEventStream* eventStream, QtTreeWidget* treeWidget) : eventStream_(eventStream), treeWidget_(treeWidget), item_(NULL) { } void QtRosterContextMenu::show(RosterItem* item) { diff --git a/Swift/QtUI/ContextMenus/QtRosterContextMenu.h b/Swift/QtUI/ContextMenus/QtRosterContextMenu.h index 53f4bdd..0a88a8e 100644 --- a/Swift/QtUI/ContextMenus/QtRosterContextMenu.h +++ b/Swift/QtUI/ContextMenus/QtRosterContextMenu.h @@ -27,8 +27,8 @@ namespace Swift { void handleRegroupContact(); private: - RosterItem* item_; UIEventStream* eventStream_; QtTreeWidget* treeWidget_; + RosterItem* item_; }; } 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 { diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp index 8852d54..1c14dee 100644 --- a/Swift/QtUI/QtSwift.cpp +++ b/Swift/QtUI/QtSwift.cpp @@ -70,7 +70,7 @@ po::options_description QtSwift::getOptionsDescription() { } -QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThreadCaller_), autoUpdater_(NULL) { +QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMainThreadCaller_), autoUpdater_(NULL) { if (options.count("netbook-mode")) { splitter_ = new QSplitter(); } else { diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h index ca6e126..cc9eb38 100644 --- a/Swift/QtUI/QtSwift.h +++ b/Swift/QtUI/QtSwift.h @@ -48,7 +48,7 @@ namespace Swift { class QtSwift : public QObject { Q_OBJECT public: - QtSwift(po::variables_map options); + QtSwift(const po::variables_map& options); static po::options_description getOptionsDescription(); ~QtSwift(); private: |