Diffstat (limited to 'noncore/settings/packagemanager/oconfitem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index 7c158c9..9972c00 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h | |||
@@ -32,40 +32,44 @@ _;:, .> :=|. This program is free software; you can | |||
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, Destination, Option, Arch, NotDefined }; |
42 | 42 | ||
43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, | 43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, |
44 | const QString &value = QString::null, bool active = true ); | 44 | const QString &value = QString::null, const QString &features = QString::null, |
45 | bool active = true ); | ||
45 | 46 | ||
46 | Type type() { return m_type; } | 47 | Type type() { return m_type; } |
47 | const QString &name() { return m_name; } | 48 | const QString &name() { return m_name; } |
48 | const QString &value() { return m_value; } | 49 | const QString &value() { return m_value; } |
50 | const QString &features() { return m_features; } | ||
49 | bool active() { return m_active; } | 51 | bool active() { return m_active; } |
50 | 52 | ||
51 | void setType( Type type ) { m_type = type; } | 53 | void setType( Type type ) { m_type = type; } |
52 | void setName( const QString &name ) { m_name = name; } | 54 | void setName( const QString &name ) { m_name = name; } |
53 | void setValue( const QString &value ) { m_value = value; } | 55 | void setValue( const QString &value ) { m_value = value; } |
54 | void setActive( bool active ) { m_active = active; } | 56 | void setFeatures( const QString &features ) { m_features = features; } |
57 | void setActive( bool active ) { m_active = active; } | ||
55 | 58 | ||
56 | private: | 59 | private: |
57 | Type m_type; // Type of configuration item | 60 | Type m_type; // Type of configuration item |
58 | QString m_name; // Name of item | 61 | QString m_name; // Name of item |
59 | QString m_value; // Value of item | 62 | QString m_value; // Value of item |
63 | QString m_features; // Comma-deliminated list of features this item supports | ||
60 | bool m_active; // Indicates whether item is currently active | 64 | bool m_active; // Indicates whether item is currently active |
61 | }; | 65 | }; |
62 | 66 | ||
63 | class OConfItemList : public QList<OConfItem> | 67 | class OConfItemList : public QList<OConfItem> |
64 | { | 68 | { |
65 | private: | 69 | private: |
66 | 70 | ||
67 | int compareItems( QCollection::Item item1, QCollection::Item item2 ) | 71 | int compareItems( QCollection::Item item1, QCollection::Item item2 ) |
68 | { | 72 | { |
69 | // Sort by OConfItem location then by type | 73 | // Sort by OConfItem location then by type |
70 | OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); | 74 | OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); |
71 | OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); | 75 | OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type(); |