summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/RosterController.cpp2
-rw-r--r--Swift/Controllers/SoundEventController.cpp2
-rw-r--r--Swift/QtUI/EventViewer/EventModel.cpp4
-rw-r--r--Swift/QtUI/QtChatTabs.cpp4
-rw-r--r--Swift/QtUI/QtJoinMUCDialog.cpp2
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp4
6 files changed, 9 insertions, 9 deletions
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp
index 063d2a7..807fc19 100644
--- a/Swift/Controllers/RosterController.cpp
+++ b/Swift/Controllers/RosterController.cpp
@@ -92,65 +92,65 @@ void RosterController::handleUserAction(boost::shared_ptr<UserRosterAction> acti
onStartChatRequest(contactItem->getJID().toBare());
}
}
void RosterController::handleOnJIDAdded(const JID& jid) {
std::vector<String> groups = xmppRoster_->getGroupsForJID(jid);
String name = xmppRoster_->getNameForJID(jid);
if (!groups.empty()) {
foreach(const String& group, groups) {
roster_->addContact(jid, name, group);
}
} else {
roster_->addContact(jid, name, "Contacts");
}
}
void RosterController::handleOnJIDRemoved(const JID& jid) {
roster_->removeContact(jid);
}
void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName, const std::vector<String> oldGroups) {
if (oldName != xmppRoster_->getNameForJID(jid)) {
handleOnJIDAdded(jid);
return;
}
std::vector<String> groups = xmppRoster_->getGroupsForJID(jid);
String name = xmppRoster_->getNameForJID(jid);
String contactsGroup = "Contacts";
if (groups.empty()) {
groups.push_back(contactsGroup);
}
foreach(const String& group, groups) {
if (std::find(oldGroups.begin(), oldGroups.end(), jid) == oldGroups.end()) {
roster_->addContact(jid, xmppRoster_->getNameForJID(jid), group);
}
}
foreach(const String& group, oldGroups) {
if (std::find(groups.begin(), groups.end(), group) == groups.end()) {
roster_->removeContactFromGroup(jid, group);
}
}
}
void RosterController::handleIncomingPresence(boost::shared_ptr<Presence> presence) {
roster_->applyOnItems(SetPresence(presence));
}
-void RosterController::handleAvatarChanged(const JID& jid, const String& hash) {
+void RosterController::handleAvatarChanged(const JID& jid, const String&) {
String path = avatarManager_->getAvatarPath(jid).string();
roster_->applyOnItems(SetAvatar(jid, path));
if (jid.equals(myJID_, JID::WithoutResource)) {
mainWindow_->setMyAvatarPath(path);
}
}
void RosterController::handleStartChatRequest(const JID& contact) {
onStartChatRequest(contact);
}
void RosterController::handleJoinMUCRequest(const JID &muc, const String &nick) {
onJoinMUCRequest(JID(muc), nick);
}
}
diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp
index 133becf..d466842 100644
--- a/Swift/Controllers/SoundEventController.cpp
+++ b/Swift/Controllers/SoundEventController.cpp
@@ -1,25 +1,25 @@
#include "Swift/Controllers/SoundEventController.h"
#include <boost/bind.hpp>
#include "Swift/Controllers/EventController.h"
#include "Swift/Controllers/SoundPlayer.h"
namespace Swift {
SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer, bool playSounds) {
eventController_ = eventController;
soundPlayer_ = soundPlayer;
playSounds_ = playSounds;
eventController_->onEventQueueEventAdded.connect(boost::bind(&SoundEventController::handleEventQueueEventAdded, this, _1));
}
-void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<MessageEvent> event) {
+void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<MessageEvent>) {
if (playSounds_) soundPlayer_->playSound(SoundPlayer::MessageReceived);
}
void SoundEventController::setPlaySounds(bool playSounds) {
playSounds_ = playSounds;
}
}
diff --git a/Swift/QtUI/EventViewer/EventModel.cpp b/Swift/QtUI/EventViewer/EventModel.cpp
index a2343ed..a3d5406 100644
--- a/Swift/QtUI/EventViewer/EventModel.cpp
+++ b/Swift/QtUI/EventViewer/EventModel.cpp
@@ -1,20 +1,20 @@
#include "EventModel.h"
namespace Swift {
EventModel::EventModel() {
}
EventModel::~EventModel() {
}
-QVariant EventModel::data(const QModelIndex& index, int role) const {
+QVariant EventModel::data(const QModelIndex& /*index*/, int /*role*/) const {
return QVariant();
}
-int EventModel::rowCount(const QModelIndex& parent) const {
+int EventModel::rowCount(const QModelIndex& /*parent*/) const {
return 0;
}
}
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp
index 2dbeed7..e30478c 100644
--- a/Swift/QtUI/QtChatTabs.cpp
+++ b/Swift/QtUI/QtChatTabs.cpp
@@ -57,57 +57,57 @@ void QtChatTabs::handleWidgetShown() {
void QtChatTabs::handleWantsToActivate() {
QtTabbable* widget = qobject_cast<QtTabbable*>(sender());
Q_ASSERT(widget);
Q_ASSERT(tabs_->indexOf(widget) >= 0);
//Un-minimize and bring to front.
setWindowState(windowState() & ~Qt::WindowMinimized);
setWindowState(windowState() | Qt::WindowActive);
tabs_->setCurrentWidget(widget);
widget->setFocus();
activateWindow();
}
void QtChatTabs::handleTabClosing() {
QWidget* widget = qobject_cast<QWidget*>(sender());
if (!widget) {
return;
}
int index = tabs_->indexOf(widget);
if (index < 0) {
return;
}
tabs_->removeTab(index);
if (tabs_->count() == 0) {
hide();
}
}
void QtChatTabs::handleTabCloseRequested(int index) {
QWidget* widget = tabs_->widget(index);
widget->close();
}
void QtChatTabs::handleTabTitleUpdated() {
QWidget* widget = qobject_cast<QWidget*>(sender());
if (!widget) {
return;
}
int index = tabs_->indexOf(widget);
if (index < 0) {
return;
}
tabs_->setTabText(index, widget->windowTitle());
if (widget == tabs_->currentWidget()) {
setWindowTitle(widget->windowTitle());
}
}
-void QtChatTabs::resizeEvent(QResizeEvent* event) {
+void QtChatTabs::resizeEvent(QResizeEvent*) {
emit geometryChanged();
}
-void QtChatTabs::moveEvent(QMoveEvent* event) {
+void QtChatTabs::moveEvent(QMoveEvent*) {
emit geometryChanged();
}
}
diff --git a/Swift/QtUI/QtJoinMUCDialog.cpp b/Swift/QtUI/QtJoinMUCDialog.cpp
index b6f5814..77879ee 100644
--- a/Swift/QtUI/QtJoinMUCDialog.cpp
+++ b/Swift/QtUI/QtJoinMUCDialog.cpp
@@ -1,32 +1,32 @@
#include "QtJoinMUCDialog.h"
#include "QtSwiftUtil.h"
namespace Swift {
-QtJoinMUCDialog::QtJoinMUCDialog(const QString& nick, const QString& muc, QWidget* parent) : QDialog(parent) {
+QtJoinMUCDialog::QtJoinMUCDialog(const QString&, const QString&, QWidget* parent) : QDialog(parent) {
setupUi(this);
errorLabel_->hide();
setAttribute(Qt::WA_DeleteOnClose, true);
connect(buttons_, SIGNAL(accepted()), SLOT(accept()));
connect(buttons_, SIGNAL(rejected()), SLOT(reject()));
}
void QtJoinMUCDialog::accept() {
if (mucJID_->displayText().isEmpty()) {
showError("You must specify a room to join.");
return;
}
if (nick_->displayText().isEmpty()) {
showError("You must specify a nickname to join a room.");
return;
}
errorLabel_->hide();
emit onJoinCommand(JID(Q2PSTRING(mucJID_->displayText())), nick_->displayText());
QDialog::accept();
}
void QtJoinMUCDialog::showError(const QString& error) {
errorLabel_->setText(QString("<font color='red'>%1</font>").arg(error));
errorLabel_->show();
}
}
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 4daa658..6466692 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -206,58 +206,58 @@ void QtLoginWindow::handleAbout() {
else {
aboutDialog_->show();
aboutDialog_->raise();
aboutDialog_->activateWindow();
}
}
void QtLoginWindow::handleQuit() {
QApplication::quit();
}
void QtLoginWindow::setInitialMenus() {
menuBar_->clear();
menuBar_->addMenu(swiftMenu_);
}
void QtLoginWindow::morphInto(MainWindow *mainWindow) {
QtMainWindow *qtMainWindow = dynamic_cast<QtMainWindow*>(mainWindow);
assert(qtMainWindow);
stack_->addWidget(qtMainWindow);
stack_->setCurrentWidget(qtMainWindow);
setEnabled(true);
setInitialMenus();
foreach (QMenu* menu, qtMainWindow->getMenus()) {
menuBar_->addMenu(menu);
}
}
void QtLoginWindow::setMessage(const String& message) {
if (!message.isEmpty()) {
message_->setText("<center><font color=\"red\">" + P2QSTRING(message) + "</font></center>");
}
else {
message_->setText("");
}
}
void QtLoginWindow::bringToFront() {
if (isHidden()) {
showNormal();
raise();
activateWindow();
}
else {
hide();
}
}
-void QtLoginWindow::resizeEvent(QResizeEvent* event) {
+void QtLoginWindow::resizeEvent(QResizeEvent*) {
emit geometryChanged();
}
-void QtLoginWindow::moveEvent(QMoveEvent* event) {
+void QtLoginWindow::moveEvent(QMoveEvent*) {
emit geometryChanged();
}
}