From 42a23e18592ce22f38e38bb0d8660f7c91b7c89c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 1 Oct 2022 19:05:44 +0200 Subject: [PATCH] Reduce windows ci warnings --- src/Cache.cpp | 5 +++-- src/Cache_p.h | 4 ++-- src/MemberList.h | 2 +- src/ui/RoomSummary.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Cache.cpp b/src/Cache.cpp index b14f7414..e841a9dc 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -3873,9 +3873,10 @@ Cache::spaces() std::string_view room_data; if (roomsDb_.get(txn, space_id, room_data)) { RoomInfo tmp = nlohmann::json::parse(std::move(room_data)).get(); - ret.insert(QString::fromUtf8(space_id.data(), space_id.size()), tmp); + ret.insert(QString::fromUtf8(space_id.data(), (qsizetype)space_id.size()), tmp); } else { - ret.insert(QString::fromUtf8(space_id.data(), space_id.size()), std::nullopt); + ret.insert(QString::fromUtf8(space_id.data(), (qsizetype)space_id.size()), + std::nullopt); } } } diff --git a/src/Cache_p.h b/src/Cache_p.h index 2d6df140..a12cb43a 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h @@ -490,13 +490,13 @@ private: if (!eventsDb.get( txn, nlohmann::json::parse(data)["id"].get(), value)) return std::nullopt; - } catch (std::exception &e) { + } catch (std::exception &) { return std::nullopt; } } return nlohmann::json::parse(value).get>(); - } catch (std::exception &e) { + } catch (std::exception &) { return std::nullopt; } } diff --git a/src/MemberList.h b/src/MemberList.h index 1fbccc63..eb70ddbf 100644 --- a/src/MemberList.h +++ b/src/MemberList.h @@ -44,7 +44,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QString roomName() const { return QString::fromStdString(info_.name); } - int memberCount() const { return info_.member_count; } + int memberCount() const { return (int)info_.member_count; } QString avatarUrl() const { return QString::fromStdString(info_.avatar_url); } QString roomId() const { return room_id_; } int numUsersLoaded() const { return numUsersLoaded_; } diff --git a/src/ui/RoomSummary.h b/src/ui/RoomSummary.h index f5085054..fd19f4c2 100644 --- a/src/ui/RoomSummary.h +++ b/src/ui/RoomSummary.h @@ -59,7 +59,7 @@ public: return room && room->membership == mtx::events::state::Membership::Invite; } bool isSpace() const { return room && room->room_type == mtx::events::state::room_type::space; } - int memberCount() const { return room ? room->num_joined_members : 0; } + int memberCount() const { return room ? (int)room->num_joined_members : 0; } bool isKnockOnly() const { return room && (room->join_rule == mtx::events::state::JoinRule::Knock ||