author | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
commit | a9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (unidiff) | |
tree | 13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/settings/packagemanager/oconfitem.h | |
parent | 48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff) | |
download | opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.zip opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.gz opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.bz2 |
CONTROL files : changed version string
NS2 many changes and first release of OT2
Diffstat (limited to 'noncore/settings/packagemanager/oconfitem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index 9972c00..7b52ce4 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h | |||
@@ -1,89 +1,94 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OCONFITEM_H | 32 | #ifndef OCONFITEM_H |
33 | #define OCONFITEM_H | 33 | #define OCONFITEM_H |
34 | 34 | ||
35 | #include <qlist.h> | 35 | #include <qlist.h> |
36 | #include <qstring.h> | 36 | #include <qstring.h> |
37 | 37 | ||
38 | class OConfItem | 38 | class OConfItem |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | enum Type { Source, Destination, Option, Arch, NotDefined }; | 41 | enum Type { Source=0x01, |
42 | GzSource=0x02, | ||
43 | Destination=0x04, | ||
44 | Option=0x08, | ||
45 | Arch=0x10, | ||
46 | NotDefined=0x20 }; | ||
42 | 47 | ||
43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, | 48 | OConfItem( Type type = NotDefined, const QString &name = QString::null, |
44 | const QString &value = QString::null, const QString &features = QString::null, | 49 | const QString &value = QString::null, const QString &features = QString::null, |
45 | bool active = true ); | 50 | bool active = true ); |
46 | 51 | ||
47 | Type type() { return m_type; } | 52 | Type type() { return m_type; } |
48 | const QString &name() { return m_name; } | 53 | const QString &name() { return m_name; } |
49 | const QString &value() { return m_value; } | 54 | const QString &value() { return m_value; } |
50 | const QString &features() { return m_features; } | 55 | const QString &features() { return m_features; } |
51 | bool active() { return m_active; } | 56 | bool active() { return m_active; } |
52 | 57 | ||
53 | void setType( Type type ) { m_type = type; } | 58 | void setType( Type type ) { m_type = type; } |
54 | void setName( const QString &name ) { m_name = name; } | 59 | void setName( const QString &name ) { m_name = name; } |
55 | void setValue( const QString &value ) { m_value = value; } | 60 | void setValue( const QString &value ) { m_value = value; } |
56 | void setFeatures( const QString &features ) { m_features = features; } | 61 | void setFeatures( const QString &features ) { m_features = features; } |
57 | void setActive( bool active ) { m_active = active; } | 62 | void setActive( bool active ) { m_active = active; } |
58 | 63 | ||
59 | private: | 64 | private: |
60 | Type m_type; // Type of configuration item | 65 | Type m_type; // Type of configuration item |
61 | QString m_name; // Name of item | 66 | QString m_name; // Name of item |
62 | QString m_value; // Value of item | 67 | QString m_value; // Value of item |
63 | QString m_features; // Comma-deliminated list of features this item supports | 68 | QString m_features; // Comma-deliminated list of features this item supports |
64 | bool m_active; // Indicates whether item is currently active | 69 | bool m_active; // Indicates whether item is currently active |
65 | }; | 70 | }; |
66 | 71 | ||
67 | class OConfItemList : public QList<OConfItem> | 72 | class OConfItemList : public QList<OConfItem> |
68 | { | 73 | { |
69 | private: | 74 | private: |
70 | 75 | ||
71 | int compareItems( QCollection::Item item1, QCollection::Item item2 ) | 76 | int compareItems( QCollection::Item item1, QCollection::Item item2 ) |
72 | { | 77 | { |
73 | // Sort by OConfItem location then by type | 78 | // Sort by OConfItem location then by type |
74 | OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); | 79 | OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); |
75 | OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); | 80 | OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); |
76 | if ( type1 < type2 ) | 81 | if ( type1 < type2 ) |
77 | return -1; | 82 | return -1; |
78 | else if ( type1 == type2 ) | 83 | else if ( type1 == type2 ) |
79 | { | 84 | { |
80 | QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); | 85 | QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); |
81 | QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); | 86 | QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); |
82 | if ( name1 < name2 ) | 87 | if ( name1 < name2 ) |
83 | return -1; | 88 | return -1; |
84 | else if ( name1 == name2 ) | 89 | else if ( name1 == name2 ) |
85 | return 0; | 90 | return 0; |
86 | else /*if ( name1 > name2 )*/ | 91 | else /*if ( name1 > name2 )*/ |
87 | return 1; | 92 | return 1; |
88 | } | 93 | } |
89 | else /*if ( type1 > type2 )*/ | 94 | else /*if ( type1 > type2 )*/ |