mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Don't wrap QByteArray into std::shared_ptr
This has no sense as QByteArray is CoW
This commit is contained in:
parent
4950b52359
commit
2ab9587f5f
1 changed files with 4 additions and 4 deletions
|
@ -511,16 +511,16 @@ void NotificationData::close() {
|
|||
|
||||
void NotificationData::setImage(QImage image) {
|
||||
if (_notification) {
|
||||
const auto imageData = std::make_shared<QByteArray>();
|
||||
QBuffer buffer(imageData.get());
|
||||
QByteArray imageData;
|
||||
QBuffer buffer(&imageData);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
image.save(&buffer, "PNG");
|
||||
|
||||
_notification.set_icon(
|
||||
Gio::BytesIcon::new_(
|
||||
GLib::Bytes::new_with_free_func(
|
||||
reinterpret_cast<const uchar*>(imageData->constData()),
|
||||
imageData->size(),
|
||||
reinterpret_cast<const uchar*>(imageData.constData()),
|
||||
imageData.size(),
|
||||
[imageData] {})));
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue