From 00e9f7731c19604a8e79df9e935ec833fc1937f8 Mon Sep 17 00:00:00 2001 From: eilers Date: Tue, 18 Feb 2003 11:55:59 +0000 Subject: Fixing categoryNames in opimrecord which was just checking for Todo List Now we get the categories in addressbook, too ! --- (limited to 'libopie2') diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index ac0f4a9..d45417a 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp @@ -30,14 +30,14 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { /* * category names */ -QStringList OPimRecord::categoryNames()const { +QStringList OPimRecord::categoryNames( const QString& appname ) const { QStringList list; QArray cats = categories(); Categories catDB; catDB.load( categoryFileName() ); for (uint i = 0; i < cats.count(); i++ ) { - list << catDB.label("Todo List", cats[i] ); + list << catDB.label( appname, cats[i] ); } return list; diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index 665530f..c7f9460 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h @@ -38,7 +38,7 @@ public: /** * category names resolved */ - QStringList categoryNames()const; + QStringList categoryNames( const QString& appname )const; /** * set category names they will be resolved diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp index 178559b..9cccfc8 100644 --- a/libopie2/opiepim/ocontact.cpp +++ b/libopie2/opiepim/ocontact.cpp @@ -627,9 +627,9 @@ QString OContact::toRichText() const text += "" + QObject::tr("Nickname: ") + "" + Qtopia::escapeString(str) + "
"; - if ( categoryNames().count() ){ + if ( categoryNames("Contacts").count() ){ text += "" + QObject::tr( "Category:") + " "; - text += categoryNames().join(", "); + text += categoryNames("Contacts").join(", "); text += "
"; } diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index cde2b3d..b4d4aa9 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp @@ -255,7 +255,7 @@ QString OTodo::toRichText() const } text += "" + QObject::tr( "Category:") + " "; - text += categoryNames().join(", "); + text += categoryNames( "Todo List" ).join(", "); text += "
"; return text; -- cgit v0.9.0.2