Skip to content

Commit

Permalink
[fixup] pass by const reference && do not pass void to method
Browse files Browse the repository at this point in the history
  • Loading branch information
johanmalm committed Apr 27, 2024
1 parent bb874e6 commit 2816618
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tweaks-qt/layoutmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LayoutModel::LayoutModel(QObject *parent) : QAbstractListModel(parent)

LayoutModel::~LayoutModel() { }

char *LayoutModel::getXkbDefaultLayout(void)
char *LayoutModel::getXkbDefaultLayout()
{
QString ret;
QVectorIterator<QSharedPointer<Layout>> iter(m_layouts);
Expand Down Expand Up @@ -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<QSharedPointer<Layout>> iter(m_layouts);
while (iter.hasNext()) {
Expand Down
4 changes: 2 additions & 2 deletions tweaks-qt/layoutmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2816618

Please sign in to comment.