Skip to content

Commit

Permalink
Static check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Jan 11, 2024
1 parent 2567f49 commit 77c2472
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/tests/test_layouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ private Q_SLOTS:
}
}

static void assertRegionContainsStates(State *region, const QList<State *> states)
static void assertRegionContainsStates(State *region, const QList<State *> &states)
{
const QRectF rect = region->boundingRect();
foreach (State *item, states) {
for (const State *item : states) {
QVERIFY(rect.contains(item->boundingRect()));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/util/objecthelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ QString ObjectHelper::addressToString(const void *p)
QString ObjectHelper::className(const QObject *object, ObjectHelper::DisplayOption option)
{
QString className = QString::fromLatin1(object->metaObject()->className());
return option == StripNameSpace ? stripNameSpace(className) : className;
return option == StripNameSpace ? stripNameSpace(className) : std::move(className);
}

QString ObjectHelper::displayString(const QObject *object, DisplayOption option)
Expand Down
4 changes: 2 additions & 2 deletions src/core/util/objecthelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ KDSME_CORE_EXPORT int depth(const QObject *root, const QObject *object);
* Returns a list that only contains item of type @p FilterType
*/
template<class FilterType, class ItemType>
QList<FilterType> copy_if_type(const QList<ItemType> list)
QList<FilterType> copy_if_type(const QList<ItemType> &list)
{
QList<FilterType> filteredList;
Q_FOREACH (const ItemType object, list) {
for (const ItemType &object : list) {
if (FilterType filterObject = qobject_cast<FilterType>(object))
filteredList << filterObject;
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/widgets/statemachineview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void StateMachineView::setThemeName(const QString &themeName)
}
}

d->m_themeName = selectedThemeName;
d->m_themeName = std::move(selectedThemeName);
emit themeNameChanged(d->m_themeName);
}

Expand Down

0 comments on commit 77c2472

Please sign in to comment.