Skip to content

Commit

Permalink
qt: Component::customValue should be const
Browse files Browse the repository at this point in the history
Since it was omitted, add the const and overload the method for now.
  • Loading branch information
aleixpol authored and ximion committed Feb 13, 2024
1 parent 2bd7ffe commit c216ea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions qt/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,11 @@ QHash<QString, QString> AppStream::Component::custom() const
return result;
}

QString AppStream::Component::customValue(const QString &key) const
{
return valueWrap(as_component_get_custom_value(d->cpt, qPrintable(key)));
}

QString AppStream::Component::customValue(const QString &key)
{
return valueWrap(as_component_get_custom_value(d->cpt, qPrintable(key)));
Expand Down
3 changes: 2 additions & 1 deletion qt/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class APPSTREAMQT_EXPORT Component
void setMergeKind(MergeKind kind);

QHash<QString, QString> custom() const;
QString customValue(const QString &key);
QString customValue(const QString &key) const;
[[deprecated]] QString customValue(const QString &key); //TODO Remove when we break ABI
bool insertCustomValue(const QString &key, const QString &value);

QList<AppStream::ContentRating> contentRatings() const;
Expand Down

0 comments on commit c216ea5

Please sign in to comment.