From 6e345232b3a88e51f45149b039e1a27230a0bc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 1 Oct 2011 12:51:46 +0200 Subject: Fixed cppcheck warnings. diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index edc1a79..47a65a8 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -114,7 +114,7 @@ void ChatsManager::saveRecents() { foreach (ChatListWindow::Chat chat, recentChats_) { std::vector activity; boost::split(activity, chat.activity, boost::is_any_of("\t\n")); - if (activity.size() == 0) { + if (activity.empty()) { /* Work around Boost bug https://svn.boost.org/trac/boost/ticket/4751 */ activity.push_back(""); } diff --git a/Swift/QtUI/QtWebView.cpp b/Swift/QtUI/QtWebView.cpp index d849ce7..d393b6c 100644 --- a/Swift/QtUI/QtWebView.cpp +++ b/Swift/QtUI/QtWebView.cpp @@ -12,7 +12,7 @@ #include namespace Swift { -QtWebView::QtWebView(QWidget* parent) : QWebView(parent) { +QtWebView::QtWebView(QWidget* parent) : QWebView(parent), fontSizeIsMinimal(false) { setRenderHint(QPainter::SmoothPixmapTransform); filteredActions.push_back(QWebPage::CopyLinkToClipboard); filteredActions.push_back(QWebPage::CopyImageToClipboard); diff --git a/Swiften/Elements/JingleS5BTransportPayload.h b/Swiften/Elements/JingleS5BTransportPayload.h index 980af27..995933c 100644 --- a/Swiften/Elements/JingleS5BTransportPayload.h +++ b/Swiften/Elements/JingleS5BTransportPayload.h @@ -58,7 +58,7 @@ namespace Swift { this->mode = mode; } - const std::vector& getCandidates() { + const std::vector& getCandidates() const { return candidates; } diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h index 8dba334..de2822b 100644 --- a/Swiften/Queries/IQRouter.h +++ b/Swiften/Queries/IQRouter.h @@ -31,7 +31,7 @@ namespace Swift { jid_ = jid; } - const JID& getJID() { + const JID& getJID() const { return jid_; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp index 552f7f1..8758722 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCAdminPayloadSerializer.cpp @@ -24,7 +24,7 @@ MUCAdminPayloadSerializer::MUCAdminPayloadSerializer() : GenericPayloadSerialize std::string MUCAdminPayloadSerializer::serializePayload(boost::shared_ptr payload) const { XMLElement mucElement("query", "http://jabber.org/protocol/muc#admin"); - foreach (const MUCItem item, payload->getItems()) { + foreach (const MUCItem& item, payload->getItems()) { mucElement.addNode(MUCItemSerializer::itemToElement(item)); } return mucElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp index 68662b1..96fba90 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCUserPayloadSerializer.cpp @@ -31,7 +31,7 @@ std::string MUCUserPayloadSerializer::serializePayload(boost::shared_ptrsetAttribute("code", code.str()); mucElement.addNode(statusElement); } - foreach (const MUCItem item, payload->getItems()) { + foreach (const MUCItem& item, payload->getItems()) { mucElement.addNode(MUCItemSerializer::itemToElement(item)); } boost::shared_ptr childPayload = payload->getPayload(); -- cgit v0.10.2-6-g49f6