Commit e795b8b7 authored by Laurent Montel's avatar Laurent Montel 😁

Constify some methods

Test Plan: compile

Reviewers: hein, broulik

Reviewed By: broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8499
parent b706bc73
......@@ -30,7 +30,7 @@ MenuHelper::~MenuHelper()
{
}
QString MenuHelper::iconName(QAction *action)
QString MenuHelper::iconName(QAction *action) const
{
if (!action) {
return QString();
......
......@@ -32,7 +32,7 @@ class MenuHelper : public QObject
explicit MenuHelper(QObject *parent = nullptr);
~MenuHelper();
Q_INVOKABLE QString iconName(QAction *action);
Q_INVOKABLE QString iconName(QAction *action) const;
Q_INVOKABLE void setMenu(QAction *action, QObject *menu);
};
......
......@@ -47,7 +47,7 @@ QHash<int, QByteArray> PlacesModel::roleNames() const
return roleNames;
}
bool PlacesModel::activityLinkingEnabled()
bool PlacesModel::activityLinkingEnabled() const
{
const KService::List services = KServiceTypeTrader::self()->query(QStringLiteral("KFileItemAction/Plugin"),
QStringLiteral("Library == 'kactivitymanagerd_fileitem_linking_plugin'"));
......
......@@ -34,7 +34,7 @@ class PlacesModel : public QSortFilterProxyModel
explicit PlacesModel(QObject *parent = nullptr);
~PlacesModel();
bool activityLinkingEnabled();
bool activityLinkingEnabled() const;
QHash<int, QByteArray> roleNames() const override;
Q_INVOKABLE QString urlForIndex(int idx) const;
......
......@@ -48,7 +48,7 @@ void RubberBand::paint(QPainter *painter)
qApp->style()->drawControl(QStyle::CE_RubberBand, &opt, painter);
}
bool RubberBand::intersects(const QRectF &rect)
bool RubberBand::intersects(const QRectF &rect) const
{
return m_geometry.intersects(rect);
}
......
......@@ -32,7 +32,7 @@ class RubberBand : public QQuickPaintedItem
void paint(QPainter* painter) override;
Q_INVOKABLE bool intersects(const QRectF &rect);
Q_INVOKABLE bool intersects(const QRectF &rect) const;
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
......
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