From 2816618d656ea40fdec790ec3a9833362ff3d2b7 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 27 Apr 2024 20:22:56 +0100 Subject: [PATCH] [fixup] pass by const reference && do not pass void to method --- tweaks-qt/layoutmodel.cpp | 4 ++-- tweaks-qt/layoutmodel.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tweaks-qt/layoutmodel.cpp b/tweaks-qt/layoutmodel.cpp index 42101dc..2f95077 100644 --- a/tweaks-qt/layoutmodel.cpp +++ b/tweaks-qt/layoutmodel.cpp @@ -30,7 +30,7 @@ LayoutModel::LayoutModel(QObject *parent) : QAbstractListModel(parent) LayoutModel::~LayoutModel() { } -char *LayoutModel::getXkbDefaultLayout(void) +char *LayoutModel::getXkbDefaultLayout() { QString ret; QVectorIterator> iter(m_layouts); @@ -69,7 +69,7 @@ void LayoutModel::update(void) emit dataChanged(topLeft, topLeft, { Qt::DisplayRole }); } -void LayoutModel::addLayout(QString code, QString desc) +void LayoutModel::addLayout(const QString &code, const QString &desc) { QVectorIterator> iter(m_layouts); while (iter.hasNext()) { diff --git a/tweaks-qt/layoutmodel.h b/tweaks-qt/layoutmodel.h index 9c98584..4ce6487 100644 --- a/tweaks-qt/layoutmodel.h +++ b/tweaks-qt/layoutmodel.h @@ -26,9 +26,9 @@ class LayoutModel : public QAbstractListModel int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - void addLayout(QString code, QString desc); + void addLayout(const QString &code, const QString &desc); void deleteLayout(int index); - char *getXkbDefaultLayout(void); + char *getXkbDefaultLayout(); private: void update(void);