From kde-commits Thu Jan 06 14:57:48 2005 From: Tobias Koenig Date: Thu, 06 Jan 2005 14:57:48 +0000 To: kde-commits Subject: kdelibs/kabc Message-Id: <20050106145748.77EDA1B91E () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110502348425217 CVS commit by tokoe: We can't use QString::startsWith() here, because 'Netherlands' != 'Netherlands Antilles' ;) CCMAIL:96082-done@bugs.kde.org M +4 -5 address.cpp 1.29 --- kdelibs/kabc/address.cpp #1.28:1.29 @@ -528,10 +528,9 @@ QString Address::countryToISO( const QSt QString strbuf = s.readLine(); while( !strbuf.isNull() ) { - if ( strbuf.startsWith( cname ) ) { - int index = strbuf.findRev('\t'); - strbuf = strbuf.mid(index+1, 2); + QStringList countryInfo = QStringList::split( '\t', strbuf, true ); + if ( countryInfo[ 0 ] == cname ) { file.close(); - mISOMap->insert( cname, strbuf ); - return strbuf; + mISOMap->insert( cname, countryInfo[ 1 ] ); + return countryInfo[ 1 ]; } strbuf = s.readLine();