Commit c9f2d74b authored by Volker Krause's avatar Volker Krause

Tag::compare arguments should be const references

Besides being more correct, this fixes compilation errors with GCC 4.8
in KMail.
parent c8f0f286
...@@ -111,7 +111,7 @@ Akonadi::Tag Tag::saveToAkonadi(Tag::SaveFlags saveFlags) const ...@@ -111,7 +111,7 @@ Akonadi::Tag Tag::saveToAkonadi(Tag::SaveFlags saveFlags) const
return tag; return tag;
} }
bool Tag::compare(Tag::Ptr &tag1, Tag::Ptr &tag2) bool Tag::compare(const Tag::Ptr &tag1, const Tag::Ptr &tag2)
{ {
if (tag1->priority < tag2->priority) { if (tag1->priority < tag2->priority) {
return true; return true;
...@@ -122,7 +122,7 @@ bool Tag::compare(Tag::Ptr &tag1, Tag::Ptr &tag2) ...@@ -122,7 +122,7 @@ bool Tag::compare(Tag::Ptr &tag1, Tag::Ptr &tag2)
} }
} }
bool Tag::compareName(Tag::Ptr &tag1, Tag::Ptr &tag2) bool Tag::compareName(const Tag::Ptr &tag1, const Tag::Ptr &tag2)
{ {
return (tag1->tagName < tag2->tagName); return (tag1->tagName < tag2->tagName);
} }
......
...@@ -59,9 +59,9 @@ public: ...@@ -59,9 +59,9 @@ public:
Akonadi::Tag saveToAkonadi(SaveFlags saveFlags = SaveFlags(TextColor | BackgroundColor | Font)) const; Akonadi::Tag saveToAkonadi(SaveFlags saveFlags = SaveFlags(TextColor | BackgroundColor | Font)) const;
// Compare, based on priority // Compare, based on priority
static bool compare(Ptr &tag1, Ptr &tag2); static bool compare(const Ptr &tag1, const Ptr &tag2);
// Compare, based on name // Compare, based on name
static bool compareName(Ptr &tag1, Ptr &tag2); static bool compareName(const Ptr &tag1, const Ptr &tag2);
qint64 id() const; qint64 id() const;
QString name() const; QString name() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment