summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2004-09-13 21:35:12 (UTC)
committer zautrix <zautrix>2004-09-13 21:35:12 (UTC)
commitbd6b4acb39498ffea3beea7d9b5f7620b60c14db (patch) (side-by-side diff)
treee2d7425b7bb49fbcb7acb5ced497ac1fed06dfaf /kabc
parent06eabf6e82c0390699d11fd12580d91261829431 (diff)
downloadkdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.zip
kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.gz
kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.bz2
Many bugfixes
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp62
1 files changed, 33 insertions, 29 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 6b282e2..4cdd5e5 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -792,53 +792,57 @@ Agent Addressee::agent() const
QString Addressee::agentLabel()
{
return i18n("Agent");
}
void Addressee::setNameFromString( const QString &str )
{
setFormattedName( str );
setName( str );
- QStringList titles;
- titles += i18n( "Dr." );
- titles += i18n( "Miss" );
- titles += i18n( "Mr." );
- titles += i18n( "Mrs." );
- titles += i18n( "Ms." );
- titles += i18n( "Prof." );
-
- QStringList suffixes;
- suffixes += i18n( "I" );
- suffixes += i18n( "II" );
- suffixes += i18n( "III" );
- suffixes += i18n( "Jr." );
- suffixes += i18n( "Sr." );
-
- QStringList prefixes;
- prefixes += "van";
- prefixes += "von";
- prefixes += "de";
-
-//US KConfig config( "kabcrc" );
- KConfig config( locateLocal( "config", "kabcrc") );
- config.setGroup( "General" );
- titles += config.readListEntry( "Prefixes" );
- titles.remove( "" );
- prefixes += config.readListEntry( "Inclusions" );
- prefixes.remove( "" );
- suffixes += config.readListEntry( "Suffixes" );
- suffixes.remove( "" );
+ static bool first = true;
+ static QStringList titles;
+ static QStringList suffixes;
+ static QStringList prefixes;
+
+ if ( first ) {
+ first = false;
+ titles += i18n( "Dr." );
+ titles += i18n( "Miss" );
+ titles += i18n( "Mr." );
+ titles += i18n( "Mrs." );
+ titles += i18n( "Ms." );
+ titles += i18n( "Prof." );
+
+ suffixes += i18n( "I" );
+ suffixes += i18n( "II" );
+ suffixes += i18n( "III" );
+ suffixes += i18n( "Jr." );
+ suffixes += i18n( "Sr." );
+
+ prefixes += "van";
+ prefixes += "von";
+ prefixes += "de";
+
+ KConfig config( locateLocal( "config", "kabcrc") );
+ config.setGroup( "General" );
+ titles += config.readListEntry( "Prefixes" );
+ titles.remove( "" );
+ prefixes += config.readListEntry( "Inclusions" );
+ prefixes.remove( "" );
+ suffixes += config.readListEntry( "Suffixes" );
+ suffixes.remove( "" );
+ }
// clear all name parts
setPrefix( "" );
setGivenName( "" );
setAdditionalName( "" );
setFamilyName( "" );
setSuffix( "" );
if ( str.isEmpty() )
return;
int i = str.find(',');