Diffstat (limited to 'libopie2/opieui/oversatileviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/oversatileviewitem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opieui/oversatileviewitem.cpp b/libopie2/opieui/oversatileviewitem.cpp index 66de8eb..03c6738 100644 --- a/libopie2/opieui/oversatileviewitem.cpp +++ b/libopie2/opieui/oversatileviewitem.cpp | |||
@@ -1,129 +1,131 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <opie2/oversatileviewitem.h> | 31 | #include <opie2/oversatileviewitem.h> |
32 | #include <opie2/oversatileview.h> | 32 | #include <opie2/oversatileview.h> |
33 | 33 | ||
34 | using namespace Opie::Ui; | ||
35 | |||
34 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) | 36 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) |
35 | :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), | 37 | :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), |
36 | _versatileview( parent ) | 38 | _versatileview( parent ) |
37 | { | 39 | { |
38 | init(); | 40 | init(); |
39 | } | 41 | } |
40 | 42 | ||
41 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ) | 43 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ) |
42 | :OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ), | 44 | :OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ), |
43 | _versatileview( parent ) | 45 | _versatileview( parent ) |
44 | { | 46 | { |
45 | init(); | 47 | init(); |
46 | } | 48 | } |
47 | 49 | ||
48 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, | 50 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, |
49 | QString a, QString b, QString c, QString d, | 51 | QString a, QString b, QString c, QString d, |
50 | QString e, QString f, QString g, QString h ) | 52 | QString e, QString f, QString g, QString h ) |
51 | :OListViewItem( parent->_listview, a, b, c, d, e, f, g, h ), | 53 | :OListViewItem( parent->_listview, a, b, c, d, e, f, g, h ), |
52 | QIconViewItem( parent->_iconview, a ), | 54 | QIconViewItem( parent->_iconview, a ), |
53 | _versatileview( parent ) | 55 | _versatileview( parent ) |
54 | { | 56 | { |
55 | init(); | 57 | init(); |
56 | } | 58 | } |
57 | 59 | ||
58 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem* after, | 60 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem* after, |
59 | QString a, QString b, QString c, QString d, | 61 | QString a, QString b, QString c, QString d, |
60 | QString e, QString f, QString g, QString h ) | 62 | QString e, QString f, QString g, QString h ) |
61 | :OListViewItem( parent->_listview, after, a, b, c, d, e, f, g, h ), | 63 | :OListViewItem( parent->_listview, after, a, b, c, d, e, f, g, h ), |
62 | QIconViewItem( parent->_iconview, after, a ), | 64 | QIconViewItem( parent->_iconview, after, a ), |
63 | _versatileview( parent ) | 65 | _versatileview( parent ) |
64 | { | 66 | { |
65 | init(); | 67 | init(); |
66 | } | 68 | } |
67 | 69 | ||
68 | OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent, | 70 | OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent, |
69 | QString a, QString b, QString c, QString d, | 71 | QString a, QString b, QString c, QString d, |
70 | QString e, QString f, QString g, QString h ) | 72 | QString e, QString f, QString g, QString h ) |
71 | :OListViewItem( parent, a, b, c, d, e, f, g, h ), | 73 | :OListViewItem( parent, a, b, c, d, e, f, g, h ), |
72 | QIconViewItem( parent->_versatileview->_iconview, a ), | 74 | QIconViewItem( parent->_versatileview->_iconview, a ), |
73 | _versatileview( parent->_versatileview ) | 75 | _versatileview( parent->_versatileview ) |
74 | { | 76 | { |
75 | init(); | 77 | init(); |
76 | } | 78 | } |
77 | 79 | ||
78 | OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem* after, | 80 | OVersatileViewItem::OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem* after, |
79 | QString a, QString b, QString c, QString d, | 81 | QString a, QString b, QString c, QString d, |
80 | QString e, QString f, QString g, QString h ) | 82 | QString e, QString f, QString g, QString h ) |
81 | :OListViewItem( parent, after, a, b, c, d, e, f, g, h ), | 83 | :OListViewItem( parent, after, a, b, c, d, e, f, g, h ), |
82 | QIconViewItem( parent->_versatileview->_iconview, after, a ), | 84 | QIconViewItem( parent->_versatileview->_iconview, after, a ), |
83 | _versatileview( parent->_versatileview ) | 85 | _versatileview( parent->_versatileview ) |
84 | { | 86 | { |
85 | init(); | 87 | init(); |
86 | } | 88 | } |
87 | 89 | ||
88 | OVersatileViewItem::~OVersatileViewItem() | 90 | OVersatileViewItem::~OVersatileViewItem() |
89 | { | 91 | { |
90 | } | 92 | } |
91 | 93 | ||
92 | OVersatileView* OVersatileViewItem::versatileView() const | 94 | OVersatileView* OVersatileViewItem::versatileView() const |
93 | { | 95 | { |
94 | return _versatileview; | 96 | return _versatileview; |
95 | } | 97 | } |
96 | 98 | ||
97 | void OVersatileViewItem::init() | 99 | void OVersatileViewItem::init() |
98 | { | 100 | { |
99 | if ( !firstChild() ) | 101 | if ( !firstChild() ) |
100 | { | 102 | { |
101 | // I'm a sweet yellow and browne autumn leaf | 103 | // I'm a sweet yellow and browne autumn leaf |
102 | 104 | ||
103 | OListViewItem::setPixmap( 0, _versatileview->_treeleaf ); | 105 | OListViewItem::setPixmap( 0, _versatileview->_treeleaf ); |
104 | QIconViewItem::setPixmap( _versatileview->_iconleaf ); | 106 | QIconViewItem::setPixmap( _versatileview->_iconleaf ); |
105 | } | 107 | } |
106 | else | 108 | else |
107 | { | 109 | { |
108 | // I'm a node and I have a little baby child | 110 | // I'm a node and I have a little baby child |
109 | 111 | ||
110 | if ( isOpen() ) | 112 | if ( isOpen() ) |
111 | { | 113 | { |
112 | OListViewItem::setPixmap( 0, _versatileview->_treeopened ); | 114 | OListViewItem::setPixmap( 0, _versatileview->_treeopened ); |
113 | QIconViewItem::setPixmap( _versatileview->_iconopened ); | 115 | QIconViewItem::setPixmap( _versatileview->_iconopened ); |
114 | } | 116 | } |
115 | else | 117 | else |
116 | { | 118 | { |
117 | OListViewItem::setPixmap( 0, _versatileview->_treeclosed ); | 119 | OListViewItem::setPixmap( 0, _versatileview->_treeclosed ); |
118 | QIconViewItem::setPixmap( _versatileview->_iconclosed ); | 120 | QIconViewItem::setPixmap( _versatileview->_iconclosed ); |
119 | } | 121 | } |
120 | } | 122 | } |
121 | 123 | ||
122 | } | 124 | } |
123 | 125 | ||
124 | void OVersatileViewItem::setRenameEnabled( bool allow ) | 126 | void OVersatileViewItem::setRenameEnabled( bool allow ) |
125 | { | 127 | { |
126 | #if (QT_VERSION >= 0x030000) | 128 | #if (QT_VERSION >= 0x030000) |
127 | OListViewItem::setRenameEnabled( 0, allow ); // TODO: Backport to Qt-Embedded 2.x? | 129 | OListViewItem::setRenameEnabled( 0, allow ); // TODO: Backport to Qt-Embedded 2.x? |
128 | #endif | 130 | #endif |
129 | QIconViewItem::setRenameEnabled( allow ); | 131 | QIconViewItem::setRenameEnabled( allow ); |