author | leseb <leseb> | 2002-06-14 19:15:16 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-14 19:15:16 (UTC) |
commit | 251404b1ad7c5712270233821699ab8492fe76ac (patch) (unidiff) | |
tree | b78e72bd4d420e95951eca8b5f5015cf405f2f9c | |
parent | 0aa515c2f050a85dbaf7b20b7a3c3fc12a213ed1 (diff) | |
download | opie-251404b1ad7c5712270233821699ab8492fe76ac.zip opie-251404b1ad7c5712270233821699ab8492fe76ac.tar.gz opie-251404b1ad7c5712270233821699ab8492fe76ac.tar.bz2 |
Minor fixes
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 4 | ||||
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index dcf0871..4547b41 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -69,33 +69,33 @@ DrawPadCanvasXmlHandler::~DrawPadCanvasXmlHandler() | |||
69 | { | 69 | { |
70 | } | 70 | } |
71 | 71 | ||
72 | QList<Page> DrawPadCanvasXmlHandler::pages() | 72 | QList<Page> DrawPadCanvasXmlHandler::pages() |
73 | { | 73 | { |
74 | return m_pages; | 74 | return m_pages; |
75 | } | 75 | } |
76 | 76 | ||
77 | bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QString& localName, | 77 | bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QString& localName, |
78 | const QString& qName, const QXmlAttributes& atts) | 78 | const QString& qName, const QXmlAttributes& atts) |
79 | { | 79 | { |
80 | Q_CONST_UNUSED(namespaceURI) | 80 | Q_CONST_UNUSED(namespaceURI) |
81 | Q_CONST_UNUSED(localName) | 81 | Q_CONST_UNUSED(localName) |
82 | 82 | ||
83 | if (qName == "image") { | 83 | if (qName == "image") { |
84 | m_title = QString(); | 84 | m_title = QString(); |
85 | m_date = QDateTime(QDate(1970, 1, 1)); | 85 | m_date = QDateTime::currentDateTime(); |
86 | } else if (qName == "title") { | 86 | } else if (qName == "title") { |
87 | m_state = InTitle; | 87 | m_state = InTitle; |
88 | } else if (qName == "date") { | 88 | } else if (qName == "date") { |
89 | m_state = InDate; | 89 | m_state = InDate; |
90 | } else if (qName == "data") { | 90 | } else if (qName == "data") { |
91 | m_state = InData; | 91 | m_state = InData; |
92 | m_dataLenght = atts.value("length").toULong(); | 92 | m_dataLenght = atts.value("length").toULong(); |
93 | m_dataFormat = atts.value("format"); | 93 | m_dataFormat = atts.value("format"); |
94 | 94 | ||
95 | if (m_dataFormat.isEmpty()) { | 95 | if (m_dataFormat.isEmpty()) { |
96 | m_dataFormat = "XPM"; | 96 | m_dataFormat = "XPM"; |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | return true; | 100 | return true; |
101 | } | 101 | } |
@@ -109,33 +109,33 @@ bool DrawPadCanvasXmlHandler::endElement(const QString& namespaceURI, const QStr | |||
109 | if (qName == "title") { | 109 | if (qName == "title") { |
110 | m_state = Unknown; | 110 | m_state = Unknown; |
111 | } else if (qName == "date") { | 111 | } else if (qName == "date") { |
112 | m_state = Unknown; | 112 | m_state = Unknown; |
113 | } else if (qName == "data") { | 113 | } else if (qName == "data") { |
114 | m_state = Unknown; | 114 | m_state = Unknown; |
115 | } | 115 | } |
116 | 116 | ||
117 | return true; | 117 | return true; |
118 | } | 118 | } |
119 | 119 | ||
120 | bool DrawPadCanvasXmlHandler::characters(const QString& ch) | 120 | bool DrawPadCanvasXmlHandler::characters(const QString& ch) |
121 | { | 121 | { |
122 | if (m_state == InTitle) { | 122 | if (m_state == InTitle) { |
123 | m_title = ch; | 123 | m_title = ch; |
124 | } else if (m_state == InDate) { | 124 | } else if (m_state == InDate) { |
125 | m_date = m_date.addSecs(ch.toInt()); | 125 | m_date = QDateTime(QDate(1970, 1, 1)).addSecs(ch.toInt()); |
126 | } else if (m_state == InData) { | 126 | } else if (m_state == InData) { |
127 | QByteArray byteArray(ch.length() / 2); | 127 | QByteArray byteArray(ch.length() / 2); |
128 | 128 | ||
129 | for (int i = 0; i < (int)ch.length() / 2; i++) { | 129 | for (int i = 0; i < (int)ch.length() / 2; i++) { |
130 | char h = ch[2 * i].latin1(); | 130 | char h = ch[2 * i].latin1(); |
131 | char l = ch[2 * i + 1].latin1(); | 131 | char l = ch[2 * i + 1].latin1(); |
132 | uchar r = 0; | 132 | uchar r = 0; |
133 | 133 | ||
134 | if (h <= '9') { | 134 | if (h <= '9') { |
135 | r += h - '0'; | 135 | r += h - '0'; |
136 | } else { | 136 | } else { |
137 | r += h - 'a' + 10; | 137 | r += h - 'a' + 10; |
138 | } | 138 | } |
139 | 139 | ||
140 | r = r << 4; | 140 | r = r << 4; |
141 | 141 | ||
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp index 81ec79f..14092bf 100644 --- a/noncore/graphics/drawpad/thumbnailview.cpp +++ b/noncore/graphics/drawpad/thumbnailview.cpp | |||
@@ -53,35 +53,35 @@ PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) | |||
53 | 53 | ||
54 | float scale = (widthScale < heightScale ? widthScale : heightScale); | 54 | float scale = (widthScale < heightScale ? widthScale : heightScale); |
55 | QImage thumbnailImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); | 55 | QImage thumbnailImage = image.smoothScale((int)(image.width() * scale) , (int)(image.height() * scale)); |
56 | 56 | ||
57 | m_thumbnail.convertFromImage(thumbnailImage); | 57 | m_thumbnail.convertFromImage(thumbnailImage); |
58 | 58 | ||
59 | m_titleText = QObject::tr("Title:") + " " + m_pPage->title(); | 59 | m_titleText = QObject::tr("Title:") + " " + m_pPage->title(); |
60 | m_dimensionText = QObject::tr("Dimension:") + " " + QString::number(m_pPage->width()) | 60 | m_dimensionText = QObject::tr("Dimension:") + " " + QString::number(m_pPage->width()) |
61 | + "x" + QString::number(m_pPage->height()); | 61 | + "x" + QString::number(m_pPage->height()); |
62 | m_dateText = QObject::tr("Date:") + " " + dateTimeString(m_pPage->lastModified()); | 62 | m_dateText = QObject::tr("Date:") + " " + dateTimeString(m_pPage->lastModified()); |
63 | 63 | ||
64 | QColor baseColor = parent->colorGroup().base(); | 64 | QColor baseColor = parent->colorGroup().base(); |
65 | int h, s, v; | 65 | int h, s, v; |
66 | baseColor.hsv(&h, &s, &v); | 66 | baseColor.hsv(&h, &s, &v); |
67 | 67 | ||
68 | if (v > 128) { | 68 | if (v > 128) { |
69 | m_alternateColor = baseColor.dark(106); | 69 | m_alternateColor = baseColor.dark(115); |
70 | } else if (baseColor != Qt::black) { | 70 | } else if (baseColor != Qt::black) { |
71 | m_alternateColor = baseColor.light(110); | 71 | m_alternateColor = baseColor.light(115); |
72 | } else { | 72 | } else { |
73 | m_alternateColor = QColor(32, 32, 32); | 73 | m_alternateColor = QColor(32, 32, 32); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | PageListBoxItem::~PageListBoxItem() | 77 | PageListBoxItem::~PageListBoxItem() |
78 | { | 78 | { |
79 | } | 79 | } |
80 | 80 | ||
81 | int PageListBoxItem::height(const QListBox*) const | 81 | int PageListBoxItem::height(const QListBox*) const |
82 | { | 82 | { |
83 | return QMAX(THUMBNAIL_SIZE + 4, QApplication::globalStrut().height()); | 83 | return QMAX(THUMBNAIL_SIZE + 4, QApplication::globalStrut().height()); |
84 | } | 84 | } |
85 | 85 | ||
86 | int PageListBoxItem::width(const QListBox* lb) const | 86 | int PageListBoxItem::width(const QListBox* lb) const |
87 | { | 87 | { |