[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kabc
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2005-01-06 14:57:48
Message-ID: 20050106145748.77EDA1B91E () office ! kde ! org
[Download RAW message or body]

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();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic