summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimcontact.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimcontact.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp
index 48a74d0..36e9a93 100644
--- a/libopie2/opiepim/core/opimcontact.cpp
+++ b/libopie2/opiepim/core/opimcontact.cpp
@@ -1128,112 +1128,112 @@ class QString OPimContact::recordField( int pos ) const
1128 1128
1129// In future releases, we should store birthday and anniversary 1129// In future releases, we should store birthday and anniversary
1130// internally as QDate instead of QString ! 1130// internally as QDate instead of QString !
1131// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se) 1131// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se)
1132 1132
1133/*! \fn void OPimContact::setBirthday( const QDate& date ) 1133/*! \fn void OPimContact::setBirthday( const QDate& date )
1134 Sets the birthday for the contact to \a date. If date is null 1134 Sets the birthday for the contact to \a date. If date is null
1135 the current stored date will be removed. 1135 the current stored date will be removed.
1136*/ 1136*/
1137void OPimContact::setBirthday( const QDate &v ) 1137void OPimContact::setBirthday( const QDate &v )
1138{ 1138{
1139 if ( v.isNull() ) 1139 if ( v.isNull() )
1140 { 1140 {
1141 owarn << "Remove Birthday" << oendl; 1141 owarn << "Remove Birthday" << oendl;
1142 replace( Qtopia::Birthday, QString::null ); 1142 replace( Qtopia::Birthday, QString::null );
1143 return ; 1143 return ;
1144 } 1144 }
1145 1145
1146 if ( v.isValid() ) 1146 if ( v.isValid() )
1147 replace( Qtopia::Birthday, OPimDateConversion::dateToString( v ) ); 1147 replace( Qtopia::Birthday, OPimDateConversion::dateToString( v ) );
1148 1148
1149} 1149}
1150 1150
1151 1151
1152/*! \fn void OPimContact::setAnniversary( const QDate &date ) 1152/*! \fn void OPimContact::setAnniversary( const QDate &date )
1153 Sets the anniversary of the contact to \a date. If date is 1153 Sets the anniversary of the contact to \a date. If date is
1154 null, the current stored date will be removed. 1154 null, the current stored date will be removed.
1155*/ 1155*/
1156void OPimContact::setAnniversary( const QDate &v ) 1156void OPimContact::setAnniversary( const QDate &v )
1157{ 1157{
1158 if ( v.isNull() ) 1158 if ( v.isNull() )
1159 { 1159 {
1160 owarn << "Remove Anniversary" << oendl; 1160 owarn << "Remove Anniversary" << oendl;
1161 replace( Qtopia::Anniversary, QString::null ); 1161 replace( Qtopia::Anniversary, QString::null );
1162 return ; 1162 return ;
1163 } 1163 }
1164 1164
1165 if ( v.isValid() ) 1165 if ( v.isValid() )
1166 replace( Qtopia::Anniversary, OPimDateConversion::dateToString( v ) ); 1166 replace( Qtopia::Anniversary, OPimDateConversion::dateToString( v ) );
1167} 1167}
1168 1168
1169 1169
1170/*! \fn QDate OPimContact::birthday() const 1170/*! \fn QDate OPimContact::birthday() const
1171 Returns the birthday of the contact. 1171 Returns the birthday of the contact.
1172*/ 1172*/
1173QDate OPimContact::birthday() const 1173QDate OPimContact::birthday() const
1174{ 1174{
1175 QString str = find( Qtopia::Birthday ); 1175 QString str = find( Qtopia::Birthday );
1176 // qWarning ("Birthday %s", str.latin1() ); 1176 // owarn << "Birthday " << str << oendl;
1177 if ( !str.isEmpty() ) 1177 if ( !str.isEmpty() )
1178 return OPimDateConversion::dateFromString ( str ); 1178 return OPimDateConversion::dateFromString ( str );
1179 else 1179 else
1180 return QDate(); 1180 return QDate();
1181} 1181}
1182 1182
1183 1183
1184/*! \fn QDate OPimContact::anniversary() const 1184/*! \fn QDate OPimContact::anniversary() const
1185 Returns the anniversary of the contact. 1185 Returns the anniversary of the contact.
1186*/ 1186*/
1187QDate OPimContact::anniversary() const 1187QDate OPimContact::anniversary() const
1188{ 1188{
1189 QDate empty; 1189 QDate empty;
1190 QString str = find( Qtopia::Anniversary ); 1190 QString str = find( Qtopia::Anniversary );
1191 // qWarning ("Anniversary %s", str.latin1() ); 1191 // owarn << "Anniversary " << str << oendl;
1192 if ( !str.isEmpty() ) 1192 if ( !str.isEmpty() )
1193 return OPimDateConversion::dateFromString ( str ); 1193 return OPimDateConversion::dateFromString ( str );
1194 else 1194 else
1195 return empty; 1195 return empty;
1196} 1196}
1197 1197
1198 1198
1199void OPimContact::insertEmail( const QString &v ) 1199void OPimContact::insertEmail( const QString &v )
1200{ 1200{
1201 //odebug << "insertEmail " << v << "" << oendl; 1201 //odebug << "insertEmail " << v << "" << oendl;
1202 QString e = v.simplifyWhiteSpace(); 1202 QString e = v.simplifyWhiteSpace();
1203 QString def = defaultEmail(); 1203 QString def = defaultEmail();
1204 1204
1205 // if no default, set it as the default email and don't insert 1205 // if no default, set it as the default email and don't insert
1206 if ( def.isEmpty() ) 1206 if ( def.isEmpty() )
1207 { 1207 {
1208 setDefaultEmail( e ); // will insert into the list for us 1208 setDefaultEmail( e ); // will insert into the list for us
1209 return ; 1209 return ;
1210 } 1210 }
1211 1211
1212 // otherwise, insert assuming doesn't already exist 1212 // otherwise, insert assuming doesn't already exist
1213 QString emailsStr = find( Qtopia::Emails ); 1213 QString emailsStr = find( Qtopia::Emails );
1214 if ( emailsStr.contains( e ) ) 1214 if ( emailsStr.contains( e ) )
1215 return ; 1215 return ;
1216 if ( !emailsStr.isEmpty() ) 1216 if ( !emailsStr.isEmpty() )
1217 emailsStr += emailSeparator(); 1217 emailsStr += emailSeparator();
1218 emailsStr += e; 1218 emailsStr += e;
1219 replace( Qtopia::Emails, emailsStr ); 1219 replace( Qtopia::Emails, emailsStr );
1220} 1220}
1221 1221
1222 1222
1223 void OPimContact::removeEmail( const QString &v ) 1223 void OPimContact::removeEmail( const QString &v )
1224{ 1224{
1225 QString e = v.simplifyWhiteSpace(); 1225 QString e = v.simplifyWhiteSpace();
1226 QString def = defaultEmail(); 1226 QString def = defaultEmail();
1227 QString emailsStr = find( Qtopia::Emails ); 1227 QString emailsStr = find( Qtopia::Emails );
1228 QStringList emails = emailList(); 1228 QStringList emails = emailList();
1229 1229
1230 // otherwise, must first contain it 1230 // otherwise, must first contain it
1231 if ( !emailsStr.contains( e ) ) 1231 if ( !emailsStr.contains( e ) )
1232 return ; 1232 return ;
1233 1233
1234 // remove it 1234 // remove it
1235 //odebug << " removing email from list " << e << "" << oendl; 1235 //odebug << " removing email from list " << e << "" << oendl;
1236 emails.remove( e ); 1236 emails.remove( e );
1237 // reset the string 1237 // reset the string
1238 emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator 1238 emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator
1239 replace( Qtopia::Emails, emailsStr ); 1239 replace( Qtopia::Emails, emailsStr );