summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 67b23e1..450ecb7 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -29,18 +29,20 @@
29*/ 29*/
30 30
31#include "today.h" 31#include "today.h"
32 32
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34#include <opie2/opluginloader.h> 34#include <opie2/opluginloader.h>
35#include <opie2/opimcontact.h>
36#include <opie2/ocontactaccessbackend_vcard.h>
37#include <opie2/ocontactaccess.h>
35#include <opie2/oconfig.h> 38#include <opie2/oconfig.h>
36#include <opie2/oresource.h> 39#include <opie2/oresource.h>
37 40
38#include <qpe/qcopenvelope_qws.h> 41#include <qpe/qcopenvelope_qws.h>
39#include <qpe/qpeapplication.h> 42#include <qpe/qpeapplication.h>
40#include <qpe/contact.h>
41 43
42#include <qdir.h> 44#include <qdir.h>
43#include <qtimer.h> 45#include <qtimer.h>
44#include <qwhatsthis.h> 46#include <qwhatsthis.h>
45#include <qmessagebox.h> 47#include <qmessagebox.h>
46 48
@@ -129,15 +131,17 @@ void Today::setRefreshTimer( int interval ) {
129 131
130 132
131/** 133/**
132 * Initialises the owner field with the default value, the username 134 * Initialises the owner field with the default value, the username
133 */ 135 */
134void Today::setOwnerField() { 136void Today::setOwnerField() {
135 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 137 QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf");
136 if ( QFile::exists( file ) ) { 138 Opie::OPimContactAccess acc( "today", vfilename,
137 Contact cont = Contact::readVCard( file )[0]; 139 new Opie::OPimContactAccessBackend_VCard("today", vfilename ) );
140 if ( acc.load() ) {
141 Opie::OPimContact cont = acc.allRecords()[0];
138 QString returnString = cont.fullName(); 142 QString returnString = cont.fullName();
139 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 143 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
140 } else { 144 } else {
141 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 145 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
142 } 146 }
143} 147}