[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise/kdepim/libkcal
From: Allen Winter <winter () kde ! org>
Date: 2010-09-30 23:22:42
Message-ID: 20100930232242.41E26AC892 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1181415 by winterz:
gee.. displayViewLinkPerson() and displayViewFormatPerson().. and they
do almost the same thing. make them one.
MERGE: trunk
M +5 -35 incidenceformatter.cpp
--- branches/kdepim/enterprise/kdepim/libkcal/incidenceformatter.cpp #1181414:1181415
@@ -283,17 +283,14 @@
* Helper functions for the extensive display (display viewer)
*******************************************************************/
-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.
- QString iconPath = attendeeStatusIconPath( status );
-
QString personString;
if ( !iconPath.isEmpty() ) {
personString += "<img valign=\"top\" src=\"" + iconPath + "\">" + " ";
@@ -316,34 +313,11 @@
}
static QString displayViewFormatPerson( const QString &email, const QString &name,
- const QString &uid, const QString &iconPath )
+ const QString &uid, Attendee::PartStat status )
{
- // 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;
-
- QString personString;
- if ( !iconPath.isEmpty() ) {
- personString += "<img valign=\"top\" src=\"" + iconPath + "\">" + " ";
+ return displayViewFormatPerson( email, name, uid, attendeeStatusIconPath( status ) );
}
- // Make the uid link
- if ( !printUid.isEmpty() ) {
- personString += htmlAddUidLink( email, printName, printUid );
- } else {
- // No UID, just show some text
- personString += ( printName.isEmpty() ? email : printName );
- }
-
- // Make the mailto link
- if ( !email.isEmpty() ) {
- personString += " " + htmlAddMailtoLink( email, printName );
- }
-
- return personString;
-}
-
static QString displayViewFormatAttendeeRoleList( Incidence *incidence, Attendee::Role role )
{
QString tmpStr;
@@ -360,7 +334,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)" ).arg( a->delegator() );
}
@@ -491,16 +465,12 @@
QString uid = event->customProperty("KABC","UID-1");
QString name = event->customProperty("KABC","NAME-1");
QString email= event->customProperty("KABC","EMAIL-1");
-
- QString iconPath = KGlobal::iconLoader()->iconPath( "organizer", KIcon::Small );
QString tmpStr = displayViewFormatPerson( email, name, uid, QString() );
if ( event->customProperty( "KABC", "ANNIVERSARY") == "YES" ) {
uid = event->customProperty("KABC","UID-2");
name = event->customProperty("KABC","NAME-2");
email= event->customProperty("KABC","EMAIL-2");
-
- iconPath = KGlobal::iconLoader()->iconPath( "organizer", KIcon::Small );
tmpStr += "<br>" + displayViewFormatPerson( email, name, uid, QString() );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic