Diffstat (limited to 'noncore/settings/packagemanager/oconfitem.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 23 |
1 files changed, 10 insertions, 13 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 @@ -42,6 +42,5 @@ public: - 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; } @@ -51,3 +50,2 @@ public: - void setLocation( const QString &location ) { m_location = location; } void setType( Type type ) { m_type = type; } @@ -58,3 +56,2 @@ public: private: - QString m_location; // Configuration file where item is located Type m_type; // Type of configuration item @@ -72,8 +69,2 @@ private: // Sort by OConfItem location then by type - QString loc1 = reinterpret_cast<OConfItem*>(item1)->location(); - QString loc2 = reinterpret_cast<OConfItem*>(item2)->location(); - if ( loc1 < loc2 ) - return -1; - else if ( loc1 == loc2 ) - { OConfItem::Type type1 = reinterpret_cast<OConfItem*>(item1)->type(); @@ -83,7 +74,13 @@ private: else if ( type1 == type2 ) + { + QString name1 = reinterpret_cast<OConfItem*>(item1)->name(); + QString name2 = reinterpret_cast<OConfItem*>(item2)->name(); + if ( name1 < name2 ) + return -1; + 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; |