summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-10-11 21:35:54 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-10-11 21:35:54 (GMT)
commitc061f286915bdffa93d4dc722764eae1636291cc (patch)
tree11b5c28531fc3800df9c32f9fa4dffb174f9eb46 /Swift/QtUI
parentcbaa100229b5001f41f13912fba2125213ab3d1f (diff)
downloadswift-contrib-c061f286915bdffa93d4dc722764eae1636291cc.zip
swift-contrib-c061f286915bdffa93d4dc722764eae1636291cc.tar.bz2
Fix for segfault on exit with open MUCs, and reinstate roster sorting.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp4
-rw-r--r--Swift/QtUI/QtChatWindow.h1
-rw-r--r--Swift/QtUI/Roster/QtTreeWidgetItem.cpp2
-rw-r--r--Swift/QtUI/Roster/RosterModel.cpp3
4 files changed, 8 insertions, 2 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 3da0f8d..102fe63 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -62,6 +62,10 @@ QtChatWindow::QtChatWindow(const QString &contact, QtTreeWidgetFactory *treeWidg
resize(400,300);
}
+QtChatWindow::~QtChatWindow() {
+
+}
+
TreeWidget* QtChatWindow::getTreeWidget() {
return treeWidget_;
}
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h
index 8a07de3..9c41ddc 100644
--- a/Swift/QtUI/QtChatWindow.h
+++ b/Swift/QtUI/QtChatWindow.h
@@ -19,6 +19,7 @@ namespace Swift {
Q_OBJECT
public:
QtChatWindow(const QString &contact, QtTreeWidgetFactory* treeWidgetFactory);
+ ~QtChatWindow();
void addMessage(const String &message, const String &senderName, bool senderIsSelf, const boost::optional<SecurityLabel>& label, const String& avatarPath);
void addSystemMessage(const String& message);
void addErrorMessage(const String& errorMessage);
diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
index b237929..1f2964e 100644
--- a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
+++ b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
@@ -121,7 +121,7 @@ void QtTreeWidgetItem::removeChild(QtTreeWidgetItem* child) {
}
void bubbleSort(QList<QtTreeWidgetItem*>& list) {
- bool done = true;
+ bool done = false;
for (int i = 0; i < list.size() - 1 && !done; i++) {
done = true;
for (int j = i + 1; j < list.size(); j++) {
diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp
index 8a319ea..568c1f5 100644
--- a/Swift/QtUI/Roster/RosterModel.cpp
+++ b/Swift/QtUI/Roster/RosterModel.cpp
@@ -58,7 +58,8 @@ QModelIndex RosterModel::parent(const QModelIndex& index) const {
Q_ASSERT(item);
QtTreeWidgetItem* parentItem = item->getParentItem();
- return parentItem == tree_ ? QModelIndex() : createIndex(parentItem->row(), 0, parentItem);
+ /* parentItem_ == NULL can happen during destruction.*/
+ return parentItem == tree_ || parentItem == NULL ? QModelIndex() : createIndex(parentItem->row(), 0, parentItem);
}