Reduce windows ci warnings

This commit is contained in:
Nicolas Werner 2022-10-01 19:05:44 +02:00
parent 22a6b8ddb4
commit 42a23e1859
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 7 additions and 6 deletions

View file

@ -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);
}
}
}

View file

@ -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;
}
}

View file

@ -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_; }

View file

@ -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 ||