Bump clazy version

pull/1854/head
Nicolas Werner 4 weeks ago
parent f6788ecf1f
commit 7db1711b09
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 4
      .gitlab-ci.yml
  2. 2
      src/JdenticonProvider.h
  3. 3
      src/MainWindow.cpp
  4. 2
      src/MxcImageProvider.cpp
  5. 4
      src/timeline/InputBar.cpp
  6. 2
      src/timeline/InputBar.h
  7. 16
      src/timeline/RoomlistModel.cpp
  8. 2
      src/timeline/TimelineModel.h

@ -120,11 +120,11 @@ build-clazy:
CLAZY_CHECKS: level0,level1,no-non-pod-global-static CLAZY_CHECKS: level0,level1,no-non-pod-global-static
TRAVIS_OS_NAME: linux TRAVIS_OS_NAME: linux
before_script: before_script:
- apk add asciidoctor cmake cmark-dev gst-plugins-bad-dev gst-plugins-base-dev gstreamer-dev lmdb-dev lmdbxx nlohmann-json olm-dev openssl-dev qt6-qtbase-dev qt6-qtdeclarative-dev qt6-qtmultimedia-dev qt6-qtsvg-dev qt6-qttools-dev samurai spdlog-dev xcb-util-wm-dev zlib-dev ccache curl-dev libevent-dev meson clazy clang16 gcc musl-dev git re2-dev libsecret-dev - apk add asciidoctor cmake cmark-dev gst-plugins-bad-dev gst-plugins-base-dev gstreamer-dev lmdb-dev lmdbxx nlohmann-json olm-dev openssl-dev qt6-qtbase-dev qt6-qtdeclarative-dev qt6-qtmultimedia-dev qt6-qtsvg-dev qt6-qttools-dev samurai spdlog-dev xcb-util-wm-dev zlib-dev ccache curl-dev libevent-dev meson clazy clang18 gcc musl-dev git re2-dev libsecret-dev
script: script:
- export PATH="/usr/lib/ccache:${PATH}" - export PATH="/usr/lib/ccache:${PATH}"
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l) - export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
- export CLANGXX=clang++-16 - export CLANGXX=clang++-18
- cmake -GNinja -H. -Bbuild - cmake -GNinja -H. -Bbuild
-DCMAKE_INSTALL_PREFIX=.deps/usr -DCMAKE_INSTALL_PREFIX=.deps/usr
-DHUNTER_ENABLED=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_MTXCLIENT=ON -DUSE_BUNDLED_COEURL=ON -DUSE_BUNDLED_OLM=ON -DUSE_BUNDLED_QTKEYCHAIN=ON -DUSE_BUNDLED_KDSINGLEAPPLICATION=ON -DHUNTER_ENABLED=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_MTXCLIENT=ON -DUSE_BUNDLED_COEURL=ON -DUSE_BUNDLED_OLM=ON -DUSE_BUNDLED_QTKEYCHAIN=ON -DUSE_BUNDLED_KDSINGLEAPPLICATION=ON

@ -69,7 +69,7 @@ public slots:
auto query = id.mid(queryStart + 1); auto query = id.mid(queryStart + 1);
auto queryBits = QStringView(query).split('&'); auto queryBits = QStringView(query).split('&');
for (const auto &b : queryBits) { for (const auto &b : std::as_const(queryBits)) {
if (b.startsWith(QStringView(u"radius="))) { if (b.startsWith(QStringView(u"radius="))) {
radius = b.mid(7).toDouble(); radius = b.mid(7).toDouble();
} }

@ -203,7 +203,8 @@ NhekoFixupPaletteEventFilter::eventFilter(QObject *obj, QEvent *event)
// reason?!? // reason?!?
if (event->type() == QEvent::ChildAdded && if (event->type() == QEvent::ChildAdded &&
obj->metaObject()->className() == QStringLiteral("QQuickRootItem")) { obj->metaObject()->className() == QStringLiteral("QQuickRootItem")) {
for (const auto window : QGuiApplication::topLevelWindows()) { auto windows = QGuiApplication::topLevelWindows();
for (const auto window : std::as_const(windows)) {
if (window->property("posted").isValid()) if (window->property("posted").isValid())
continue; continue;
QGuiApplication::postEvent(window, new QEvent(QEvent::ApplicationPaletteChange)); QGuiApplication::postEvent(window, new QEvent(QEvent::ApplicationPaletteChange));

@ -91,7 +91,7 @@ MxcImageProvider::requestImageResponse(const QString &id, const QSize &requested
auto query = QStringView(id).mid(queryStart + 1); auto query = QStringView(id).mid(queryStart + 1);
auto queryBits = query.split('&'); auto queryBits = query.split('&');
for (auto b : queryBits) { for (auto b : std::as_const(queryBits)) {
if (b == QStringView(u"scale")) { if (b == QStringView(u"scale")) {
crop = false; crop = false;
} else if (b.startsWith(QStringView(u"radius="))) { } else if (b.startsWith(QStringView(u"radius="))) {

@ -494,11 +494,11 @@ InputBar::generateRelations() const
} }
mtx::common::Mentions mtx::common::Mentions
InputBar::generateMentions() InputBar::generateMentions() const
{ {
std::vector<std::string> userMentions; std::vector<std::string> userMentions;
bool atRoom = false; bool atRoom = false;
for (const auto &m : mentions_) for (const auto &m : std::as_const(mentions_))
if (m == u"@room") if (m == u"@room")
atRoom = true; atRoom = true;
else else

@ -304,7 +304,7 @@ private:
QPair<QString, QString> getCommandAndArgs() const { return getCommandAndArgs(text()); } QPair<QString, QString> getCommandAndArgs() const { return getCommandAndArgs(text()); }
QPair<QString, QString> getCommandAndArgs(const QString &currentText) const; QPair<QString, QString> getCommandAndArgs(const QString &currentText) const;
mtx::common::Relations generateRelations() const; mtx::common::Relations generateRelations() const;
mtx::common::Mentions generateMentions(); mtx::common::Mentions generateMentions() const;
void startUploadFromPath(const QString &path); void startUploadFromPath(const QString &path);
void startUploadFromMimeData(const QMimeData &source, const QString &format); void startUploadFromMimeData(const QMimeData &source, const QString &format);

@ -1014,7 +1014,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags)
.toStringList(); .toStringList();
for (const auto &t : tags) for (const auto &t : std::as_const(tags))
if (hiddenTags.contains(t)) if (hiddenTags.contains(t))
return false; return false;
} }
@ -1023,7 +1023,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
auto parents = sourceModel() auto parents = sourceModel()
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces)
.toStringList(); .toStringList();
for (const auto &t : parents) for (const auto &t : std::as_const(parents))
if (hiddenSpaces.contains(t)) if (hiddenSpaces.contains(t))
return false; return false;
} }
@ -1053,7 +1053,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags)
.toStringList(); .toStringList();
for (const auto &t : tags) for (const auto &t : std::as_const(tags))
if (hiddenTags.contains(t)) if (hiddenTags.contains(t))
return false; return false;
} }
@ -1062,7 +1062,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
auto parents = sourceModel() auto parents = sourceModel()
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces)
.toStringList(); .toStringList();
for (const auto &t : parents) for (const auto &t : std::as_const(parents))
if (hiddenSpaces.contains(t)) if (hiddenSpaces.contains(t))
return false; return false;
} }
@ -1091,7 +1091,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
return false; return false;
if (!hiddenTags.empty()) { if (!hiddenTags.empty()) {
for (const auto &t : tags) for (const auto &t : std::as_const(tags))
if (t != filterStr && hiddenTags.contains(t)) if (t != filterStr && hiddenTags.contains(t))
return false; return false;
} }
@ -1100,7 +1100,7 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
auto parents = sourceModel() auto parents = sourceModel()
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::ParentSpaces)
.toStringList(); .toStringList();
for (const auto &t : parents) for (const auto &t : std::as_const(parents))
if (hiddenSpaces.contains(t)) if (hiddenSpaces.contains(t))
return false; return false;
} }
@ -1130,13 +1130,13 @@ FilteredRoomlistModel::filterAcceptsRow(int sourceRow, const QModelIndex &) cons
->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags) ->data(sourceModel()->index(sourceRow, 0), RoomlistModel::Tags)
.toStringList(); .toStringList();
for (const auto &t : tags) for (const auto &t : std::as_const(tags))
if (hiddenTags.contains(t)) if (hiddenTags.contains(t))
return false; return false;
} }
if (!hiddenSpaces.empty()) { if (!hiddenSpaces.empty()) {
for (const auto &t : parents) for (const auto &t : std::as_const(parents))
if (t != filterStr && hiddenSpaces.contains(t)) if (t != filterStr && hiddenSpaces.contains(t))
return false; return false;
} }

@ -360,7 +360,7 @@ public:
auto list = events.reactions(event_id); auto list = events.reactions(event_id);
std::vector<::Reaction> vec; std::vector<::Reaction> vec;
vec.reserve(list.size()); vec.reserve(list.size());
for (const auto &r : list) for (const auto &r : std::as_const(list))
vec.push_back(r.value<Reaction>()); vec.push_back(r.value<Reaction>());
return vec; return vec;
} }

Loading…
Cancel
Save