diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-10-01 19:05:44 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-10-01 19:05:44 +0200 |
commit | 42a23e18592ce22f38e38bb0d8660f7c91b7c89c (patch) | |
tree | 97861ae137f10d443541046b26a976fa04e85ab4 | |
parent | Properly qualify fmt function (diff) | |
download | nheko-42a23e18592ce22f38e38bb0d8660f7c91b7c89c.tar.xz |
Reduce windows ci warnings
-rw-r--r-- | src/Cache.cpp | 5 | ||||
-rw-r--r-- | src/Cache_p.h | 4 | ||||
-rw-r--r-- | src/MemberList.h | 2 | ||||
-rw-r--r-- | 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<RoomInfo>(); - 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<std::string>(), value)) return std::nullopt; - } catch (std::exception &e) { + } catch (std::exception &) { return std::nullopt; } } return nlohmann::json::parse(value).get<mtx::events::StateEvent<T>>(); - } 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 || |