diff options
| author | Richard Maudsley <richard.maudsley@isode.com> | 2014-06-30 10:42:05 (GMT) | 
|---|---|---|
| committer | Swift Review <review@swift.im> | 2014-07-09 12:53:37 (GMT) | 
| commit | 1edfc36235cc67d303ceb2bcf0630affc509f2f7 (patch) | |
| tree | 0ca86a9e5e0dbcd3876ce91b4bf4feec5321c9c9 /Swift/QtUI/UserSearch/QtContactListWidget.cpp | |
| parent | 05d9e618e4c756e50b633448f0546614a645a13d (diff) | |
| download | swift-contrib-1edfc36235cc67d303ceb2bcf0630affc509f2f7.zip swift-contrib-1edfc36235cc67d303ceb2bcf0630affc509f2f7.tar.bz2 | |
Fix attempting to start impromptu chat when impromptu not supported.
Test-Information:
Connect to a server where impromptu is NOT supported. Confirm that adding multiple users by dragging or typing into the JID box is not allowed.
Connect to a server where impromptu is supported. Confirm that it is still possible to drag multiple users and add multiple users by typing into the JID box.
Change-Id: Ibb4c1f7d6a5820f7ccf3629c1e0d30a441d9d159
Diffstat (limited to 'Swift/QtUI/UserSearch/QtContactListWidget.cpp')
| -rw-r--r-- | Swift/QtUI/UserSearch/QtContactListWidget.cpp | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/Swift/QtUI/UserSearch/QtContactListWidget.cpp b/Swift/QtUI/UserSearch/QtContactListWidget.cpp index 4adc929..6504f3e 100644 --- a/Swift/QtUI/UserSearch/QtContactListWidget.cpp +++ b/Swift/QtUI/UserSearch/QtContactListWidget.cpp @@ -45,53 +45,57 @@ QtContactListWidget::QtContactListWidget(QWidget* parent, SettingsProvider* sett  	setItemDelegateForColumn(0, contactListDelegate_);  	setItemDelegateForColumn(1, removableItemDelegate_);  	header()->resizeSection(1, removableItemDelegate_->sizeHint(QStyleOptionViewItem(), QModelIndex()).width());  	header()->setStretchLastSection(false);  #if QT_VERSION >= 0x050000  	header()->setSectionResizeMode(0, QHeaderView::Stretch);  #else  	header()->setResizeMode(0, QHeaderView::Stretch);  #endif  }  QtContactListWidget::~QtContactListWidget() {  	delete contactListDelegate_;  	delete removableItemDelegate_;  }  void QtContactListWidget::setList(const std::vector<Contact::ref>& list) {  	contactListModel_->setList(list);  }  std::vector<Contact::ref> QtContactListWidget::getList() const {  	return contactListModel_->getList();  }  Contact::ref QtContactListWidget::getContact(const size_t i) {  	return contactListModel_->getContact(i);  }  void QtContactListWidget::setMaximumNoOfContactsToOne(bool limited) {  	limited_ = limited;  } +bool QtContactListWidget::isFull() const { +	return limited_ && (getList().size() == 1); +} +  void QtContactListWidget::updateContacts(const std::vector<Contact::ref>& contactUpdates) {  	std::vector<Contact::ref> contacts = contactListModel_->getList();  	foreach(const Contact::ref& contactUpdate, contactUpdates) {  		for(size_t n = 0; n < contacts.size(); n++) {  			if (contactUpdate->jid == contacts[n]->jid) {  				contacts[n] = contactUpdate;  				break;  			}  		}  	}  	contactListModel_->setList(contacts);  }  void QtContactListWidget::handleSettingsChanged(const std::string&) {  	contactListDelegate_->setCompact(settings_->getSetting(QtUISettingConstants::COMPACT_ROSTER));  }  } | 
 Swift
 Swift