mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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) {
|
void NotificationData::setImage(QImage image) {
|
||||||
if (_notification) {
|
if (_notification) {
|
||||||
const auto imageData = std::make_shared<QByteArray>();
|
QByteArray imageData;
|
||||||
QBuffer buffer(imageData.get());
|
QBuffer buffer(&imageData);
|
||||||
buffer.open(QIODevice::WriteOnly);
|
buffer.open(QIODevice::WriteOnly);
|
||||||
image.save(&buffer, "PNG");
|
image.save(&buffer, "PNG");
|
||||||
|
|
||||||
_notification.set_icon(
|
_notification.set_icon(
|
||||||
Gio::BytesIcon::new_(
|
Gio::BytesIcon::new_(
|
||||||
GLib::Bytes::new_with_free_func(
|
GLib::Bytes::new_with_free_func(
|
||||||
reinterpret_cast<const uchar*>(imageData->constData()),
|
reinterpret_cast<const uchar*>(imageData.constData()),
|
||||||
imageData->size(),
|
imageData.size(),
|
||||||
[imageData] {})));
|
[imageData] {})));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue