summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/ContextMenus/QtRosterContextMenu.cpp4
-rw-r--r--Swift/QtUI/ContextMenus/QtRosterContextMenu.h2
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchModel.cpp9
-rw-r--r--Swift/QtUI/QtSwift.cpp2
-rw-r--r--Swift/QtUI/QtSwift.h2
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: