author | eilers <eilers> | 2003-02-18 11:55:59 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-02-18 11:55:59 (UTC) |
commit | 00e9f7731c19604a8e79df9e935ec833fc1937f8 (patch) (side-by-side diff) | |
tree | 7bf9b8230832e2138af7e73740b28eafc4c33101 | |
parent | 065f26b161f6df269cfbf9c75751c09453350995 (diff) | |
download | opie-00e9f7731c19604a8e79df9e935ec833fc1937f8.zip opie-00e9f7731c19604a8e79df9e935ec833fc1937f8.tar.gz opie-00e9f7731c19604a8e79df9e935ec833fc1937f8.tar.bz2 |
Fixing categoryNames in opimrecord which was just checking for Todo List
Now we get the categories in addressbook, too !
-rw-r--r-- | libopie/pim/ocontact.cpp | 4 | ||||
-rw-r--r-- | libopie/pim/opimrecord.cpp | 4 | ||||
-rw-r--r-- | libopie/pim/opimrecord.h | 2 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 178559b..9cccfc8 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp @@ -606,51 +606,51 @@ QString OContact::toRichText() const str = spouse(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Spouse: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; if ( birthday().isValid() ){ str = TimeString::numberDateString( birthday() ); text += "<b>" + QObject::tr("Birthday: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } if ( anniversary().isValid() ){ str = TimeString::numberDateString( anniversary() ); text += "<b>" + QObject::tr("Anniversary: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } str = children(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Children: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; - if ( categoryNames().count() ){ + if ( categoryNames("Contacts").count() ){ text += "<b>" + QObject::tr( "Category:") + "</b> "; - text += categoryNames().join(", "); + text += categoryNames("Contacts").join(", "); text += "<br>"; } // notes last if ( !(value = notes()).isEmpty() ) { text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { QString value = v.stripWhiteSpace(); if ( value.isEmpty() ) mMap.remove( key ); diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp index ac0f4a9..d45417a 100644 --- a/libopie/pim/opimrecord.cpp +++ b/libopie/pim/opimrecord.cpp @@ -9,56 +9,56 @@ Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); OPimRecord::OPimRecord( int uid ) : Qtopia::Record() { setUid( uid ); } OPimRecord::~OPimRecord() { } OPimRecord::OPimRecord( const OPimRecord& rec ) : Qtopia::Record( rec ) { (*this) = rec; } OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { Qtopia::Record::operator=( rec ); m_xrefman = rec.m_xrefman; return *this; } /* * category names */ -QStringList OPimRecord::categoryNames()const { +QStringList OPimRecord::categoryNames( const QString& appname ) const { QStringList list; QArray<int> 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; } void OPimRecord::setCategoryNames( const QStringList& ) { } void OPimRecord::addCategoryName( const QString& ) { Categories catDB; catDB.load( categoryFileName() ); } bool OPimRecord::isEmpty()const { return ( uid() == 0 ); } /*QString OPimRecord::crossToString()const { QString str; QMap<QString, QArray<int> >::ConstIterator it; for (it = m_relations.begin(); it != m_relations.end(); ++it ) { QArray<int> id = it.data(); for ( uint i = 0; i < id.size(); ++i ) { str += it.key() + "," + QString::number( i ) + ";"; } diff --git a/libopie/pim/opimrecord.h b/libopie/pim/opimrecord.h index 665530f..c7f9460 100644 --- a/libopie/pim/opimrecord.h +++ b/libopie/pim/opimrecord.h @@ -17,49 +17,49 @@ */ class OPimRecord : public Qtopia::Record { public: /** * c'tor * uid of 0 isEmpty * uid of 1 will be assigned a new one */ OPimRecord(int uid = 0); ~OPimRecord(); /** * copy c'tor */ OPimRecord( const OPimRecord& rec ); /** * copy operator */ OPimRecord &operator=( const OPimRecord& ); /** * category names resolved */ - QStringList categoryNames()const; + QStringList categoryNames( const QString& appname )const; /** * set category names they will be resolved */ void setCategoryNames( const QStringList& ); /** * addCategoryName adds a name * to the internal category list */ void addCategoryName( const QString& ); /** * if a Record isEmpty * it's empty if it's 0 */ virtual bool isEmpty()const; /** * toRichText summary */ virtual QString toRichText()const = 0; /** diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index cde2b3d..b4d4aa9 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp @@ -234,49 +234,49 @@ QString OTodo::toRichText() const QStringList catlist; // Description of the todo if ( !summary().isEmpty() ) { text += "<b>" + QObject::tr( "Summary:") + "</b><br>"; text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; } if( !description().isEmpty() ){ text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; } text += "<br><br><br>"; text += "<b>" + QObject::tr( "Priority:") +" </b>" + QString::number( priority() ) + " <br>"; text += "<b>" + QObject::tr( "Progress:") + " </b>" + QString::number( progress() ) + " %<br>"; if (hasDueDate() ){ text += "<b>" + QObject::tr( "Deadline:") + " </b>"; text += dueDate().toString(); text += "<br>"; } text += "<b>" + QObject::tr( "Category:") + "</b> "; - text += categoryNames().join(", "); + text += categoryNames( "Todo List" ).join(", "); text += "<br>"; return text; } OPimNotifyManager& OTodo::notifiers() { return data->notifiers; } bool OTodo::operator<( const OTodo &toDoEvent )const{ if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; if( !hasDueDate() && toDoEvent.hasDueDate() ) return false; if( hasDueDate() && toDoEvent.hasDueDate() ){ if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide return priority() < toDoEvent.priority(); }else{ return dueDate() < toDoEvent.dueDate(); } } return false; } bool OTodo::operator<=(const OTodo &toDoEvent )const { if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; if( !hasDueDate() && toDoEvent.hasDueDate() ) return true; 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 @@ -9,56 +9,56 @@ Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); OPimRecord::OPimRecord( int uid ) : Qtopia::Record() { setUid( uid ); } OPimRecord::~OPimRecord() { } OPimRecord::OPimRecord( const OPimRecord& rec ) : Qtopia::Record( rec ) { (*this) = rec; } OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { Qtopia::Record::operator=( rec ); m_xrefman = rec.m_xrefman; return *this; } /* * category names */ -QStringList OPimRecord::categoryNames()const { +QStringList OPimRecord::categoryNames( const QString& appname ) const { QStringList list; QArray<int> 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; } void OPimRecord::setCategoryNames( const QStringList& ) { } void OPimRecord::addCategoryName( const QString& ) { Categories catDB; catDB.load( categoryFileName() ); } bool OPimRecord::isEmpty()const { return ( uid() == 0 ); } /*QString OPimRecord::crossToString()const { QString str; QMap<QString, QArray<int> >::ConstIterator it; for (it = m_relations.begin(); it != m_relations.end(); ++it ) { QArray<int> id = it.data(); for ( uint i = 0; i < id.size(); ++i ) { str += it.key() + "," + QString::number( i ) + ";"; } 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 @@ -17,49 +17,49 @@ */ class OPimRecord : public Qtopia::Record { public: /** * c'tor * uid of 0 isEmpty * uid of 1 will be assigned a new one */ OPimRecord(int uid = 0); ~OPimRecord(); /** * copy c'tor */ OPimRecord( const OPimRecord& rec ); /** * copy operator */ OPimRecord &operator=( const OPimRecord& ); /** * category names resolved */ - QStringList categoryNames()const; + QStringList categoryNames( const QString& appname )const; /** * set category names they will be resolved */ void setCategoryNames( const QStringList& ); /** * addCategoryName adds a name * to the internal category list */ void addCategoryName( const QString& ); /** * if a Record isEmpty * it's empty if it's 0 */ virtual bool isEmpty()const; /** * toRichText summary */ virtual QString toRichText()const = 0; /** 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 @@ -606,51 +606,51 @@ QString OContact::toRichText() const str = spouse(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Spouse: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; if ( birthday().isValid() ){ str = TimeString::numberDateString( birthday() ); text += "<b>" + QObject::tr("Birthday: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } if ( anniversary().isValid() ){ str = TimeString::numberDateString( anniversary() ); text += "<b>" + QObject::tr("Anniversary: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } str = children(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Children: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; - if ( categoryNames().count() ){ + if ( categoryNames("Contacts").count() ){ text += "<b>" + QObject::tr( "Category:") + "</b> "; - text += categoryNames().join(", "); + text += categoryNames("Contacts").join(", "); text += "<br>"; } // notes last if ( !(value = notes()).isEmpty() ) { text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { QString value = v.stripWhiteSpace(); if ( value.isEmpty() ) mMap.remove( key ); 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 @@ -234,49 +234,49 @@ QString OTodo::toRichText() const QStringList catlist; // Description of the todo if ( !summary().isEmpty() ) { text += "<b>" + QObject::tr( "Summary:") + "</b><br>"; text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; } if( !description().isEmpty() ){ text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; } text += "<br><br><br>"; text += "<b>" + QObject::tr( "Priority:") +" </b>" + QString::number( priority() ) + " <br>"; text += "<b>" + QObject::tr( "Progress:") + " </b>" + QString::number( progress() ) + " %<br>"; if (hasDueDate() ){ text += "<b>" + QObject::tr( "Deadline:") + " </b>"; text += dueDate().toString(); text += "<br>"; } text += "<b>" + QObject::tr( "Category:") + "</b> "; - text += categoryNames().join(", "); + text += categoryNames( "Todo List" ).join(", "); text += "<br>"; return text; } OPimNotifyManager& OTodo::notifiers() { return data->notifiers; } bool OTodo::operator<( const OTodo &toDoEvent )const{ if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; if( !hasDueDate() && toDoEvent.hasDueDate() ) return false; if( hasDueDate() && toDoEvent.hasDueDate() ){ if( dueDate() == toDoEvent.dueDate() ){ // let's the priority decide return priority() < toDoEvent.priority(); }else{ return dueDate() < toDoEvent.dueDate(); } } return false; } bool OTodo::operator<=(const OTodo &toDoEvent )const { if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; if( !hasDueDate() && toDoEvent.hasDueDate() ) return true; |