-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 4547b41..ae1b554 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -21,24 +21,26 @@ #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); bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName); @@ -363,25 +365,25 @@ void DrawPadCanvas::selectPage(Page* page) emit pageBackupsChanged(); } void DrawPadCanvas::backupPage() { m_pages.current()->setLastModified(QDateTime::currentDateTime()); Page* currentBackup = m_pageBackups.current(); while (m_pageBackups.last() != currentBackup) { m_pageBackups.removeLast(); } - while (m_pageBackups.count() >= (5 + 1)) { + while (m_pageBackups.count() >= (PAGE_BACKUPS + 1)) { m_pageBackups.removeFirst(); } m_pageBackups.append(new Page(*(m_pages.current()))); emit pageBackupsChanged(); } void DrawPadCanvas::deleteAll() { m_pages.clear(); |