summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
Diffstat (limited to 'kabc/addressee.cpp') (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
@@ -788,61 +788,65 @@ Agent Addressee::agent() const
788{ 788{
789 return mData->agent; 789 return mData->agent;
790} 790}
791 791
792QString Addressee::agentLabel() 792QString Addressee::agentLabel()
793{ 793{
794 return i18n("Agent"); 794 return i18n("Agent");
795} 795}
796 796
797 797
798 798
799void Addressee::setNameFromString( const QString &str ) 799void Addressee::setNameFromString( const QString &str )
800{ 800{
801 setFormattedName( str ); 801 setFormattedName( str );
802 setName( str ); 802 setName( str );
803 803
804 QStringList titles; 804 static bool first = true;
805 titles += i18n( "Dr." ); 805 static QStringList titles;
806 titles += i18n( "Miss" ); 806 static QStringList suffixes;
807 titles += i18n( "Mr." ); 807 static QStringList prefixes;
808 titles += i18n( "Mrs." ); 808
809 titles += i18n( "Ms." ); 809 if ( first ) {
810 titles += i18n( "Prof." ); 810 first = false;
811 811 titles += i18n( "Dr." );
812 QStringList suffixes; 812 titles += i18n( "Miss" );
813 suffixes += i18n( "I" ); 813 titles += i18n( "Mr." );
814 suffixes += i18n( "II" ); 814 titles += i18n( "Mrs." );
815 suffixes += i18n( "III" ); 815 titles += i18n( "Ms." );
816 suffixes += i18n( "Jr." ); 816 titles += i18n( "Prof." );
817 suffixes += i18n( "Sr." ); 817
818 818 suffixes += i18n( "I" );
819 QStringList prefixes; 819 suffixes += i18n( "II" );
820 prefixes += "van"; 820 suffixes += i18n( "III" );
821 prefixes += "von"; 821 suffixes += i18n( "Jr." );
822 prefixes += "de"; 822 suffixes += i18n( "Sr." );
823 823
824//US KConfig config( "kabcrc" ); 824 prefixes += "van";
825 KConfig config( locateLocal( "config", "kabcrc") ); 825 prefixes += "von";
826 config.setGroup( "General" ); 826 prefixes += "de";
827 titles += config.readListEntry( "Prefixes" ); 827
828 titles.remove( "" ); 828 KConfig config( locateLocal( "config", "kabcrc") );
829 prefixes += config.readListEntry( "Inclusions" ); 829 config.setGroup( "General" );
830 prefixes.remove( "" ); 830 titles += config.readListEntry( "Prefixes" );
831 suffixes += config.readListEntry( "Suffixes" ); 831 titles.remove( "" );
832 suffixes.remove( "" ); 832 prefixes += config.readListEntry( "Inclusions" );
833 prefixes.remove( "" );
834 suffixes += config.readListEntry( "Suffixes" );
835 suffixes.remove( "" );
836 }
833 837
834 // clear all name parts 838 // clear all name parts
835 setPrefix( "" ); 839 setPrefix( "" );
836 setGivenName( "" ); 840 setGivenName( "" );
837 setAdditionalName( "" ); 841 setAdditionalName( "" );
838 setFamilyName( "" ); 842 setFamilyName( "" );
839 setSuffix( "" ); 843 setSuffix( "" );
840 844
841 if ( str.isEmpty() ) 845 if ( str.isEmpty() )
842 return; 846 return;
843 847
844 int i = str.find(','); 848 int i = str.find(',');
845 if( i < 0 ) { 849 if( i < 0 ) {
846 QStringList parts = QStringList::split( " ", str ); 850 QStringList parts = QStringList::split( " ", str );
847 int leftOffset = 0; 851 int leftOffset = 0;
848 int rightOffset = parts.count() - 1; 852 int rightOffset = parts.count() - 1;