author | mickeyl <mickeyl> | 2003-05-02 22:56:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-02 22:56:35 (UTC) |
commit | 5ca7f12dab929b21c133f785a3328c949df69401 (patch) (unidiff) | |
tree | 483e834905954a6b63cdd7ae1491474f365ddcf3 | |
parent | 9325b8e82d2cf1df1233bcfb21d91f61f8e444a3 (diff) | |
download | opie-5ca7f12dab929b21c133f785a3328c949df69401.zip opie-5ca7f12dab929b21c133f785a3328c949df69401.tar.gz opie-5ca7f12dab929b21c133f785a3328c949df69401.tar.bz2 |
fix a long standing bug and hard to reproducable bug where wellenreiter segfaulted,
but just if you played the "open/close-game" with the items and subitems
Note to self: QListViewItem::itemBelow() != QListViewItem::nextSibling() !!!
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 7733934..b8aa81c 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -114,44 +114,26 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo | |||
114 | QString s; | 114 | QString s; |
115 | MScanListItem* network; | 115 | MScanListItem* network; |
116 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); | 116 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); |
117 | 117 | ||
118 | while ( item && ( item->text( 0 ) != essid ) ) | 118 | while ( item && ( item->text( col_essid ) != essid ) ) |
119 | { | 119 | { |
120 | qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); | 120 | qDebug( "itemtext: %s", (const char*) item->text( col_essid ) ); |
121 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | 121 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
122 | } | 122 | } |
123 | if ( item ) | 123 | if ( item ) |
124 | { | 124 | { |
125 | // animate the item | ||
126 | |||
127 | /* | ||
128 | |||
129 | const QPixmap* pixmap = item->pixmap( 0 ); | ||
130 | const QPixmap* nextpixmap = ani2; | ||
131 | if ( pixmap == ani1 ) | ||
132 | nextpixmap = ani2; | ||
133 | else if ( pixmap == ani2 ) | ||
134 | nextpixmap = ani3; | ||
135 | else if ( pixmap == ani3 ) | ||
136 | nextpixmap = ani4; | ||
137 | else if ( pixmap == ani4 ) | ||
138 | nextpixmap = ani1; | ||
139 | item->setPixmap( 0, *nextpixmap ); */ | ||
140 | |||
141 | //qDebug( "current pixmap %d, next %d", pixmap, nextpixmap ); | ||
142 | |||
143 | // we have already seen this net, check all childs if MAC exists | 125 | // we have already seen this net, check all childs if MAC exists |
144 | 126 | ||
145 | network = item; | 127 | network = item; |
146 | 128 | ||
147 | item = static_cast<MScanListItem*> ( item->firstChild() ); | 129 | item = static_cast<MScanListItem*> ( item->firstChild() ); |
148 | assert( item ); // this shouldn't fail | 130 | assert( item ); // this shouldn't fail |
149 | 131 | ||
150 | while ( item && ( item->text( 2 ) != macaddr ) ) | 132 | while ( item && ( item->text( col_ap ) != macaddr ) ) |
151 | { | 133 | { |
152 | qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); | 134 | qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) ); |
153 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | 135 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
154 | } | 136 | } |
155 | 137 | ||
156 | if ( item ) | 138 | if ( item ) |
157 | { | 139 | { |
@@ -198,9 +180,9 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr ) | |||
198 | 180 | ||
199 | while ( subitem && ( subitem->text( col_ap ) != addr ) ) | 181 | while ( subitem && ( subitem->text( col_ap ) != addr ) ) |
200 | { | 182 | { |
201 | qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); | 183 | qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); |
202 | subitem = static_cast<MScanListItem*> ( subitem->itemBelow() ); | 184 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); |
203 | } | 185 | } |
204 | 186 | ||
205 | if ( subitem ) | 187 | if ( subitem ) |
206 | { | 188 | { |