Fix various warnings
This commit is contained in:
@@ -25,6 +25,7 @@ void FileTransferPseudoJob::fileTransferProgress(QString id, qint64 progress, qi
|
|||||||
|
|
||||||
void FileTransferPseudoJob::fileTransferCompleted(QString id, QUrl localFile)
|
void FileTransferPseudoJob::fileTransferCompleted(QString id, QUrl localFile)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(localFile);
|
||||||
if (id != m_eventId) {
|
if (id != m_eventId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void CustomEmojiModel::addEmoji(const QString &name, const QUrl &location)
|
|||||||
auto job = Controller::instance().activeConnection()->uploadFile(location.toLocalFile());
|
auto job = Controller::instance().activeConnection()->uploadFile(location.toLocalFile());
|
||||||
|
|
||||||
if (running(job)) {
|
if (running(job)) {
|
||||||
connect(job, &BaseJob::success, this, [this, name, job] {
|
connect(job, &BaseJob::success, this, [name, job] {
|
||||||
const auto &data = Controller::instance().activeConnection()->accountData("im.ponies.user_emotes");
|
const auto &data = Controller::instance().activeConnection()->accountData("im.ponies.user_emotes");
|
||||||
auto json = data != nullptr ? data->contentJson() : QJsonObject();
|
auto json = data != nullptr ? data->contentJson() : QJsonObject();
|
||||||
auto emojiData = json["images"].toObject();
|
auto emojiData = json["images"].toObject();
|
||||||
@@ -141,6 +141,8 @@ QVariant CustomEmojiModel::data(const QModelIndex &idx, int role) const
|
|||||||
return QUrl(QStringLiteral("image://mxc/") + data.url.mid(6));
|
return QUrl(QStringLiteral("image://mxc/") + data.url.mid(6));
|
||||||
case Roles::MxcUrl:
|
case Roles::MxcUrl:
|
||||||
return data.url.mid(6);
|
return data.url.mid(6);
|
||||||
|
default:
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (role == SourceRole) {
|
if (role == SourceRole) {
|
||||||
return evt.originalJson();
|
return QJsonDocument(evt.fullJson()).toJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == DelegateTypeRole) {
|
if (role == DelegateTypeRole) {
|
||||||
@@ -983,7 +983,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (role == IsPendingRole) {
|
if (role == IsPendingRole) {
|
||||||
return row < m_currentRoom->pendingEvents().size();
|
return row < static_cast<int>(m_currentRoom->pendingEvents().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -43,20 +43,27 @@ void SearchModel::search()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SearchJob::RoomEventsCriteria criteria{
|
SearchJob::RoomEventsCriteria criteria{
|
||||||
m_searchText,
|
.searchTerm = m_searchText,
|
||||||
{},
|
.keys = {},
|
||||||
RoomEventFilter{
|
.filter =
|
||||||
.rooms = {m_room->id()},
|
RoomEventFilter{
|
||||||
},
|
.unreadThreadNotifications = none,
|
||||||
"recent",
|
.lazyLoadMembers = true,
|
||||||
SearchJob::IncludeEventContext{3, 3, true},
|
.includeRedundantMembers = false,
|
||||||
false,
|
.notRooms = {},
|
||||||
none,
|
.rooms = {m_room->id()},
|
||||||
|
.containsUrl = false,
|
||||||
|
},
|
||||||
|
.orderBy = "recent",
|
||||||
|
.eventContext = SearchJob::IncludeEventContext{3, 3, true},
|
||||||
|
.includeState = false,
|
||||||
|
.groupings = none,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto job = m_connection->callApi<SearchJob>(SearchJob::Categories{criteria});
|
auto job = m_connection->callApi<SearchJob>(SearchJob::Categories{criteria});
|
||||||
m_job = job;
|
m_job = job;
|
||||||
connect(job, &BaseJob::finished, this, [=] {
|
connect(job, &BaseJob::finished, this, [this, job] {
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_result = job->searchCategories().roomEvents;
|
m_result = job->searchCategories().roomEvents;
|
||||||
endResetModel();
|
endResetModel();
|
||||||
@@ -116,6 +123,7 @@ QVariant SearchModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
int SearchModel::rowCount(const QModelIndex &parent) const
|
int SearchModel::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
#ifdef QUOTIENT_07
|
#ifdef QUOTIENT_07
|
||||||
if (m_result.has_value()) {
|
if (m_result.has_value()) {
|
||||||
return m_result->results.size();
|
return m_result->results.size();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void StateModel::setRoom(NeoChatRoom *room)
|
|||||||
Q_EMIT roomChanged();
|
Q_EMIT roomChanged();
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
connect(room, &NeoChatRoom::changed, this, [=] {
|
connect(room, &NeoChatRoom::changed, this, [this] {
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -254,17 +254,16 @@ const RoomEvent *NeoChatRoom::lastEvent() const
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event->isStateEvent() && !NeoChatConfig::self()->showStateEvent()) {
|
if (event->isStateEvent() && !NeoChatConfig::showStateEvent()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto roomMemberEvent = eventCast<const RoomMemberEvent>(event)) {
|
if (auto roomMemberEvent = eventCast<const RoomMemberEvent>(event)) {
|
||||||
if ((roomMemberEvent->isJoin() || roomMemberEvent->isLeave()) && !NeoChatConfig::self()->showLeaveJoinEvent()) {
|
if ((roomMemberEvent->isJoin() || roomMemberEvent->isLeave()) && !NeoChatConfig::showLeaveJoinEvent()) {
|
||||||
continue;
|
continue;
|
||||||
} else if (roomMemberEvent->isRename() && !roomMemberEvent->isJoin() && !roomMemberEvent->isLeave() && !NeoChatConfig::self()->showRename()) {
|
} else if (roomMemberEvent->isRename() && !roomMemberEvent->isJoin() && !roomMemberEvent->isLeave() && !NeoChatConfig::showRename()) {
|
||||||
continue;
|
continue;
|
||||||
} else if (roomMemberEvent->isAvatarUpdate() && !roomMemberEvent->isJoin() && !roomMemberEvent->isLeave()
|
} else if (roomMemberEvent->isAvatarUpdate() && !roomMemberEvent->isJoin() && !roomMemberEvent->isLeave() && !NeoChatConfig::showAvatarUpdate()) {
|
||||||
&& !NeoChatConfig::self()->showAvatarUpdate()) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -321,7 +320,7 @@ QString NeoChatRoom::lastEventToString(Qt::TextFormat format, bool stripNewlines
|
|||||||
return roomMembername(event->senderId()) + (event->isStateEvent() ? QLatin1String(" ") : QLatin1String(": "))
|
return roomMembername(event->senderId()) + (event->isStateEvent() ? QLatin1String(" ") : QLatin1String(": "))
|
||||||
+ eventToString(*event, format, stripNewlines);
|
+ eventToString(*event, format, stripNewlines);
|
||||||
}
|
}
|
||||||
return QLatin1String("");
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NeoChatRoom::isEventHighlighted(const RoomEvent *e) const
|
bool NeoChatRoom::isEventHighlighted(const RoomEvent *e) const
|
||||||
@@ -765,6 +764,7 @@ QString NeoChatRoom::eventToGenericString(const RoomEvent &evt) const
|
|||||||
},
|
},
|
||||||
#ifdef QUOTIENT_07
|
#ifdef QUOTIENT_07
|
||||||
[](const PollStartEvent &e) {
|
[](const PollStartEvent &e) {
|
||||||
|
Q_UNUSED(e);
|
||||||
return i18n("started a poll");
|
return i18n("started a poll");
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user