mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Add proper struct initialization
This commit is contained in:
parent
27f7142cd8
commit
bb03a402d7
2 changed files with 9 additions and 4 deletions
|
@ -34,6 +34,14 @@ struct PendingMessage {
|
||||||
QString body;
|
QString body;
|
||||||
QString event_id;
|
QString event_id;
|
||||||
HistoryViewItem *widget;
|
HistoryViewItem *widget;
|
||||||
|
|
||||||
|
PendingMessage(int txn_id, QString body, QString event_id, HistoryViewItem *widget)
|
||||||
|
: txn_id(txn_id)
|
||||||
|
, body(body)
|
||||||
|
, event_id(event_id)
|
||||||
|
, widget(widget)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class HistoryView : public QWidget
|
class HistoryView : public QWidget
|
||||||
|
|
|
@ -174,10 +174,7 @@ void HistoryView::addUserTextMessage(const QString &body, int txn_id)
|
||||||
|
|
||||||
last_sender_ = user_id;
|
last_sender_ = user_id;
|
||||||
|
|
||||||
PendingMessage message = {};
|
PendingMessage message(txn_id, body, "", view_item);
|
||||||
message.txn_id = txn_id;
|
|
||||||
message.body = body;
|
|
||||||
message.widget = view_item;
|
|
||||||
|
|
||||||
pending_msgs_.push_back(message);
|
pending_msgs_.push_back(message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue