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

List:       kde-commits
Subject:    kdepim/kpilot/lib
From:       Jason vanRijn Kasper <vR () movingparts ! net>
Date:       2005-04-26 5:43:38
Message-ID: 20050426054338.986DC3C9 () office ! kde ! org
[Download RAW message or body]

CVS commit by vanrijn: 

- trying really hard now to set a sensible preferred/showPhone for the
  Pilot.  Previously, abbrowser-conduit used to blindly set it to the
  mobile phone number.  This has resulted in 99% of the contacts in my
  Pilot not showing any display number in the contact list.  Now, we'll try
  to set it to something reasonable if it's either not set or if the field
  it's set to is empty.


  M +31 -1     pilotAddress.cc   1.23


--- kdepim/kpilot/lib/pilotAddress.cc  #1.22:1.23
@@ -407,4 +407,34 @@ void PilotAddress::setPhoneNumbers(KABC:
                 }
         }
+
+#ifdef DEBUG
+        DEBUGDAEMON << fname << ": Pilot's showPhone now: ["
+                                << fAddressInfo.showPhone << "]." << endl;
+#endif
+
+        // after setting the numbers, make sure that something sensible is set as the
+        // shownPhone on the Pilot if nothing is yet...
+        QString pref = getField(fAddressInfo.showPhone + entryPhone1);
+        if (fAddressInfo.showPhone < 0 || fAddressInfo.showPhone > 4 || pref.isEmpty()) {
+#ifdef DEBUG
+        DEBUGDAEMON << fname << ": Pilot's showPhone: ["
+                                << fAddressInfo.showPhone
+                                << "] not properly set to a default. trying to set a sensible one."
+                                << endl;
+#endif
+                for (int i = entryPhone1; i <= entryPhone5; i++)
+                {
+                        pref = getField(i);
+                        if (!pref.isEmpty())
+                        {
+                                fAddressInfo.showPhone = i - entryPhone1;
+                                break;
+                        }
+                }
+        }
+#ifdef DEBUG
+        DEBUGDAEMON << fname << ": Pilot's showPhone now: ["
+                                << fAddressInfo.showPhone << "], and that's final." << endl;
+#endif
 }
 


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

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