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

List:       kde-commits
Subject:    KDE/kdepimlibs/kcalutils
From:       Allen Winter <winter () kde ! org>
Date:       2010-09-30 23:26:12
Message-ID: 20100930232614.23B09AC891 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181417 by winterz:

forward port:

SVN commit 1181412 by winterz:
refactor: new method displayViewFormatPerson() to make a generic Person \
link kolab/issue4483

SVN commit 1181415 by winterz:
gee.. displayViewLinkPerson() and displayViewFormatPerson().. and they
do almost the same thing.  make them one.


 M  +14 -39    incidenceformatter.cpp  


--- trunk/KDE/kdepimlibs/kcalutils/incidenceformatter.cpp #1181416:1181417
@@ -271,17 +271,14 @@
  *******************************************************************/
 
 //@cond PRIVATE
-static QString displayViewLinkPerson( const QString &email, const QString \
                &name,
-                                      const QString &uid, \
Attendee::PartStat status ) +static QString displayViewFormatPerson( const \
QString &email, const QString &name, +                                      \
const QString &uid, const QString &iconPath )  {
   // Search for new print name or uid, if needed.
   QPair<QString, QString> s = searchNameAndUid( email, name, uid );
   const QString printName = s.first;
   const QString printUid = s.second;
 
-  // Get the icon corresponding to the attendee participation status.
-  const QString iconPath = attendeeStatusIconPath( status );
-
   QString personString;
   if ( !iconPath.isEmpty() ) {
     personString += "<img valign=\"top\" src=\"" + iconPath + "\">" + \
"&nbsp;"; @@ -303,36 +300,12 @@
   return personString;
 }
 
-static QString displayViewFormatOrganizer( const QString &email, const \
QString &name ) +static QString displayViewFormatPerson( const QString \
&email, const QString &name, +                                        const \
QString &uid, Attendee::PartStat status )  {
-  // Search for new print name or uid, if needed.
-  QPair<QString, QString> s = searchNameAndUid( email, name, QString() );
-  const QString printName = s.first;
-  const QString printUid = s.second;
-
-  // Get the icon for organizer
-  const QString iconPath =
-    KIconLoader::global()->iconPath( "meeting-organizer", \
                KIconLoader::Small );
-
-  QString personString;
-  personString += "<img valign=\"top\" src=\"" + iconPath + "\">" + \
                "&nbsp;";
-
-  // Make the uid link
-  if ( !printUid.isEmpty() ) {
-    personString += htmlAddUidLink( email, printName, printUid );
-  } else {
-    // No UID, just show some text
-    personString += ( printName.isEmpty() ? email : printName );
+  return displayViewFormatPerson( email, name, uid, \
attendeeStatusIconPath( status ) );  }
 
-  // Make the mailto link
-  if ( !email.isEmpty() ) {
-    personString += "&nbsp;" + htmlAddMailtoLink( email, printName );
-  }
-
-  return personString;
-}
-
 static QString displayViewFormatAttendeeRoleList( Incidence::Ptr \
incidence, Attendee::Role role )  {
   QString tmpStr;
@@ -349,7 +322,7 @@
       // skip attendee that is also the organizer
       continue;
     }
-    tmpStr += displayViewLinkPerson( a->email(), a->name(), a->uid(), \
a->status() ); +    tmpStr += displayViewFormatPerson( a->email(), \
a->name(), a->uid(), a->status() );  if ( !a->delegator().isEmpty() ) {
       tmpStr += i18n( " (delegated by %1)", a->delegator() );
     }
@@ -373,11 +346,15 @@
   if ( attendeeCount > 1 ||
        ( attendeeCount == 1 &&
          incidence->organizer()->email() != \
incidence->attendees().first()->email() ) ) { +
+    QPair<QString, QString> s = searchNameAndUid( \
incidence->organizer()->email(), +                                          \
incidence->organizer()->name(), +                                           \
QString() );  tmpStr += "<tr>";
     tmpStr += "<td><b>" + i18n( "Organizer:" ) + "</b></td>";
-    tmpStr += "<td>" +
-              displayViewFormatOrganizer( incidence->organizer()->email(),
-                                          incidence->organizer()->name() ) \
+ +    const QString iconPath = KIconLoader::global()->iconPath( \
"organizer", KIconLoader::Small ); +    tmpStr += "<td>" + \
displayViewFormatPerson( incidence->organizer()->email(), +                 \
s.first, s.second, iconPath ) +  "</td>";
     tmpStr += "</tr>";
   }
@@ -477,9 +454,7 @@
   QString name_1 = event->customProperty( "KABC", "NAME-1" );
   QString email_1= event->customProperty( "KABC", "EMAIL-1" );
 
-  //TODO: add a birthday cake icon. Make a \
                displayViewLinkBirthdayPerson(email,name,uid)
-  QString tmpStr = displayViewLinkPerson( email_1, name_1, uid_1, \
                Attendee::None );
-
+  QString tmpStr = displayViewFormatPerson( email_1, name_1, uid_1, \
QString() );  return tmpStr;
 }
 


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

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