summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oconfitem.h
authordrw <drw>2004-04-21 18:20:31 (UTC)
committer drw <drw>2004-04-21 18:20:31 (UTC)
commitac414fa3802b471857bc84ecdd0d37200541b0a7 (patch) (side-by-side diff)
treeb3557b5f67444c891f98fd3153a30d2cbd765636 /noncore/settings/packagemanager/oconfitem.h
parenta3c0ad0bddfdfd2a2ed476229df1ef8032a93871 (diff)
downloadopie-ac414fa3802b471857bc84ecdd0d37200541b0a7.zip
opie-ac414fa3802b471857bc84ecdd0d37200541b0a7.tar.gz
opie-ac414fa3802b471857bc84ecdd0d37200541b0a7.tar.bz2
Added some missed QWhatsThis, removed OConfItem location as it is not used/needed, reordered includes to follow conventions, removed all using namespaces occurrances and updated documentation
Diffstat (limited to 'noncore/settings/packagemanager/oconfitem.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oconfitem.h35
1 files changed, 16 insertions, 19 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h
index aeee511..db77980 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -40,23 +40,20 @@ class OConfItem
public:
enum Type { Source, Destination, Option, Arch, NotDefined };
- OConfItem( const QString &location = 0x0, Type type = NotDefined, const QString &name = 0x0,
- const QString &value = 0x0, bool active = true );
+ OConfItem( Type type = NotDefined, const QString &name = 0x0, const QString &value = 0x0,
+ bool active = true );
- const QString &location() { return m_location; }
Type type() { return m_type; }
const QString &name() { return m_name; }
const QString &value() { return m_value; }
bool active() { return m_active; }
- void setLocation( const QString &location ) { m_location = location; }
- void setType( Type type ) { m_type = type; }
- void setName( const QString &name ) { m_name = name; }
- void setValue( const QString &value ) { m_value = value; }
- void setActive( bool active ) { m_active = active; }
+ void setType( Type type ) { m_type = type; }
+ void setName( const QString &name ) { m_name = name; }
+ void setValue( const QString &value ) { m_value = value; }
+ void setActive( bool active ) { m_active = active; }
private:
- QString m_location; // Configuration file where item is located
Type m_type; // Type of configuration item
QString m_name; // Name of item
QString m_value; // Value of item
@@ -70,22 +67,22 @@ private:
int compareItems( QCollection::Item item1, QCollection::Item item2 )
{
// Sort by OConfItem location then by type
- QString loc1 = reinterpret_cast<OConfItem*>(item1)->location();
- QString loc2 = reinterpret_cast<OConfItem*>(item2)->location();
- if ( loc1 < loc2 )
+ OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type();
+ OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type();
+ if ( type1 < type2 )
return -1;
- else if ( loc1 == loc2 )
+ else if ( type1 == type2 )
{
- OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type();
- OConfItem::Type type2 = reinterpret_cast<OConfItem*>(item2)->type();
- if ( type1 < type2 )
+ QString name1 = reinterpret_cast<OConfItem*>(item1)->name();
+ QString name2 = reinterpret_cast<OConfItem*>(item2)->name();
+ if ( name1 < name2 )
return -1;
- else if ( type1 == type2 )
+ else if ( name1 == name2 )
return 0;
- else /*if ( type1 > type2 )*/
+ else /*if ( name1 > name2 )*/
return 1;
}
- else /*if ( loc1 > loc2 )*/
+ else /*if ( type1 > type2 )*/
return 1;
}
};