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

List:       kde-commits
Subject:    KDE/kdepimlibs/kcal
From:       Sergio Luis Martins <iamsergio () gmail ! com>
Date:       2010-06-16 16:53:28
Message-ID: 20100616165328.58307AC8D4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1138750 by smartins:

Adapt to birthday resource changes: Wedding anniversaries now don't have the BIRTHDAY custom property.


MERGE: none



 M  +9 -14     incidenceformatter.cpp  


--- trunk/KDE/kdepimlibs/kcal/incidenceformatter.cpp #1138749:1138750
@@ -381,7 +381,8 @@
   if ( !event ) {
     return QString();
   }
-  if ( event->customProperty( "KABC", "BIRTHDAY" ) != "YES" ) {
+  if ( event->customProperty( "KABC", "BIRTHDAY" ) != "YES" &&
+       event->customProperty( "KABC", "ANNIVERSARY" ) != "YES" ) {
     return QString();
   }
 
@@ -394,13 +395,6 @@
   //TODO: add a birthday cake icon
   QString tmpStr = displayViewLinkPerson( email_1, name_1, uid_1, iconPath );
 
-  if ( event->customProperty( "KABC", "ANNIVERSARY" ) == "YES" ) {
-    QString uid_2 = event->customProperty( "KABC", "UID-2" );
-    QString name_2 = event->customProperty( "KABC", "NAME-2" );
-    QString email_2= event->customProperty( "KABC", "EMAIL-2" );
-    tmpStr += "<br>";
-    tmpStr += displayViewLinkPerson( email_2, name_2, uid_2, iconPath );
-  }
 
   return tmpStr;
 }
@@ -430,11 +424,9 @@
   if ( incidence->type() == "Event" ) {
     QString iconPath;
     if ( incidence->customProperty( "KABC", "BIRTHDAY" ) == "YES" ) {
-      if ( incidence->customProperty( "KABC", "ANNIVERSARY" ) == "YES" ) {
-        iconPath = iconLoader->iconPath( "view-calendar-anniversary", KIconLoader::Small );
-      } else {
         iconPath = iconLoader->iconPath( "view-calendar-birthday", KIconLoader::Small );
-      }
+    } else if ( incidence->customProperty( "KABC", "ANNIVERSARY" ) == "YES" ) {
+      iconPath = iconLoader->iconPath( "view-calendar-wedding-anniversary", KIconLoader::Small );
     } else {
       iconPath = iconLoader->iconPath( "view-calendar-day", KIconLoader::Small );
     }
@@ -583,9 +575,12 @@
     tmpStr += "</tr>";
   }
 
-  if ( event->customProperty( "KABC", "BIRTHDAY" ) == "YES" ) {
+  const bool isBirthday = event->customProperty( "KABC", "BIRTHDAY" ) == "YES";
+  const bool isAnniversary = event->customProperty( "KABC", "ANNIVERSARY" ) == "YES";
+
+  if ( isBirthday || isAnniversary  ) {
     tmpStr += "<tr>";
-    if ( event->customProperty( "KABC", "ANNIVERSARY" ) == "YES" ) {
+    if ( isAnniversary ) {
       tmpStr += "<td><b>" + i18n( "Anniversary:" ) + "</b></td>";
     } else {
       tmpStr += "<td><b>" + i18n( "Birthday:" ) + "</b></td>";
[prev in list] [next in list] [prev in thread] [next in thread] 

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