diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/QtUI/UserSearch/QtContactListWidget.cpp | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/QtUI/UserSearch/QtContactListWidget.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtContactListWidget.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/Swift/QtUI/UserSearch/QtContactListWidget.cpp b/Swift/QtUI/UserSearch/QtContactListWidget.cpp index 0d55880..99bd791 100644 --- a/Swift/QtUI/UserSearch/QtContactListWidget.cpp +++ b/Swift/QtUI/UserSearch/QtContactListWidget.cpp @@ -24,80 +24,80 @@ namespace Swift { QtContactListWidget::QtContactListWidget(QWidget* parent, SettingsProvider* settings) : QTreeView(parent), settings_(settings), limited_(false) { - contactListModel_ = new ContactListModel(true); - setModel(contactListModel_); + contactListModel_ = new ContactListModel(true); + setModel(contactListModel_); - connect(contactListModel_, SIGNAL(onListChanged(std::vector<Contact::ref>)), this, SIGNAL(onListChanged(std::vector<Contact::ref>))); - connect(contactListModel_, SIGNAL(onJIDsDropped(std::vector<JID>)), this, SIGNAL(onJIDsAdded(std::vector<JID>))); + connect(contactListModel_, SIGNAL(onListChanged(std::vector<Contact::ref>)), this, SIGNAL(onListChanged(std::vector<Contact::ref>))); + connect(contactListModel_, SIGNAL(onJIDsDropped(std::vector<JID>)), this, SIGNAL(onJIDsAdded(std::vector<JID>))); - setSelectionMode(QAbstractItemView::SingleSelection); - setSelectionBehavior(QAbstractItemView::SelectRows); - setUniformRowHeights(true); + setSelectionMode(QAbstractItemView::SingleSelection); + setSelectionBehavior(QAbstractItemView::SelectRows); + setUniformRowHeights(true); - setAlternatingRowColors(true); - setIndentation(0); - setHeaderHidden(true); - setExpandsOnDoubleClick(false); - setItemsExpandable(false); - setEditTriggers(QAbstractItemView::DoubleClicked); + setAlternatingRowColors(true); + setIndentation(0); + setHeaderHidden(true); + setExpandsOnDoubleClick(false); + setItemsExpandable(false); + setEditTriggers(QAbstractItemView::DoubleClicked); - contactListDelegate_ = new ContactListDelegate(settings->getSetting(QtUISettingConstants::COMPACT_ROSTER)); - removableItemDelegate_ = new QtRemovableItemDelegate(style()); + contactListDelegate_ = new ContactListDelegate(settings->getSetting(QtUISettingConstants::COMPACT_ROSTER)); + removableItemDelegate_ = new QtRemovableItemDelegate(style()); - setItemDelegateForColumn(0, contactListDelegate_); - setItemDelegateForColumn(1, removableItemDelegate_); + setItemDelegateForColumn(0, contactListDelegate_); + setItemDelegateForColumn(1, removableItemDelegate_); - header()->resizeSection(1, removableItemDelegate_->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); + header()->resizeSection(1, removableItemDelegate_->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); - header()->setStretchLastSection(false); + header()->setStretchLastSection(false); #if QT_VERSION >= 0x050000 - header()->setSectionResizeMode(0, QHeaderView::Stretch); + header()->setSectionResizeMode(0, QHeaderView::Stretch); #else - header()->setResizeMode(0, QHeaderView::Stretch); + header()->setResizeMode(0, QHeaderView::Stretch); #endif } QtContactListWidget::~QtContactListWidget() { - delete contactListDelegate_; - delete removableItemDelegate_; - delete contactListModel_; + delete contactListDelegate_; + delete removableItemDelegate_; + delete contactListModel_; } void QtContactListWidget::setList(const std::vector<Contact::ref>& list) { - contactListModel_->setList(list); + contactListModel_->setList(list); } std::vector<Contact::ref> QtContactListWidget::getList() const { - return contactListModel_->getList(); + return contactListModel_->getList(); } Contact::ref QtContactListWidget::getContact(const size_t i) { - return contactListModel_->getContact(i); + return contactListModel_->getContact(i); } void QtContactListWidget::setMaximumNoOfContactsToOne(bool limited) { - limited_ = limited; + limited_ = limited; } bool QtContactListWidget::isFull() const { - return limited_ && (getList().size() == 1); + 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); + 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)); + contactListDelegate_->setCompact(settings_->getSetting(QtUISettingConstants::COMPACT_ROSTER)); } } |