author | mickeyl <mickeyl> | 2003-02-24 21:37:49 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-24 21:37:49 (UTC) |
commit | d14b92ef8984ae654ff187bf6c8f5946d3ba218d (patch) (unidiff) | |
tree | fd209280150b48eb137315d9bfe693892525697e /noncore/net/wellenreiter/cornucopia/olistview.cpp | |
parent | 93151a1467b45759d320ce6673160190d6ab8872 (diff) | |
download | opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.zip opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.tar.gz opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.tar.bz2 |
- work around yet another g++ 2.x bug
- started work on saving session to xml
[ any classes from libopie I can reuse without too much effort? ]
Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.cpp b/noncore/net/wellenreiter/cornucopia/olistview.cpp index bca17b2..8bc59de 100644 --- a/noncore/net/wellenreiter/cornucopia/olistview.cpp +++ b/noncore/net/wellenreiter/cornucopia/olistview.cpp | |||
@@ -193,56 +193,56 @@ void OListViewItem::init() | |||
193 | const QColor &OListViewItem::backgroundColor() | 193 | const QColor &OListViewItem::backgroundColor() |
194 | { | 194 | { |
195 | return isAlternate() ? static_cast<OListView*>(listView())->alternateBackground() : | 195 | return isAlternate() ? static_cast<OListView*>(listView())->alternateBackground() : |
196 | listView()->viewport()->colorGroup().base(); | 196 | listView()->viewport()->colorGroup().base(); |
197 | } | 197 | } |
198 | 198 | ||
199 | bool OListViewItem::isAlternate() | 199 | bool OListViewItem::isAlternate() |
200 | { | 200 | { |
201 | OListView *lv = static_cast<OListView*>( listView() ); | 201 | OListView *lv = static_cast<OListView*>( listView() ); |
202 | 202 | ||
203 | // check if the item above is an OListViewItem | 203 | // check if the item above is an OListViewItem |
204 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); | 204 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); |
205 | /*if (not itemAbove()->inherits( "OListViewItem" )) return false;*/ | 205 | /*if (! itemAbove()->inherits( "OListViewItem" )) return false;*/ |
206 | 206 | ||
207 | // check if we have a valid alternate background color | 207 | // check if we have a valid alternate background color |
208 | if (not (lv && lv->alternateBackground().isValid())) return false; | 208 | if (!(lv && lv->alternateBackground().isValid())) return false; |
209 | 209 | ||
210 | m_known = above ? above->m_known : true; | 210 | m_known = above ? above->m_known : true; |
211 | if (m_known) | 211 | if (m_known) |
212 | { | 212 | { |
213 | m_odd = above ? !above->m_odd : false; | 213 | m_odd = above ? !above->m_odd : false; |
214 | } | 214 | } |
215 | else | 215 | else |
216 | { | 216 | { |
217 | OListViewItem *item; | 217 | OListViewItem *item; |
218 | bool previous = true; | 218 | bool previous = true; |
219 | if (parent()) | 219 | if (parent()) |
220 | { | 220 | { |
221 | item = static_cast<OListViewItem *>(parent()); | 221 | item = static_cast<OListViewItem *>(parent()); |
222 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; | 222 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; |
223 | item = static_cast<OListViewItem *>(parent()->firstChild()); | 223 | item = static_cast<OListViewItem *>(parent()->firstChild()); |
224 | /* if !( item.inherits( "OListViewItem" ) item = 0; */ | 224 | /* if ( !item.inherits( "OListViewItem" ) item = 0; */ |
225 | } | 225 | } |
226 | else | 226 | else |
227 | { | 227 | { |
228 | item = static_cast<OListViewItem *>(lv->firstChild()); | 228 | item = static_cast<OListViewItem *>(lv->firstChild()); |
229 | } | 229 | } |
230 | 230 | ||
231 | while(item) | 231 | while(item) |
232 | { | 232 | { |
233 | item->m_odd = previous = !previous; | 233 | item->m_odd = previous = !previous; |
234 | item->m_known = true; | 234 | item->m_known = true; |
235 | item = static_cast<OListViewItem *>(item->nextSibling()); | 235 | item = static_cast<OListViewItem *>(item->nextSibling()); |
236 | /* if !(item.inherits( "OListViewItem" ) ) break; */ | 236 | /* if (!item.inherits( "OListViewItem" ) ) break; */ |
237 | } | 237 | } |
238 | } | 238 | } |
239 | return m_odd; | 239 | return m_odd; |
240 | } | 240 | } |
241 | 241 | ||
242 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | 242 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) |
243 | { | 243 | { |
244 | QColorGroup _cg = cg; | 244 | QColorGroup _cg = cg; |
245 | const QPixmap *pm = listView()->viewport()->backgroundPixmap(); | 245 | const QPixmap *pm = listView()->viewport()->backgroundPixmap(); |
246 | if (pm && !pm->isNull()) | 246 | if (pm && !pm->isNull()) |
247 | { | 247 | { |
248 | _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm)); | 248 | _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm)); |