Diffstat (limited to 'noncore/graphics/drawpad/drawpadcanvas.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 8818c03..b8a1c2e 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -56,2 +56,3 @@ private: ulong m_dataLenght; + QString m_dataFormat; QList<QPixmap> m_pixmaps; @@ -82,2 +83,7 @@ bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QS m_dataLenght = atts.value("length").toULong(); + m_dataFormat = atts.value("format"); + + if (m_dataFormat.isEmpty()) { + m_dataFormat = "XPM"; + } } @@ -135,3 +141,3 @@ bool DrawPadCanvasXmlHandler::characters(const QString& ch) QImage image; - image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, "XPM"); + image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, m_dataFormat); @@ -217,3 +223,3 @@ void DrawPadCanvas::save(QIODevice* ioDevice) QBuffer buffer(byteArray); - QImageIO imageIO(&buffer, "XPM"); + QImageIO imageIO(&buffer, "PNG"); @@ -228,3 +234,3 @@ void DrawPadCanvas::save(QIODevice* ioDevice) - textStream << " <data length=\"" << byteArray.size() << "\">"; + textStream << " <data length=\"" << byteArray.size() << "\" format=\"PNG\">"; |