summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -23,30 +23,32 @@
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "today.h"
#include <opie2/odebug.h>
#include <opie2/opluginloader.h>
+#include <opie2/opimcontact.h>
+#include <opie2/ocontactaccessbackend_vcard.h>
+#include <opie2/ocontactaccess.h>
#include <opie2/oconfig.h>
#include <opie2/oresource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
-#include <qpe/contact.h>
#include <qdir.h>
#include <qtimer.h>
#include <qwhatsthis.h>
#include <qmessagebox.h>
using namespace Opie::Ui;
using Opie::Core::OPluginItem;
using Opie::Core::OPluginLoader;
using Opie::Core::OPluginManager;
using Opie::Core::OConfig;
@@ -123,27 +125,29 @@ void Today::setRefreshTimer( int interval ) {
// 0 is "never" case
if ( !interval == 0 ) {
connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
m_refreshTimer->changeInterval( interval );
}
}
/**
* Initialises the owner field with the default value, the username
*/
void Today::setOwnerField() {
- QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
- if ( QFile::exists( file ) ) {
- Contact cont = Contact::readVCard( file )[0];
+ QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf");
+ Opie::OPimContactAccess acc( "today", vfilename,
+ new Opie::OPimContactAccessBackend_VCard("today", vfilename ) );
+ if ( acc.load() ) {
+ Opie::OPimContact cont = acc.allRecords()[0];
QString returnString = cont.fullName();
OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
} else {
OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
}
}
/**
* Set the owner field with a given QString, for example per qcop.
*/
void Today::setOwnerField( QString &message ) {
if ( !message.isEmpty() ) {