summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-23 18:57:05 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-23 18:57:05 (GMT)
commit3f72e2c3b7ce5a83287dc136c68b7ef6d2cc66bd (patch)
tree8afd8cdb41d3b35d2cf43afda5b9825ce75d8e72
parentd917be7e1f7e4c99c2d8d20cc3e54d7b6e61f333 (diff)
downloadswift-contrib-3f72e2c3b7ce5a83287dc136c68b7ef6d2cc66bd.zip
swift-contrib-3f72e2c3b7ce5a83287dc136c68b7ef6d2cc66bd.tar.bz2
Fixed const references to vectors.
This could potentially cause crashes (same as a previous patch).
-rw-r--r--Swift/Controllers/Roster/RosterController.cpp2
-rw-r--r--Swift/Controllers/Roster/RosterController.h2
-rw-r--r--Swiften/Elements/DiscoInfo.h2
-rw-r--r--Swiften/Elements/FormField.h2
-rw-r--r--Swiften/Elements/JinglePayload.h2
-rw-r--r--Swiften/Elements/MUCUserPayload.h4
-rw-r--r--Swiften/Elements/SearchPayload.h2
-rw-r--r--Swiften/Jingle/JingleSession.h2
8 files changed, 9 insertions, 9 deletions
diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp
index 706f50a..5b61abf 100644
--- a/Swift/Controllers/Roster/RosterController.cpp
+++ b/Swift/Controllers/Roster/RosterController.cpp
@@ -136,19 +136,19 @@ void RosterController::applyAllPresenceTo(const JID& jid) {
void RosterController::handleRosterCleared() {
roster_->removeAll();
}
void RosterController::handleOnJIDRemoved(const JID& jid) {
roster_->removeContact(jid);
}
-void RosterController::handleOnJIDUpdated(const JID& jid, const std::string& oldName, const std::vector<std::string> passedOldGroups) {
+void RosterController::handleOnJIDUpdated(const JID& jid, const std::string& oldName, const std::vector<std::string>& passedOldGroups) {
if (oldName != xmppRoster_->getNameForJID(jid)) {
roster_->applyOnItems(SetName(nickResolver_->jidToNick(jid), jid));
}
std::vector<std::string> groups = xmppRoster_->getGroupsForJID(jid);
std::vector<std::string> oldGroups = passedOldGroups;
std::string name = nickResolver_->jidToNick(jid);
std::string contactsGroup = QT_TRANSLATE_NOOP("", "Contacts");
if (oldGroups.empty()) {
oldGroups.push_back(contactsGroup);
diff --git a/Swift/Controllers/Roster/RosterController.h b/Swift/Controllers/Roster/RosterController.h
index f224180..0a2b818 100644
--- a/Swift/Controllers/Roster/RosterController.h
+++ b/Swift/Controllers/Roster/RosterController.h
@@ -51,19 +51,19 @@ namespace Swift {
std::set<std::string> getGroups() const;
void setContactGroups(const JID& jid, const std::vector<std::string>& groups);
void updateItem(const XMPPRosterItem&);
private:
void handleOnJIDAdded(const JID &jid);
void handleRosterCleared();
void handleOnJIDRemoved(const JID &jid);
- void handleOnJIDUpdated(const JID &jid, const std::string& oldName, const std::vector<std::string> oldGroups);
+ void handleOnJIDUpdated(const JID &jid, const std::string& oldName, const std::vector<std::string>& oldGroups);
void handleStartChatRequest(const JID& contact);
void handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText);
void handleShowOfflineToggled(bool state);
void handleIncomingPresence(boost::shared_ptr<Presence> newPresence);
void handleSubscriptionRequest(const JID& jid, const std::string& message);
void handleSubscriptionRequestAccepted(SubscriptionRequestEvent* event);
void handleSubscriptionRequestDeclined(SubscriptionRequestEvent* event);
void handleUIEvent(boost::shared_ptr<UIEvent> event);
void handleRosterSetError(ErrorPayload::ref error, boost::shared_ptr<RosterPayload> rosterPayload);
diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h
index d5bf64a..b73165e 100644
--- a/Swiften/Elements/DiscoInfo.h
+++ b/Swiften/Elements/DiscoInfo.h
@@ -84,19 +84,19 @@ namespace Swift {
bool hasFeature(const std::string& feature) const {
return std::find(features_.begin(), features_.end(), feature) != features_.end();
}
void addExtension(Form::ref form) {
extensions_.push_back(form);
}
- const std::vector<Form::ref> getExtensions() const {
+ const std::vector<Form::ref>& getExtensions() const {
return extensions_;
}
private:
std::string node_;
std::vector<Identity> identities_;
std::vector<std::string> features_;
std::vector<Form::ref> extensions_;
};
diff --git a/Swiften/Elements/FormField.h b/Swiften/Elements/FormField.h
index f455303..517369b 100644
--- a/Swiften/Elements/FormField.h
+++ b/Swiften/Elements/FormField.h
@@ -42,19 +42,19 @@ namespace Swift {
void addOption(const Option& option) {
options.push_back(option);
}
const std::vector<Option>& getOptions() const {
return options;
}
- const std::vector<std::string> getRawValues() const {
+ const std::vector<std::string>& getRawValues() const {
return rawValues;
}
void addRawValue(const std::string& value) {
rawValues.push_back(value);
}
protected:
FormField() : required(false) {}
diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h
index 59d3c99..59fba7b 100644
--- a/Swiften/Elements/JinglePayload.h
+++ b/Swiften/Elements/JinglePayload.h
@@ -96,19 +96,19 @@ namespace Swift {
const std::string& getSessionID() const {
return sessionID;
}
void addContent(JingleContent::ref content) {
this->contents.push_back(content);
}
- const std::vector<JingleContent::ref> getContents() const {
+ const std::vector<JingleContent::ref>& getContents() const {
return contents;
}
void setReason(const Reason& reason) {
this->reason = reason;
}
const boost::optional<Reason>& getReason() const {
return reason;
diff --git a/Swiften/Elements/MUCUserPayload.h b/Swiften/Elements/MUCUserPayload.h
index fb6d4c4..7460c35 100644
--- a/Swiften/Elements/MUCUserPayload.h
+++ b/Swiften/Elements/MUCUserPayload.h
@@ -46,18 +46,18 @@ namespace Swift {
// }
MUCUserPayload() {
}
void addItem(Item item) {items_.push_back(item);}
void addStatusCode(StatusCode code) {statusCodes_.push_back(code);}
- const std::vector<Item> getItems() const {return items_;}
+ const std::vector<Item>& getItems() const {return items_;}
- const std::vector<StatusCode> getStatusCodes() const {return statusCodes_;}
+ const std::vector<StatusCode>& getStatusCodes() const {return statusCodes_;}
private:
std::vector<Item> items_;
std::vector<StatusCode> statusCodes_;
};
}
diff --git a/Swiften/Elements/SearchPayload.h b/Swiften/Elements/SearchPayload.h
index 3a484cc..d6d7ed1 100644
--- a/Swiften/Elements/SearchPayload.h
+++ b/Swiften/Elements/SearchPayload.h
@@ -68,19 +68,19 @@ namespace Swift {
void setLast(const std::string& v) {
this->last = v;
}
void setEMail(const std::string& v) {
this->email = v;
}
- const std::vector<Item> getItems() const {
+ const std::vector<Item>& getItems() const {
return items;
}
void addItem(const Item& item) {
items.push_back(item);
}
private:
Form::ref form;
diff --git a/Swiften/Jingle/JingleSession.h b/Swiften/Jingle/JingleSession.h
index c00492d..fe8aa01 100644
--- a/Swiften/Jingle/JingleSession.h
+++ b/Swiften/Jingle/JingleSession.h
@@ -31,19 +31,19 @@ namespace Swift {
JingleContent::ref getContentWithDescription() const {
foreach (JingleContent::ref content, contents) {
if (content->getDescription<T>()) {
return content;
}
}
return JingleContent::ref();
}
- const std::vector<JingleContent::ref> getContents() const {
+ const std::vector<JingleContent::ref>& getContents() const {
return contents;
}
void terminate(JinglePayload::Reason::Type reason);
private:
void handleIncomingAction(JinglePayload::ref);
private: