mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdeui: save and load notification pixmaps in the default QImageWriter format
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
aaa643765c
commit
73557bd107
1 changed files with 5 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
#include <QWidget>
|
||||
#include <QImageWriter>
|
||||
#include <QBuffer>
|
||||
|
||||
#include "knotificationmanager_p.h"
|
||||
|
@ -32,6 +33,8 @@
|
|||
|
||||
typedef QHash<QString,QString> Dict;
|
||||
|
||||
static const QByteArray imageFormat = QImageWriter::defaultImageFormat();
|
||||
|
||||
struct KNotificationManager::Private
|
||||
{
|
||||
QHash<int , KNotification*> notifications;
|
||||
|
@ -112,7 +115,7 @@ bool KNotificationManager::notify( KNotification* n, const QPixmap &pix,
|
|||
QByteArray pixmapData;
|
||||
QBuffer buffer(&pixmapData);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pix.save(&buffer, "PNG");
|
||||
pix.save(&buffer, imageFormat);
|
||||
|
||||
QVariantList contextList;
|
||||
typedef QPair<QString,QString> Context;
|
||||
|
@ -147,7 +150,7 @@ void KNotificationManager::update(KNotification * n, int id)
|
|||
if(!n->pixmap().isNull()) {
|
||||
QBuffer buffer(&pixmapData);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
n->pixmap().save(&buffer, "PNG");
|
||||
n->pixmap().save(&buffer, imageFormat);
|
||||
}
|
||||
|
||||
d->knotify->update(id, n->title(), n->text(), pixmapData , n->actions() );
|
||||
|
|
Loading…
Add table
Reference in a new issue