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

List:       kde-commits
Subject:    kdenonbeta/applets/kim
From:       Malte Starostik <malte () kde ! org>
Date:       2004-03-17 22:01:36
Message-ID: 20040317220136.B79C099B4 () office ! kde ! org
[Download RAW message or body]

CVS commit by malte: 

Some fixes in name formatting and number comparison that have been lying
around here for very long. As I'm sharing my ISDN line w/ two others now
I definately need to add multi-user facilities to kimd and write a client
for that other OS somewhen.


  M +5 -6      kim.cpp   1.44
  M +10 -4     phonebook.cpp   1.13


--- kdenonbeta/applets/kim/kim.cpp  #1.43:1.44
@@ -165,8 +165,7 @@ void KIM::resizeEvent( QResizeEvent* )
 void KIM::paintEvent( QPaintEvent*e )
 {
-        QPixmap cache( width(), height() );
-        QPainter p( &cache );
-        if ( backgroundPixmap() ) p.drawTiledPixmap( rect(), *backgroundPixmap() );
-        else p.fillRect( rect(), backgroundColor() );
+        QPixmap buffer( width(), height() );
+    buffer.fill( this, 0, 0 );
+        QPainter p( &buffer );
         if ( !m_netLinks.count() )
         {
@@ -187,5 +186,5 @@ void KIM::paintEvent( QPaintEvent*e )
         if ( m_callAlert ) p.drawPixmap( 0, 0, SmallIcon( "phonecall" ) );
         p.end();
-        bitBlt( this, e->rect().topLeft(), &cache, e->rect() );
+        bitBlt( this, e->rect().topLeft(), &buffer, e->rect() );
 }
 

--- kdenonbeta/applets/kim/phonebook.cpp  #1.12:1.13
@@ -49,8 +49,11 @@ PhoneBook::Entry::Entry( const QString& 
 {
         m_prettyPhone = addressee.phoneNumber( type ).number();
+        QString name = addressee.formattedName();
+        if ( name.isEmpty() )
+                name = ( addressee.givenName() + ' ' + addressee.familyName() ).stripWhiteSpace();
         if ( addressee.phoneNumbers().count() > 1 )
                 m_name = i18n( "Caller's name (phone type)", "%1 (%2)" )
-                        .arg( addressee.formattedName() ).arg( phoneType( type ) );
-        else m_name = addressee.formattedName();
+                        .arg( name ).arg( phoneType( type ) );
+        else m_name = name;
 }
 
@@ -134,5 +137,8 @@ const PhoneBook::Entry PhoneBook::find( 
                                         QString splatted = ( *pit ).number();
                                         splatted.replace( QRegExp( "[^\\d]" ), "" );
-                                        if ( splatted == phone )
+                                        QString noZero = phone;
+                                        noZero.replace( QRegExp( "^0*" ), "" );
+                                        // FIXME: check for default country and city code etc.
+                                        if ( splatted.endsWith( noZero ) )
                                         {
                                                 result = Entry( phone, *ait, ( *pit ).type() );


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

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