mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix windows build
No idea, why apply visitor doesn't work with temporaries?
This commit is contained in:
parent
c424e397b0
commit
001c94865c
3 changed files with 7 additions and 5 deletions
|
@ -488,7 +488,7 @@ RoomSettings::retrieveRoomInfo()
|
|||
usesEncryption_ = cache::client()->isRoomEncrypted(room_id_.toStdString());
|
||||
info_ = cache::client()->singleRoomInfo(room_id_.toStdString());
|
||||
setAvatar();
|
||||
} catch (const lmdb::error &e) {
|
||||
} catch (const lmdb::error &) {
|
||||
nhlog::db()->warn("failed to retrieve room info from cache: {}",
|
||||
room_id_.toStdString());
|
||||
}
|
||||
|
|
|
@ -438,16 +438,17 @@ TimelineModel::data(const QModelIndex &index, int role) const
|
|||
boost::apply_visitor([](const auto &e) -> QString { return senderId(e); }, event);
|
||||
|
||||
for (int r = index.row() - 1; r > 0; r--) {
|
||||
auto tempEv = events.value(eventOrder[r]);
|
||||
QDateTime prevDate = boost::apply_visitor(
|
||||
[](const auto &e) -> QDateTime { return eventTimestamp(e); },
|
||||
events.value(eventOrder[r]));
|
||||
tempEv);
|
||||
prevDate.setTime(QTime());
|
||||
if (prevDate != date)
|
||||
return QString("%2 %1").arg(date.toMSecsSinceEpoch()).arg(userId);
|
||||
|
||||
QString prevUserId =
|
||||
boost::apply_visitor([](const auto &e) -> QString { return senderId(e); },
|
||||
events.value(eventOrder[r]));
|
||||
tempEv);
|
||||
if (userId != prevUserId)
|
||||
break;
|
||||
}
|
||||
|
@ -1313,7 +1314,8 @@ TimelineModel::processOnePendingMessage()
|
|||
|
||||
QString txn_id_qstr = pending.first();
|
||||
|
||||
boost::apply_visitor(SendMessageVisitor{txn_id_qstr, this}, events.value(txn_id_qstr));
|
||||
auto event = events.value(txn_id_qstr);
|
||||
boost::apply_visitor(SendMessageVisitor{txn_id_qstr, this}, event);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -200,7 +200,7 @@ TimelineViewManager::saveMedia(QString mxcUrl,
|
|||
if (!file.open(QIODevice::WriteOnly))
|
||||
return;
|
||||
|
||||
file.write(QByteArray(data.data(), data.size()));
|
||||
file.write(QByteArray(data.data(), (int)data.size()));
|
||||
file.close();
|
||||
} catch (const std::exception &e) {
|
||||
nhlog::ui()->warn("Error while saving file to: {}", e.what());
|
||||
|
|
Loading…
Reference in a new issue