author | leseb <leseb> | 2002-06-23 17:47:21 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-23 17:47:21 (UTC) |
commit | 3251c55f854ecbd4ece8bf169177ffac28081aaa (patch) (side-by-side diff) | |
tree | beaf75deb513c8ef4a3ea222135308241fe09f6f | |
parent | 7c22b9cbf92650c432a84537f4b9c3d810e7dc75 (diff) | |
download | opie-3251c55f854ecbd4ece8bf169177ffac28081aaa.zip opie-3251c55f854ecbd4ece8bf169177ffac28081aaa.tar.gz opie-3251c55f854ecbd4ece8bf169177ffac28081aaa.tar.bz2 |
Remove old format reading (XPM gzipped)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.pro | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 19 |
2 files changed, 1 insertions, 21 deletions
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro index 6bea193..8f70cc6 100644 --- a/noncore/graphics/drawpad/drawpad.pro +++ b/noncore/graphics/drawpad/drawpad.pro @@ -30,26 +30,25 @@ SOURCES = drawpad.cpp \ importdialog.cpp \ linetool.cpp \ main.cpp \ newpagedialog.cpp \ page.cpp \ pageinformationdialog.cpp \ pointtool.cpp \ rectangletool.cpp \ shapetool.cpp \ texttool.cpp \ thumbnailview.cpp \ tool.cpp -INCLUDEPATH += $(OPIEDIR)/include \ - $(QTDIR)/src/3rdparty/zlib +INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie DESTDIR = $(OPIEDIR)/bin TARGET = drawpad TRANSLATIONS = ../../i18n/de/drawpad.ts TRANSLATIONS += ../../i18n/en/drawpad.ts TRANSLATIONS += ../../i18n/es/drawpad.ts TRANSLATIONS += ../../i18n/fr/drawpad.ts TRANSLATIONS += ../../i18n/hu/drawpad.ts TRANSLATIONS += ../../i18n/ja/drawpad.ts TRANSLATIONS += ../../i18n/ko/drawpad.ts diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index ae1b554..5437068 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -19,26 +19,24 @@ #include <qpe/applnk.h> #include <qpe/filemanager.h> #include <qpe/mimetype.h> #include <qbuffer.h> #include <qimage.h> #include <qpainter.h> #include <qtextcodec.h> #include <qtextstream.h> #include <qxml.h> -#include <zlib.h> - const int PAGE_BACKUPS = 99; class DrawPadCanvasXmlHandler: public QXmlDefaultHandler { public: DrawPadCanvasXmlHandler(); ~DrawPadCanvasXmlHandler(); QList<Page> pages(); bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); @@ -84,28 +82,24 @@ bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QS if (qName == "image") { m_title = QString(); m_date = QDateTime::currentDateTime(); } else if (qName == "title") { m_state = InTitle; } else if (qName == "date") { m_state = InDate; } else if (qName == "data") { m_state = InData; m_dataLenght = atts.value("length").toULong(); m_dataFormat = atts.value("format"); - - if (m_dataFormat.isEmpty()) { - m_dataFormat = "XPM"; - } } return true; } bool DrawPadCanvasXmlHandler::endElement(const QString& namespaceURI, const QString& localName, const QString& qName) { Q_CONST_UNUSED(namespaceURI) Q_CONST_UNUSED(localName) if (qName == "title") { @@ -141,39 +135,26 @@ bool DrawPadCanvasXmlHandler::characters(const QString& ch) r = r << 4; if (l <= '9') { r += l - '0'; } else { r += l - 'a' + 10; } byteArray[i] = r; } - QImage image; - - if (m_dataFormat == "XPM") { - if (m_dataLenght < ch.length() * 5) { - m_dataLenght = ch.length() * 5; - } - - QByteArray byteArrayUnzipped(m_dataLenght); - ::uncompress((uchar*)byteArrayUnzipped.data(), &m_dataLenght, (uchar*)byteArray.data(), byteArray.size()); - - image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, m_dataFormat); - } else { image.loadFromData((const uchar*)byteArray.data(), m_dataLenght, m_dataFormat); - } Page* page = new Page(m_title, image.width(), image.height()); page->setLastModified(m_date); page->convertFromImage(image); m_pages.append(page); } return true; } DrawPadCanvas::DrawPadCanvas(DrawPad* drawPad, QWidget* parent, const char* name) : QScrollView(parent, name) |