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/Roster/QtOccupantListWidget.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/Roster/QtOccupantListWidget.cpp')
-rw-r--r-- | Swift/QtUI/Roster/QtOccupantListWidget.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/Swift/QtUI/Roster/QtOccupantListWidget.cpp b/Swift/QtUI/Roster/QtOccupantListWidget.cpp index 1eefd56..03c14fd 100644 --- a/Swift/QtUI/Roster/QtOccupantListWidget.cpp +++ b/Swift/QtUI/Roster/QtOccupantListWidget.cpp @@ -29,47 +29,47 @@ QtOccupantListWidget::~QtOccupantListWidget() { } void QtOccupantListWidget::setAvailableOccupantActions(const std::vector<ChatWindow::OccupantAction>& actions) { - availableOccupantActions_ = actions; + availableOccupantActions_ = actions; } void QtOccupantListWidget::contextMenuEvent(QContextMenuEvent* event) { - QModelIndex index = indexAt(event->pos()); - if (!index.isValid()) { - return; - } + QModelIndex index = indexAt(event->pos()); + if (!index.isValid()) { + return; + } - RosterItem* item = static_cast<RosterItem*>(index.internalPointer()); - ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); - if (contact) { - onSomethingSelectedChanged(contact); - QMenu contextMenu; - if (availableOccupantActions_.empty()) { - QAction* noAction = contextMenu.addAction(tr("No actions for this user")); - noAction->setEnabled(false); - contextMenu.exec(event->globalPos()); - } - else { - std::map<QAction*, ChatWindow::OccupantAction> actions; - foreach (ChatWindow::OccupantAction availableAction, availableOccupantActions_) { - QString text = "Error: missing string"; - switch (availableAction) { - case ChatWindow::Kick: text = tr("Kick user"); break; - case ChatWindow::Ban: text = tr("Kick and ban user"); break; - case ChatWindow::MakeModerator: text = tr("Make moderator"); break; - case ChatWindow::MakeParticipant: text = tr("Make participant"); break; - case ChatWindow::MakeVisitor: text = tr("Remove voice"); break; - case ChatWindow::AddContact: text = tr("Add to contacts"); break; - case ChatWindow::ShowProfile: text = tr("Show profile"); break; - } - QAction* action = contextMenu.addAction(text); - actions[action] = availableAction; - } - QAction* result = contextMenu.exec(event->globalPos()); - if (result) { - onOccupantActionSelected(actions[result], contact); - } - } - } + RosterItem* item = static_cast<RosterItem*>(index.internalPointer()); + ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); + if (contact) { + onSomethingSelectedChanged(contact); + QMenu contextMenu; + if (availableOccupantActions_.empty()) { + QAction* noAction = contextMenu.addAction(tr("No actions for this user")); + noAction->setEnabled(false); + contextMenu.exec(event->globalPos()); + } + else { + std::map<QAction*, ChatWindow::OccupantAction> actions; + foreach (ChatWindow::OccupantAction availableAction, availableOccupantActions_) { + QString text = "Error: missing string"; + switch (availableAction) { + case ChatWindow::Kick: text = tr("Kick user"); break; + case ChatWindow::Ban: text = tr("Kick and ban user"); break; + case ChatWindow::MakeModerator: text = tr("Make moderator"); break; + case ChatWindow::MakeParticipant: text = tr("Make participant"); break; + case ChatWindow::MakeVisitor: text = tr("Remove voice"); break; + case ChatWindow::AddContact: text = tr("Add to contacts"); break; + case ChatWindow::ShowProfile: text = tr("Show profile"); break; + } + QAction* action = contextMenu.addAction(text); + actions[action] = availableAction; + } + QAction* result = contextMenu.exec(event->globalPos()); + if (result) { + onOccupantActionSelected(actions[result], contact); + } + } + } } } |