author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/tableviewer/ui | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/apps/tableviewer/ui/tvlistview.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp index b10ff1d..c3e6432 100644 --- a/noncore/apps/tableviewer/ui/tvlistview.cpp +++ b/noncore/apps/tableviewer/ui/tvlistview.cpp | |||
@@ -1,45 +1,52 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
20 | #include "tvlistview.h" | 21 | #include "tvlistview.h" |
21 | #include "../db/common.h" | 22 | #include "../db/common.h" |
23 | |||
24 | /* OPIE */ | ||
25 | #include <opie2/odebug.h> | ||
26 | using namespace Opie::Core; | ||
27 | |||
28 | /* QT */ | ||
22 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
23 | #include <qlistview.h> | 30 | #include <qlistview.h> |
24 | #include <qlayout.h> | 31 | #include <qlayout.h> |
25 | 32 | ||
26 | void TVListViewPrivate::setColumnWidth(int column, int width) | 33 | void TVListViewPrivate::setColumnWidth(int column, int width) |
27 | { | 34 | { |
28 | if(width > 70) width = 70; | 35 | if(width > 70) width = 70; |
29 | QListView::setColumnWidth(column, width); | 36 | QListView::setColumnWidth(column, width); |
30 | } | 37 | } |
31 | 38 | ||
32 | void TVListViewPrivate::setSorting(int column, bool increasing) | 39 | void TVListViewPrivate::setSorting(int column, bool increasing) |
33 | { | 40 | { |
34 | emit sortChanged(column); | 41 | emit sortChanged(column); |
35 | QListView::setSorting(column, increasing); | 42 | QListView::setSorting(column, increasing); |
36 | } | 43 | } |
37 | 44 | ||
38 | TVListViewPrivate::TVListViewPrivate(QWidget *parent, const char* name, | 45 | TVListViewPrivate::TVListViewPrivate(QWidget *parent, const char* name, |
39 | WFlags fl) : QListView(parent, name, fl) { | 46 | WFlags fl) : QListView(parent, name, fl) { |
40 | ; | 47 | ; |
41 | } | 48 | } |
42 | 49 | ||
43 | class TVListViewItem : public QListViewItem | 50 | class TVListViewItem : public QListViewItem |
44 | { | 51 | { |
45 | public: | 52 | public: |
@@ -142,49 +149,49 @@ void TVListView::removeItem() | |||
142 | it = 0; | 149 | it = 0; |
143 | } | 150 | } |
144 | } | 151 | } |
145 | 152 | ||
146 | delete other.current(); | 153 | delete other.current(); |
147 | } | 154 | } |
148 | 155 | ||
149 | void TVListView::clearItems() | 156 | void TVListView::clearItems() |
150 | { | 157 | { |
151 | /* This is ok since the destructor for TVListItem does not know about | 158 | /* This is ok since the destructor for TVListItem does not know about |
152 | the data_reference pointer.. and hence will leave it alone */ | 159 | the data_reference pointer.. and hence will leave it alone */ |
153 | listViewDisplay->clear(); | 160 | listViewDisplay->clear(); |
154 | delete it; | 161 | delete it; |
155 | it = new QListViewItemIterator(listViewDisplay); | 162 | it = new QListViewItemIterator(listViewDisplay); |
156 | } | 163 | } |
157 | 164 | ||
158 | void TVListView::first() | 165 | void TVListView::first() |
159 | { | 166 | { |
160 | delete it; | 167 | delete it; |
161 | it = new QListViewItemIterator(listViewDisplay); | 168 | it = new QListViewItemIterator(listViewDisplay); |
162 | } | 169 | } |
163 | 170 | ||
164 | void TVListView::last() | 171 | void TVListView::last() |
165 | { | 172 | { |
166 | qWarning("TVListView::last not yet implemented"); | 173 | owarn << "TVListView::last not yet implemented" << oendl; |
167 | } | 174 | } |
168 | 175 | ||
169 | void TVListView::next() | 176 | void TVListView::next() |
170 | { | 177 | { |
171 | QListViewItemIterator tmp = *it; | 178 | QListViewItemIterator tmp = *it; |
172 | (*it)++; | 179 | (*it)++; |
173 | if (!it->current()) { | 180 | if (!it->current()) { |
174 | *it = tmp; | 181 | *it = tmp; |
175 | } | 182 | } |
176 | } | 183 | } |
177 | 184 | ||
178 | void TVListView::previous() | 185 | void TVListView::previous() |
179 | { | 186 | { |
180 | QListViewItemIterator tmp = *it; | 187 | QListViewItemIterator tmp = *it; |
181 | (*it)--; | 188 | (*it)--; |
182 | if (!it->current()) { | 189 | if (!it->current()) { |
183 | *it = tmp; | 190 | *it = tmp; |
184 | } | 191 | } |
185 | } | 192 | } |
186 | 193 | ||
187 | DataElem *TVListView::getCurrentData() { | 194 | DataElem *TVListView::getCurrentData() { |
188 | if (it->current()) { | 195 | if (it->current()) { |
189 | return ((TVListViewItem *)it->current())->getDataElem(); | 196 | return ((TVListViewItem *)it->current())->getDataElem(); |
190 | } | 197 | } |